Eigen::AutoDiffJacobian< Functor > Class Template Reference

#include <AutoDiffJacobian.h>

+ Inheritance diagram for Eigen::AutoDiffJacobian< Functor >:

Public Types

enum  { InputsAtCompileTime = InputType::RowsAtCompileTime , ValuesAtCompileTime = ValueType::RowsAtCompileTime }
 
typedef Functor::InputType InputType
 
typedef Functor::ValueType ValueType
 
typedef ValueType::Scalar Scalar
 
typedef Matrix< Scalar, ValuesAtCompileTime, InputsAtCompileTimeJacobianType
 
typedef JacobianType::Index Index
 
typedef Matrix< Scalar, InputsAtCompileTime, 1 > DerivativeType
 
typedef AutoDiffScalar< DerivativeTypeActiveScalar
 
typedef Matrix< ActiveScalar, InputsAtCompileTime, 1 > ActiveInput
 
typedef Matrix< ActiveScalar, ValuesAtCompileTime, 1 > ActiveValue
 
- Public Types inherited from Functor< Scalar_, NX, NY >
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

 AutoDiffJacobian ()
 
 AutoDiffJacobian (const Functor &f)
 
template<typename... T>
 AutoDiffJacobian (const T &... Values)
 
EIGEN_STRONG_INLINE void operator() (const InputType &x, ValueType *v) const
 
template<typename... ParamsType>
void operator() (const InputType &x, ValueType *v, JacobianType *_jac, const ParamsType &... Params) const
 
- Public Member Functions inherited from Functor< Scalar_, NX, NY >
 Functor ()
 
 Functor (int inputs, int values)
 
int inputs () const
 
int values () const
 
 Functor ()
 
 Functor (int inputs_, int values_)
 
int inputs () const
 
int values () const
 

Additional Inherited Members

- Public Attributes inherited from Functor< Scalar_, NX, NY >
const int m_inputs
 
const int m_values
 
int m_inputs
 
int m_values
 

Member Typedef Documentation

◆ ActiveInput

template<typename Functor >
typedef Matrix<ActiveScalar, InputsAtCompileTime, 1> Eigen::AutoDiffJacobian< Functor >::ActiveInput

◆ ActiveScalar

template<typename Functor >
typedef AutoDiffScalar<DerivativeType> Eigen::AutoDiffJacobian< Functor >::ActiveScalar

◆ ActiveValue

template<typename Functor >
typedef Matrix<ActiveScalar, ValuesAtCompileTime, 1> Eigen::AutoDiffJacobian< Functor >::ActiveValue

◆ DerivativeType

template<typename Functor >
typedef Matrix<Scalar, InputsAtCompileTime, 1> Eigen::AutoDiffJacobian< Functor >::DerivativeType

◆ Index

template<typename Functor >
typedef JacobianType::Index Eigen::AutoDiffJacobian< Functor >::Index

◆ InputType

template<typename Functor >
typedef Functor::InputType Eigen::AutoDiffJacobian< Functor >::InputType

◆ JacobianType

◆ Scalar

template<typename Functor >
typedef ValueType::Scalar Eigen::AutoDiffJacobian< Functor >::Scalar

◆ ValueType

template<typename Functor >
typedef Functor::ValueType Eigen::AutoDiffJacobian< Functor >::ValueType

Member Enumeration Documentation

◆ anonymous enum

template<typename Functor >
anonymous enum
Enumerator
InputsAtCompileTime 
ValuesAtCompileTime 
32 { InputsAtCompileTime = InputType::RowsAtCompileTime, ValuesAtCompileTime = ValueType::RowsAtCompileTime };
@ ValuesAtCompileTime
Definition: AutoDiffJacobian.h:32
@ InputsAtCompileTime
Definition: AutoDiffJacobian.h:32

Constructor & Destructor Documentation

◆ AutoDiffJacobian() [1/3]

template<typename Functor >
Eigen::AutoDiffJacobian< Functor >::AutoDiffJacobian ( )
inline
21 : Functor() {}
Functor()
Definition: NonLinearOptimization.cpp:106

◆ AutoDiffJacobian() [2/3]

template<typename Functor >
Eigen::AutoDiffJacobian< Functor >::AutoDiffJacobian ( const Functor f)
inline
22 : Functor(f) {}
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237

◆ AutoDiffJacobian() [3/3]

template<typename Functor >
template<typename... T>
Eigen::AutoDiffJacobian< Functor >::AutoDiffJacobian ( const T &...  Values)
inline
26 : Functor(Values...) {}
std::vector< float > Values
Definition: sparse_setter.cpp:48

Member Function Documentation

◆ operator()() [1/2]

template<typename Functor >
EIGEN_STRONG_INLINE void Eigen::AutoDiffJacobian< Functor >::operator() ( const InputType x,
ValueType v 
) const
inline
45 { this->operator()(x, v, 0); }
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
EIGEN_STRONG_INLINE void operator()(const InputType &x, ValueType *v) const
Definition: AutoDiffJacobian.h:45
list x
Definition: plotDoE.py:28

References Eigen::AutoDiffJacobian< Functor >::operator()(), and v.

Referenced by Eigen::AutoDiffJacobian< Functor >::operator()().

◆ operator()() [2/2]

template<typename Functor >
template<typename... ParamsType>
void Eigen::AutoDiffJacobian< Functor >::operator() ( const InputType x,
ValueType v,
JacobianType _jac,
const ParamsType &...  Params 
) const
inline
47  {
48  eigen_assert(v != 0);
49 
50  if (!_jac) {
51  Functor::operator()(x, v, Params...);
52  return;
53  }
54 
55  JacobianType& jac = *_jac;
56 
57  ActiveInput ax = x.template cast<ActiveScalar>();
58  ActiveValue av(jac.rows());
59 
61  for (Index j = 0; j < jac.rows(); j++) av[j].derivatives().resize(x.rows());
62 
63  for (Index i = 0; i < jac.cols(); i++) ax[i].derivatives() = DerivativeType::Unit(x.rows(), i);
64 
65  Functor::operator()(ax, &av, Params...);
66 
67  for (Index i = 0; i < jac.rows(); i++) {
68  (*v)[i] = av[i].value();
69  jac.row(i) = av[i].derivatives();
70  }
71  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define eigen_assert(x)
Definition: Macros.h:910
Matrix< Scalar, ValuesAtCompileTime, InputsAtCompileTime > JacobianType
Definition: AutoDiffJacobian.h:34
Matrix< ActiveScalar, ValuesAtCompileTime, 1 > ActiveValue
Definition: AutoDiffJacobian.h:41
JacobianType::Index Index
Definition: AutoDiffJacobian.h:35
Matrix< ActiveScalar, InputsAtCompileTime, 1 > ActiveInput
Definition: AutoDiffJacobian.h:40
const int Dynamic
Definition: Constants.h:25
ax
Definition: plotDoE.py:39
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References plotDoE::ax, Eigen::PlainObjectBase< Derived >::cols(), Eigen::Dynamic, eigen_assert, i, Eigen::AutoDiffJacobian< Functor >::InputsAtCompileTime, j, Eigen::PlainObjectBase< Derived >::resize(), Eigen::PlainObjectBase< Derived >::rows(), v, and plotDoE::x.


The documentation for this class was generated from the following file: