- 3.0.1 core module.
|
Jacobian using Auto-Diff Codegeneration. More...
#include <DerivativesCppad.h>
Public Types | |
typedef Eigen::Matrix< AD_SCALAR, IN_DIM, 1 > | IN_TYPE_AD |
function input vector type More... | |
typedef Eigen::Matrix< AD_SCALAR, OUT_DIM, 1 > | OUT_TYPE_AD |
function output vector type More... | |
typedef Eigen::Matrix< double, IN_DIM, 1 > | IN_TYPE_D |
function input vector type double More... | |
typedef Eigen::Matrix< double, OUT_DIM, 1 > | OUT_TYPE_D |
function output vector type More... | |
typedef Eigen::Matrix< double, OUT_DIM, IN_DIM > | JAC_TYPE_D |
Jacobian type. More... | |
typedef Eigen::Matrix< double, OUT_DIM, IN_DIM, Eigen::RowMajor > | JAC_TYPE_ROW_MAJOR |
Jocobian type in row-major format. More... | |
typedef Eigen::Matrix< double, IN_DIM, IN_DIM > | HES_TYPE_D |
typedef Eigen::Matrix< double, IN_DIM, IN_DIM, Eigen::RowMajor > | HES_TYPE_ROW_MAJOR |
typedef std::function< OUT_TYPE_AD(const IN_TYPE_AD &)> | FUN_TYPE_AD |
typedef Derivatives< IN_DIM, OUT_DIM > | DerivativesBase |
Public Types inherited from ct::core::Derivatives< IN_DIM, OUT_DIM, double > | |
typedef Eigen::Matrix< double, IN_DIM, 1 > | IN_TYPE |
function input vector type More... | |
typedef Eigen::Matrix< double, OUT_DIM, 1 > | OUT_TYPE |
function output vector type More... | |
typedef Eigen::Matrix< double, OUT_DIM, IN_DIM > | JAC_TYPE |
typedef Eigen::Matrix< double, IN_DIM, IN_DIM > | HES_TYPE |
Public Member Functions | |
DerivativesCppad (FUN_TYPE_AD &f, int inputDim=IN_DIM, int outputDim=OUT_DIM) | |
Constructs the derivatives for autodiff without codegeneration using a FUN_TYPE_AD function. More... | |
DerivativesCppad (const DerivativesCppad &arg) | |
copy constructor More... | |
void | update (FUN_TYPE_AD &f, const size_t inputDim=IN_DIM, const size_t outputDim=OUT_DIM) |
update the Jacobian with a new function More... | |
virtual | ~DerivativesCppad () |
destructor More... | |
DerivativesCppad * | clone () const |
deep cloning of Jacobian More... | |
virtual OUT_TYPE_D | forwardZero (const Eigen::VectorXd &x) |
Evaluates the method itself. More... | |
virtual JAC_TYPE_D | jacobian (const Eigen::VectorXd &x) |
Evaluates the jacobian with respect to the input. More... | |
virtual void | sparseJacobian (const Eigen::VectorXd &x, Eigen::VectorXd &jac, Eigen::VectorXi &iRow, Eigen::VectorXi &jCol) |
Returns the evaluated jacobian in sparse format. More... | |
virtual Eigen::VectorXd | sparseJacobianValues (const Eigen::VectorXd &x) |
Returns the non zero values of the jacobian. More... | |
virtual HES_TYPE_D | hessian (const Eigen::VectorXd &x, const Eigen::VectorXd &lambda) |
Evaluates the hessian (2nd order derivatives with respect to input) of the method. In case of a vector valued function, the method returns the weighted sum of the hessians with weights w. More... | |
virtual void | sparseHessian (const Eigen::VectorXd &x, const Eigen::VectorXd &lambda, Eigen::VectorXd &hes, Eigen::VectorXi &iRow, Eigen::VectorXi &jCol) |
Returns the weighted sum of hessian of the problem in sparse format. More... | |
virtual Eigen::VectorXd | sparseHessianValues (const Eigen::VectorXd &x, const Eigen::VectorXd &lambda) |
Returns the non zero elements of the hessian of the problem. More... | |
Public Member Functions inherited from ct::core::Derivatives< IN_DIM, OUT_DIM, double > | |
Derivatives () | |
virtual | ~Derivatives () |
default destructor More... | |
Public Attributes | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef ADScalar | AD_SCALAR |
Jacobian using Auto-Diff Codegeneration.
Uses Auto-Diff code generation to compute the Jacobian of a regular vector-valued mathematical function .
x has IN_DIM dimension and y has OUT_DIM dimension. Thus, they can be scalar functions (IN_DIM = 1, OUT_DIM = 1), fixed or variable size (IN_DIM = -1, OUT_DIM = -1) functions.
IN_DIM | Input dimensionality of the function (use Eigen::Dynamic (-1) for dynamic size) |
OUT_DIM | Output dimensionailty of the function (use Eigen::Dynamic (-1) for dynamic size) |
typedef Eigen::Matrix<AD_SCALAR, IN_DIM, 1> ct::core::DerivativesCppad< IN_DIM, OUT_DIM >::IN_TYPE_AD |
function input vector type
typedef Eigen::Matrix<AD_SCALAR, OUT_DIM, 1> ct::core::DerivativesCppad< IN_DIM, OUT_DIM >::OUT_TYPE_AD |
function output vector type
typedef Eigen::Matrix<double, IN_DIM, 1> ct::core::DerivativesCppad< IN_DIM, OUT_DIM >::IN_TYPE_D |
function input vector type double
typedef Eigen::Matrix<double, OUT_DIM, 1> ct::core::DerivativesCppad< IN_DIM, OUT_DIM >::OUT_TYPE_D |
function output vector type
typedef Eigen::Matrix<double, OUT_DIM, IN_DIM> ct::core::DerivativesCppad< IN_DIM, OUT_DIM >::JAC_TYPE_D |
Jacobian type.
typedef Eigen::Matrix<double, OUT_DIM, IN_DIM, Eigen::RowMajor> ct::core::DerivativesCppad< IN_DIM, OUT_DIM >::JAC_TYPE_ROW_MAJOR |
Jocobian type in row-major format.
typedef Eigen::Matrix<double, IN_DIM, IN_DIM> ct::core::DerivativesCppad< IN_DIM, OUT_DIM >::HES_TYPE_D |
typedef Eigen::Matrix<double, IN_DIM, IN_DIM, Eigen::RowMajor> ct::core::DerivativesCppad< IN_DIM, OUT_DIM >::HES_TYPE_ROW_MAJOR |
typedef std::function<OUT_TYPE_AD(const IN_TYPE_AD&)> ct::core::DerivativesCppad< IN_DIM, OUT_DIM >::FUN_TYPE_AD |
typedef Derivatives<IN_DIM, OUT_DIM> ct::core::DerivativesCppad< IN_DIM, OUT_DIM >::DerivativesBase |
|
inline |
Constructs the derivatives for autodiff without codegeneration using a FUN_TYPE_AD function.
f | The function to be autodiffed | |
[in] | inputDim | inputDim input dimension, must be specified if template parameter IN_DIM is -1 (dynamic) |
[in] | outputDim | outputDim output dimension, must be specified if template parameter IN_DIM is -1 (dynamic) |
References ct::core::DerivativesCppad< IN_DIM, OUT_DIM >::update().
|
inline |
copy constructor
|
inlinevirtual |
destructor
|
inline |
update the Jacobian with a new function
f | new function to compute Jacobian of |
inputDim | input dimension, must be specified if template parameter IN_DIM is -1 (dynamic) |
outputDim | output dimension, must be specified if template parameter IN_DIM is -1 (dynamic) |
Referenced by ct::core::DerivativesCppad< IN_DIM, OUT_DIM >::DerivativesCppad().
|
inlinevirtual |
deep cloning of Jacobian
Implements ct::core::Derivatives< IN_DIM, OUT_DIM, double >.
|
inlinevirtual |
Evaluates the method itself.
[in] | x | The point of evaluation |
Reimplemented from ct::core::Derivatives< IN_DIM, OUT_DIM, double >.
|
inlinevirtual |
Evaluates the jacobian with respect to the input.
[in] | x | The point of evaluation |
Reimplemented from ct::core::Derivatives< IN_DIM, OUT_DIM, double >.
|
inlinevirtual |
Returns the evaluated jacobian in sparse format.
[in] | x | The point of evaluation |
[out] | jac | The non zero values of the jacobian |
[out] | iRow | The row indices of the non zero values |
[out] | jCol | The column indices of the non zero values |
Reimplemented from ct::core::Derivatives< IN_DIM, OUT_DIM, double >.
|
inlinevirtual |
Returns the non zero values of the jacobian.
[in] | x | The point of evaluation |
Reimplemented from ct::core::Derivatives< IN_DIM, OUT_DIM, double >.
|
inlinevirtual |
Evaluates the hessian (2nd order derivatives with respect to input) of the method. In case of a vector valued function, the method returns the weighted sum of the hessians with weights w.
[in] | x | The point of evaluation |
[in] | lambda | The weights of the sum |
Reimplemented from ct::core::Derivatives< IN_DIM, OUT_DIM, double >.
|
inlinevirtual |
Returns the weighted sum of hessian of the problem in sparse format.
[in] | x | The point of evaluation |
[in] | lambda | The weights of the sum of the hessian |
hes | The non zero values of the hessian | |
iRow | The row indices of the non zero values | |
jCol | The column indices of the non zero values |
Reimplemented from ct::core::Derivatives< IN_DIM, OUT_DIM, double >.
|
inlinevirtual |
Returns the non zero elements of the hessian of the problem.
[in] | x | The point of evaluation |
[in] | lambda | The weights of the sum of the hessian |
Reimplemented from ct::core::Derivatives< IN_DIM, OUT_DIM, double >.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef ADScalar ct::core::DerivativesCppad< IN_DIM, OUT_DIM >::AD_SCALAR |