Go to the documentation of this file.
9 #ifndef EIGEN_AUTODIFF_CHAIN_JACOBIAN_H_
10 #define EIGEN_AUTODIFF_CHAIN_JACOBIAN_H_
17 template <
typename Functor>
24 #if EIGEN_HAS_VARIADIC_TEMPLATES
25 template <
typename... T>
30 template <
typename T0>
34 template <
typename T0,
typename T1>
38 template <
typename T0,
typename T1,
typename T2>
46 typedef typename ValueType::Scalar
Scalar;
55 typedef Matrix<Scalar, ValuesAtCompileTime, JacobianInputsAtCompileTime>
JacobianType;
58 typedef typename JacobianType::Index
Index;
63 typedef Matrix<ActiveScalar, InputsAtCompileTime, 1>
ActiveInput;
64 typedef Matrix<ActiveScalar, ValuesAtCompileTime, 1>
ActiveValue;
66 #if EIGEN_HAS_VARIADIC_TEMPLATES
75 template <
typename... ParamsType>
81 template <
typename... ParamsType>
84 this->
operator()(x, v, jac,
nullptr, Params...);
87 template <
typename... ParamsType>
89 const ParamsType &... Params)
const
95 template <
typename... ParamsType>
97 const ParamsType &... Params)
const
126 for (
Index j = 0; j < jac.rows(); ++j)
127 av[j].derivatives().resize(x.rows());
129 for (
Index i = 0; i < jac.cols(); ++i)
130 ax[i].derivatives() = DerivativeType::Unit(x.rows(), i);
138 for (
Index j = 0; j < jac.rows(); ++j)
139 av[j].derivatives().resize(ijac.cols());
141 for (
Index i = 0; i < x.rows(); ++i)
142 ax[i].derivatives() = ijac.row(i);
145 #if EIGEN_HAS_VARIADIC_TEMPLATES
146 Functor::operator()(ax, av, Params...);
148 Functor::operator()(ax, av);
150 for (
Index i = 0; i < jac.rows(); ++i)
152 v[i] = av[i].value();
153 jac.row(i) = av[i].derivatives();
160 #endif // EIGEN_AUTODIFF_CHAIN_JACOBIAN_H_
AutoDiffChainJacobian(const Functor &f)
Definition: autodiff_chain_jacobian.h:22
Matrix< ActiveScalar, ValuesAtCompileTime, 1 > ActiveValue
Definition: autodiff_chain_jacobian.h:64
@ InputsAtCompileTime
Definition: autodiff_chain_jacobian.h:50
Definition: autodiff_chain_hessian.h:16
void operator()(const InputType &x, ValueType &v, JacobianType &jac=0, const InputJacobianType *_ijac=0) const
Definition: autodiff_chain_jacobian.h:115
Definition: autodiff_chain_jacobian.h:18
Definition: autodiff_scalar.h:48
Functor::InputType InputType
Definition: autodiff_chain_jacobian.h:44
AutoDiffChainJacobian(const T0 &a0)
Definition: autodiff_chain_jacobian.h:31
FunctorBase< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::Dynamic > Functor
Definition: functor.h:49
JacobianType::Index Index
Definition: autodiff_chain_jacobian.h:58
AutoDiffChainJacobian(const T0 &a0, const T1 &a1, const T2 &a2)
Definition: autodiff_chain_jacobian.h:39
AutoDiffChainJacobian()
Definition: autodiff_chain_jacobian.h:21
AutoDiffChainJacobian(const T0 &a0, const T1 &a1)
Definition: autodiff_chain_jacobian.h:35
Matrix< Scalar, ValuesAtCompileTime, JacobianInputsAtCompileTime > JacobianType
Definition: autodiff_chain_jacobian.h:55
ValueType::Scalar Scalar
Definition: autodiff_chain_jacobian.h:46
EIGEN_STRONG_INLINE void operator()(const InputType &x, ValueType &v) const
Definition: autodiff_chain_jacobian.h:100
void operator()(const InputType &x, ValueType &v, JacobianType &jac, const InputJacobianType &ijac) const
Definition: autodiff_chain_jacobian.h:110
@ ValuesAtCompileTime
Definition: autodiff_chain_jacobian.h:51
Matrix< Scalar, JacobianInputsAtCompileTime, 1 > DerivativeType
Definition: autodiff_chain_jacobian.h:60
Matrix< ActiveScalar, InputsAtCompileTime, 1 > ActiveInput
Definition: autodiff_chain_jacobian.h:63
Functor::ValueType ValueType
Definition: autodiff_chain_jacobian.h:45
AutoDiffScalar< DerivativeType > ActiveScalar
Definition: autodiff_chain_jacobian.h:61
Matrix< Scalar, InputsAtCompileTime, JacobianInputsAtCompileTime > InputJacobianType
Definition: autodiff_chain_jacobian.h:57
void operator()(const InputType &x, ValueType &v, JacobianType &jac) const
Definition: autodiff_chain_jacobian.h:105
@ JacobianInputsAtCompileTime
Definition: autodiff_chain_jacobian.h:52