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_