TestFunc1< Scalar_, NX, NY > Struct Template Reference

Public Types

enum  { InputsAtCompileTime = NX , ValuesAtCompileTime = NY }
 
enum  { InputsAtCompileTime = NX , ValuesAtCompileTime = NY }
 
typedef Scalar_ Scalar
 
typedef Matrix< Scalar, InputsAtCompileTime, 1 > InputType
 
typedef Matrix< Scalar, ValuesAtCompileTime, 1 > ValueType
 
typedef Matrix< Scalar, ValuesAtCompileTime, InputsAtCompileTimeJacobianType
 
typedef Scalar_ Scalar
 
typedef Matrix< Scalar, InputsAtCompileTime, 1 > InputType
 
typedef Matrix< Scalar, ValuesAtCompileTime, 1 > ValueType
 
typedef Matrix< Scalar, ValuesAtCompileTime, InputsAtCompileTimeJacobianType
 

Public Member Functions

 TestFunc1 ()
 
 TestFunc1 (int inputs_, int values_)
 
int inputs () const
 
int values () const
 
template<typename T >
void operator() (const Matrix< T, InputsAtCompileTime, 1 > &x, Matrix< T, ValuesAtCompileTime, 1 > *_v) const
 
void operator() (const InputType &x, ValueType *v, JacobianType *_j) const
 
 TestFunc1 ()
 
 TestFunc1 (int inputs_, int values_)
 
int inputs () const
 
int values () const
 
template<typename T >
void operator() (const Matrix< T, InputsAtCompileTime, 1 > &x, Matrix< T, ValuesAtCompileTime, 1 > *_v) const
 
void operator() (const InputType &x, ValueType *v, JacobianType *_j) const
 

Public Attributes

int m_inputs
 
int m_values
 

Member Typedef Documentation

◆ InputType [1/2]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
typedef Matrix<Scalar, InputsAtCompileTime, 1> TestFunc1< Scalar_, NX, NY >::InputType

◆ InputType [2/2]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
typedef Matrix<Scalar, InputsAtCompileTime, 1> TestFunc1< Scalar_, NX, NY >::InputType

◆ JacobianType [1/2]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
typedef Matrix<Scalar, ValuesAtCompileTime, InputsAtCompileTime> TestFunc1< Scalar_, NX, NY >::JacobianType

◆ JacobianType [2/2]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
typedef Matrix<Scalar, ValuesAtCompileTime, InputsAtCompileTime> TestFunc1< Scalar_, NX, NY >::JacobianType

◆ Scalar [1/2]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
typedef Scalar_ TestFunc1< Scalar_, NX, NY >::Scalar

◆ Scalar [2/2]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
typedef Scalar_ TestFunc1< Scalar_, NX, NY >::Scalar

◆ ValueType [1/2]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
typedef Matrix<Scalar, ValuesAtCompileTime, 1> TestFunc1< Scalar_, NX, NY >::ValueType

◆ ValueType [2/2]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
typedef Matrix<Scalar, ValuesAtCompileTime, 1> TestFunc1< Scalar_, NX, NY >::ValueType

Member Enumeration Documentation

◆ anonymous enum

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
anonymous enum
Enumerator
InputsAtCompileTime 
ValuesAtCompileTime 
@ InputsAtCompileTime
Definition: autodiff.cpp:34
@ ValuesAtCompileTime
Definition: autodiff.cpp:34

◆ anonymous enum

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
anonymous enum
Enumerator
InputsAtCompileTime 
ValuesAtCompileTime 

Constructor & Destructor Documentation

◆ TestFunc1() [1/4]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
TestFunc1< Scalar_, NX, NY >::TestFunc1 ( )
inline
int m_inputs
Definition: autodiff.cpp:39
int m_values
Definition: autodiff.cpp:39

◆ TestFunc1() [2/4]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
TestFunc1< Scalar_, NX, NY >::TestFunc1 ( int  inputs_,
int  values_ 
)
inline
42 : m_inputs(inputs_), m_values(values_) {}

◆ TestFunc1() [3/4]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
TestFunc1< Scalar_, NX, NY >::TestFunc1 ( )
inline

◆ TestFunc1() [4/4]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
TestFunc1< Scalar_, NX, NY >::TestFunc1 ( int  inputs_,
int  values_ 
)
inline
33 : m_inputs(inputs_), m_values(values_) {}

Member Function Documentation

◆ inputs() [1/2]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
int TestFunc1< Scalar_, NX, NY >::inputs ( ) const
inline

◆ inputs() [2/2]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
int TestFunc1< Scalar_, NX, NY >::inputs ( ) const
inline
35 { return m_inputs; }

References TestFunc1< Scalar_, NX, NY >::m_inputs.

◆ operator()() [1/4]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
void TestFunc1< Scalar_, NX, NY >::operator() ( const InputType x,
ValueType v,
JacobianType _j 
) const
inline
63  {
64  (*this)(x, v);
65 
66  if (_j) {
67  JacobianType& j = *_j;
68 
69  j(0, 0) = 4 * x[0] + x[1];
70  j(1, 0) = 3 * x[1];
71 
72  j(0, 1) = x[0];
73  j(1, 1) = 3 * x[0] + 2 * 0.5 * x[1];
74 
75  if (inputs() > 2) {
76  j(0, 2) = 0.5;
77  j(1, 2) = 1;
78  }
79  if (values() > 2) {
80  j(2, 0) = 3 * x[1] * 2 * x[0];
81  j(2, 1) = 3 * x[0] * x[0];
82  }
83  if (inputs() > 2 && values() > 2) {
84  j(2, 0) *= x[2];
85  j(2, 1) *= x[2];
86 
87  j(2, 2) = 3 * x[1] * x[0] * x[0];
88  j(2, 2) = 3 * x[1] * x[0] * x[0];
89  }
90  }
91  }
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
list x
Definition: plotDoE.py:28
int values() const
Definition: autodiff.cpp:45
Matrix< Scalar, ValuesAtCompileTime, InputsAtCompileTime > JacobianType
Definition: autodiff.cpp:37
int inputs() const
Definition: autodiff.cpp:44
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References TestFunc1< Scalar_, NX, NY >::inputs(), j, v, TestFunc1< Scalar_, NX, NY >::values(), and plotDoE::x.

◆ operator()() [2/4]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
void TestFunc1< Scalar_, NX, NY >::operator() ( const InputType x,
ValueType v,
JacobianType _j 
) const
inline
54  {
55  (*this)(x, v);
56 
57  if (_j) {
58  JacobianType& j = *_j;
59 
60  j(0, 0) = 4 * x[0] + x[1];
61  j(1, 0) = 3 * x[1];
62 
63  j(0, 1) = x[0];
64  j(1, 1) = 3 * x[0] + 2 * 0.5 * x[1];
65 
66  if (inputs() > 2) {
67  j(0, 2) = 0.5;
68  j(1, 2) = 1;
69  }
70  if (values() > 2) {
71  j(2, 0) = 3 * x[1] * 2 * x[0];
72  j(2, 1) = 3 * x[0] * x[0];
73  }
74  if (inputs() > 2 && values() > 2) {
75  j(2, 0) *= x[2];
76  j(2, 1) *= x[2];
77 
78  j(2, 2) = 3 * x[1] * x[0] * x[0];
79  j(2, 2) = 3 * x[1] * x[0] * x[0];
80  }
81  }
82  }

References TestFunc1< Scalar_, NX, NY >::inputs(), j, v, TestFunc1< Scalar_, NX, NY >::values(), and plotDoE::x.

◆ operator()() [3/4]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
template<typename T >
void TestFunc1< Scalar_, NX, NY >::operator() ( const Matrix< T, InputsAtCompileTime, 1 > &  x,
Matrix< T, ValuesAtCompileTime, 1 > *  _v 
) const
inline
48  {
50 
51  v[0] = 2 * x[0] * x[0] + x[0] * x[1];
52  v[1] = 3 * x[1] * x[0] + 0.5 * x[1] * x[1];
53  if (inputs() > 2) {
54  v[0] += 0.5 * x[2];
55  v[1] += x[2];
56  }
57  if (values() > 2) {
58  v[2] = 3 * x[1] * x[0] * x[0];
59  }
60  if (inputs() > 2 && values() > 2) v[2] *= x[2];
61  }
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186

References TestFunc1< Scalar_, NX, NY >::inputs(), v, TestFunc1< Scalar_, NX, NY >::values(), and plotDoE::x.

◆ operator()() [4/4]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
template<typename T >
void TestFunc1< Scalar_, NX, NY >::operator() ( const Matrix< T, InputsAtCompileTime, 1 > &  x,
Matrix< T, ValuesAtCompileTime, 1 > *  _v 
) const
inline
39  {
41 
42  v[0] = 2 * x[0] * x[0] + x[0] * x[1];
43  v[1] = 3 * x[1] * x[0] + 0.5 * x[1] * x[1];
44  if (inputs() > 2) {
45  v[0] += 0.5 * x[2];
46  v[1] += x[2];
47  }
48  if (values() > 2) {
49  v[2] = 3 * x[1] * x[0] * x[0];
50  }
51  if (inputs() > 2 && values() > 2) v[2] *= x[2];
52  }

References TestFunc1< Scalar_, NX, NY >::inputs(), v, TestFunc1< Scalar_, NX, NY >::values(), and plotDoE::x.

◆ values() [1/2]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
int TestFunc1< Scalar_, NX, NY >::values ( ) const
inline

◆ values() [2/2]

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
int TestFunc1< Scalar_, NX, NY >::values ( ) const
inline
36 { return m_values; }

References TestFunc1< Scalar_, NX, NY >::m_values.

Member Data Documentation

◆ m_inputs

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
int TestFunc1< Scalar_, NX, NY >::m_inputs

◆ m_values

template<typename Scalar_ , int NX = Dynamic, int NY = Dynamic>
int TestFunc1< Scalar_, NX, NY >::m_values

The documentation for this struct was generated from the following files: