Eigen::AutoDiffJacobian< Functor > Class Template Reference
+ Inheritance diagram for Eigen::AutoDiffJacobian< Functor >:

Public Types

enum  {
  InputsAtCompileTime ,
  ValuesAtCompileTime
}
 
typedef Matrix< ActiveScalar, InputsAtCompileTime, 1 > ActiveInput
 
typedef AutoDiffScalar< DerivativeTypeActiveScalar
 
typedef Matrix< ActiveScalar, ValuesAtCompileTime, 1 > ActiveValue
 
typedef Matrix< Scalar, InputsAtCompileTime, 1 > DerivativeType
 
typedef JacobianType::Index Index
 
typedef Functor::InputType InputType
 
typedef Matrix< Scalar, ValuesAtCompileTime, InputsAtCompileTimeJacobianType
 
typedef ValueType::Scalar Scalar
 
typedef Functor::ValueType ValueType
 

Public Member Functions

 AutoDiffJacobian ()
 
 AutoDiffJacobian (const Functor &f)
 
template<typename... T>
 AutoDiffJacobian (const T &...Values)
 
void operator() (const InputType &x, ValueType *v) const
 
template<typename... ParamsType>
void operator() (const InputType &x, ValueType *v, JacobianType *_jac, const ParamsType &... Params) const
 

Detailed Description

template<typename Functor>
class Eigen::AutoDiffJacobian< Functor >

Definition at line 18 of file AutoDiffJacobian.h.

Member Typedef Documentation

◆ ActiveInput

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

Definition at line 43 of file AutoDiffJacobian.h.

◆ ActiveScalar

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

Definition at line 41 of file AutoDiffJacobian.h.

◆ ActiveValue

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

Definition at line 44 of file AutoDiffJacobian.h.

◆ DerivativeType

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

Definition at line 40 of file AutoDiffJacobian.h.

◆ Index

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

Definition at line 38 of file AutoDiffJacobian.h.

◆ InputType

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

Definition at line 28 of file AutoDiffJacobian.h.

◆ JacobianType

Definition at line 37 of file AutoDiffJacobian.h.

◆ Scalar

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

Definition at line 30 of file AutoDiffJacobian.h.

◆ ValueType

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

Definition at line 29 of file AutoDiffJacobian.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename Functor >
anonymous enum
Enumerator
InputsAtCompileTime 
ValuesAtCompileTime 

Definition at line 32 of file AutoDiffJacobian.h.

32  {
33  InputsAtCompileTime = InputType::RowsAtCompileTime,
34  ValuesAtCompileTime = ValueType::RowsAtCompileTime
35  };

Constructor & Destructor Documentation

◆ AutoDiffJacobian() [1/3]

template<typename Functor >
Eigen::AutoDiffJacobian< Functor >::AutoDiffJacobian ( )
inline

Definition at line 21 of file AutoDiffJacobian.h.

21 : Functor() {}

◆ AutoDiffJacobian() [2/3]

template<typename Functor >
Eigen::AutoDiffJacobian< Functor >::AutoDiffJacobian ( const Functor f)
inline

Definition at line 22 of file AutoDiffJacobian.h.

22 : Functor(f) {}

◆ AutoDiffJacobian() [3/3]

template<typename Functor >
template<typename... T>
Eigen::AutoDiffJacobian< Functor >::AutoDiffJacobian ( const T &...  Values)
inline

Definition at line 26 of file AutoDiffJacobian.h.

26 : Functor(Values...) {}

Member Function Documentation

◆ operator()() [1/2]

template<typename Functor >
void Eigen::AutoDiffJacobian< Functor >::operator() ( const InputType x,
ValueType v 
) const
inline

Definition at line 49 of file AutoDiffJacobian.h.

50  {
51  this->operator()(x, v, 0);
52  }
void operator()(const InputType &x, ValueType *v) const

◆ 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

Definition at line 54 of file AutoDiffJacobian.h.

56  {
57  eigen_assert(v!=0);
58 
59  if (!_jac)
60  {
61  Functor::operator()(x, v, Params...);
62  return;
63  }
64 
65  JacobianType& jac = *_jac;
66 
67  ActiveInput ax = x.template cast<ActiveScalar>();
68  ActiveValue av(jac.rows());
69 
71  for (Index j=0; j<jac.rows(); j++)
72  av[j].derivatives().resize(x.rows());
73 
74  for (Index i=0; i<jac.cols(); i++)
75  ax[i].derivatives() = DerivativeType::Unit(x.rows(),i);
76 
77  Functor::operator()(ax, &av, Params...);
78 
79  for (Index i=0; i<jac.rows(); i++)
80  {
81  (*v)[i] = av[i].value();
82  jac.row(i) = av[i].derivatives();
83  }
84  }
int i
#define eigen_assert(x)
Matrix< Scalar, ValuesAtCompileTime, InputsAtCompileTime > JacobianType
Matrix< ActiveScalar, ValuesAtCompileTime, 1 > ActiveValue
Matrix< ActiveScalar, InputsAtCompileTime, 1 > ActiveInput
static const BasisReturnType Unit(Index i)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
const int Dynamic
std::ptrdiff_t j

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