Go to the documentation of this file.
9 #ifndef EIGEN_AUTODIFF_CHAIN_JACOBIAN_SPARSE_H_
10 #define EIGEN_AUTODIFF_CHAIN_JACOBIAN_SPARSE_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;
58 typedef typename JacobianType::Index
Index;
64 typedef Matrix<ActiveScalar, InputsAtCompileTime, 1>
ActiveInput;
65 typedef Matrix<ActiveScalar, ValuesAtCompileTime, 1>
ActiveValue;
67 #if EIGEN_HAS_VARIADIC_TEMPLATES
76 template <
typename... ParamsType>
82 template <
typename... ParamsType>
85 this->
operator()(x, v, jac,
nullptr, Params...);
88 template <
typename... ParamsType>
90 const ParamsType &... Params)
const
96 template <
typename... ParamsType>
98 const ParamsType &... Params)
const
124 eigen_assert(x.rows() == jac.cols());
125 for (
Index j = 0; j < jac.rows(); ++j)
126 av[j].derivatives().resize(x.rows());
128 for (
Index i = 0; i < x.rows(); ++i)
130 ax[i].derivatives().resize(x.rows());
131 ax[i].derivatives().insert(i) = 1.0;
139 for (
Index j = 0; j < jac.rows(); ++j)
140 av[j].derivatives().resize(ijac.cols());
142 for (
Index i = 0; i < x.rows(); ++i)
144 ax[i].derivatives().resize(ijac.cols());
145 ax[i].derivatives() = ijac.row(i);
149 #if EIGEN_HAS_VARIADIC_TEMPLATES
150 Functor::operator()(ax, av, Params...);
152 Functor::operator()(ax, av);
155 for (
int i = 0; i < jac.rows(); ++i)
157 v[i] = av[i].value();
160 jac.insert(i, it.row()) = av[i].derivatives().coeffRef(it.row());
168 #endif // EIGEN_AUTODIFF_CHAIN_JACOBIAN_SPARSE_H_
void operator()(const InputType &x, ValueType &v, JacobianType &jac=0, const InputJacobianType *_ijac=0) const
Definition: autodiff_chain_jacobian_sparse.h:116
Definition: autodiff_chain_hessian.h:16
Definition: autodiff_scalar.h:48
Functor::InputType InputType
Definition: autodiff_chain_jacobian_sparse.h:44
AutoDiffScalar< DerivativeType > ActiveScalar
Definition: autodiff_chain_jacobian_sparse.h:61
FunctorBase< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::Dynamic > Functor
Definition: functor.h:49
ValueType::Scalar Scalar
Definition: autodiff_chain_jacobian_sparse.h:46
EIGEN_STRONG_INLINE void operator()(const InputType &x, ValueType &v) const
Definition: autodiff_chain_jacobian_sparse.h:101
SparseVector< Scalar > DerivativeType
Definition: autodiff_chain_jacobian_sparse.h:60
AutoDiffChainJacobianSparse(const T0 &a0)
Definition: autodiff_chain_jacobian_sparse.h:31
@ ValuesAtCompileTime
Definition: autodiff_chain_jacobian_sparse.h:51
SparseMatrix< Scalar > InputJacobianType
Definition: autodiff_chain_jacobian_sparse.h:57
@ InputsAtCompileTime
Definition: autodiff_chain_jacobian_sparse.h:50
Matrix< ActiveScalar, InputsAtCompileTime, 1 > ActiveInput
Definition: autodiff_chain_jacobian_sparse.h:64
AutoDiffChainJacobianSparse(const Functor &f)
Definition: autodiff_chain_jacobian_sparse.h:22
AutoDiffChainJacobianSparse()
Definition: autodiff_chain_jacobian_sparse.h:21
Matrix< ActiveScalar, ValuesAtCompileTime, 1 > ActiveValue
Definition: autodiff_chain_jacobian_sparse.h:65
JacobianType::Index Index
Definition: autodiff_chain_jacobian_sparse.h:58
Functor::ValueType ValueType
Definition: autodiff_chain_jacobian_sparse.h:45
Definition: autodiff_chain_jacobian_sparse.h:18
AutoDiffChainJacobianSparse(const T0 &a0, const T1 &a1, const T2 &a2)
Definition: autodiff_chain_jacobian_sparse.h:39
@ JacobianInputsAtCompileTime
Definition: autodiff_chain_jacobian_sparse.h:52
void operator()(const InputType &x, ValueType &v, JacobianType &jac, const InputJacobianType &ijac) const
Definition: autodiff_chain_jacobian_sparse.h:111
SparseMatrix< Scalar > JacobianType
Definition: autodiff_chain_jacobian_sparse.h:55
AutoDiffChainJacobianSparse(const T0 &a0, const T1 &a1)
Definition: autodiff_chain_jacobian_sparse.h:35
void operator()(const InputType &x, ValueType &v, JacobianType &jac) const
Definition: autodiff_chain_jacobian_sparse.h:106
DerivativeType::InnerIterator JacobianInnerIteratorType
Definition: autodiff_chain_jacobian_sparse.h:62