CppADCodeGen
HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
|
Public Member Functions | |
GenericModel (GenericModel &&other) noexcept | |
virtual const std::string & | getName () const =0 |
virtual bool | isJacobianSparsityAvailable ()=0 |
virtual std::vector< std::set< size_t > > | JacobianSparsitySet ()=0 |
virtual std::vector< bool > | JacobianSparsityBool ()=0 |
virtual void | JacobianSparsity (std::vector< size_t > &equations, std::vector< size_t > &variables)=0 |
virtual bool | isHessianSparsityAvailable ()=0 |
virtual std::vector< std::set< size_t > > | HessianSparsitySet ()=0 |
virtual std::vector< bool > | HessianSparsityBool ()=0 |
virtual void | HessianSparsity (std::vector< size_t > &rows, std::vector< size_t > &cols)=0 |
virtual bool | isEquationHessianSparsityAvailable ()=0 |
virtual std::vector< std::set< size_t > > | HessianSparsitySet (size_t i)=0 |
virtual std::vector< bool > | HessianSparsityBool (size_t i)=0 |
virtual void | HessianSparsity (size_t i, std::vector< size_t > &rows, std::vector< size_t > &cols)=0 |
virtual size_t | Domain () const =0 |
virtual size_t | Range () const =0 |
virtual const std::vector< std::string > & | getAtomicFunctionNames ()=0 |
virtual bool | addAtomicFunction (atomic_base< Base > &atomic)=0 |
virtual bool | addExternalModel (GenericModel< Base > &atomic)=0 |
void | setAtomicEvalForwardOne4CppAD (bool evalForwardOne4CppAD) |
bool | isAtomicEvalForwardOne4CppAD () const |
virtual bool | isForwardZeroAvailable ()=0 |
template<typename VectorBase > | |
VectorBase | ForwardZero (const VectorBase &x) |
virtual void | ForwardZero (const CppAD::vector< bool > &vx, CppAD::vector< bool > &vy, ArrayView< const Base > tx, ArrayView< Base > ty)=0 |
template<typename VectorBase > | |
void | ForwardZero (const VectorBase &x, VectorBase &dep) |
virtual void | ForwardZero (ArrayView< const Base > x, ArrayView< Base > dep)=0 |
virtual void | ForwardZero (const std::vector< const Base *> &x, ArrayView< Base > dep)=0 |
virtual bool | isJacobianAvailable ()=0 |
template<typename VectorBase > | |
VectorBase | Jacobian (const VectorBase &x) |
template<typename VectorBase > | |
void | Jacobian (const VectorBase &x, VectorBase &jac) |
virtual void | Jacobian (ArrayView< const Base > x, ArrayView< Base > jac)=0 |
virtual bool | isHessianAvailable ()=0 |
template<typename VectorBase > | |
VectorBase | Hessian (const VectorBase &x, const VectorBase &w) |
template<typename VectorBase > | |
void | Hessian (const VectorBase &x, const VectorBase &w, VectorBase &hess) |
template<typename VectorBase > | |
VectorBase | Hessian (const VectorBase &x, size_t i) |
virtual void | Hessian (ArrayView< const Base > x, ArrayView< const Base > w, ArrayView< Base > hess)=0 |
virtual bool | isForwardOneAvailable ()=0 |
template<typename VectorBase > | |
VectorBase | ForwardOne (const VectorBase &tx) |
virtual void | ForwardOne (ArrayView< const Base > tx, ArrayView< Base > ty)=0 |
virtual bool | isSparseForwardOneAvailable ()=0 |
virtual void | ForwardOne (ArrayView< const Base > x, size_t tx1Nnz, const size_t idx[], const Base tx1[], ArrayView< Base > ty1)=0 |
virtual bool | isReverseOneAvailable ()=0 |
template<typename VectorBase > | |
VectorBase | ReverseOne (const VectorBase &tx, const VectorBase &ty, const VectorBase &py) |
template<typename VectorBase > | |
void | ReverseOne (const VectorBase &tx, const VectorBase &ty, VectorBase &px, const VectorBase &py) |
virtual bool | isSparseReverseOneAvailable ()=0 |
virtual void | ReverseOne (ArrayView< const Base > tx, ArrayView< const Base > ty, ArrayView< Base > px, ArrayView< const Base > py)=0 |
virtual void | ReverseOne (ArrayView< const Base > x, ArrayView< Base > px, size_t pyNnz, const size_t idx[], const Base py[])=0 |
virtual bool | isReverseTwoAvailable ()=0 |
template<typename VectorBase > | |
VectorBase | ReverseTwo (const VectorBase &tx, const VectorBase &ty, const VectorBase &py) |
template<typename VectorBase > | |
void | ReverseTwo (const VectorBase &tx, const VectorBase &ty, VectorBase &px, const VectorBase &py) |
virtual bool | isSparseReverseTwoAvailable ()=0 |
virtual void | ReverseTwo (ArrayView< const Base > tx, ArrayView< const Base > ty, ArrayView< Base > px, ArrayView< const Base > py)=0 |
virtual void | ReverseTwo (ArrayView< const Base > x, size_t tx1Nnz, const size_t idx[], const Base tx1[], ArrayView< Base > px2, ArrayView< const Base > py2)=0 |
virtual bool | isSparseJacobianAvailable ()=0 |
template<typename VectorBase > | |
VectorBase | SparseJacobian (const VectorBase &x) |
template<typename VectorBase > | |
void | SparseJacobian (const VectorBase &x, VectorBase &jac) |
virtual void | SparseJacobian (ArrayView< const Base > x, ArrayView< Base > jac)=0 |
virtual void | SparseJacobian (const std::vector< Base > &x, std::vector< Base > &jac, std::vector< size_t > &row, std::vector< size_t > &col)=0 |
virtual void | SparseJacobian (ArrayView< const Base > x, ArrayView< Base > jac, size_t const **row, size_t const **col)=0 |
virtual void | SparseJacobian (const std::vector< const Base *> &x, ArrayView< Base > jac, size_t const **row, size_t const **col)=0 |
virtual bool | isSparseHessianAvailable ()=0 |
template<typename VectorBase > | |
VectorBase | SparseHessian (const VectorBase &x, const VectorBase &w) |
template<typename VectorBase > | |
void | SparseHessian (const VectorBase &x, const VectorBase &w, VectorBase &hess) |
virtual void | SparseHessian (ArrayView< const Base > x, ArrayView< const Base > w, ArrayView< Base > hess)=0 |
virtual void | SparseHessian (const std::vector< Base > &x, const std::vector< Base > &w, std::vector< Base > &hess, std::vector< size_t > &row, std::vector< size_t > &col)=0 |
virtual void | SparseHessian (ArrayView< const Base > x, ArrayView< const Base > w, ArrayView< Base > hess, size_t const **row, size_t const **col)=0 |
virtual void | SparseHessian (const std::vector< const Base *> &x, ArrayView< const Base > w, ArrayView< Base > hess, size_t const **row, size_t const **col)=0 |
virtual CGAtomicGenericModel< Base > & | asAtomic () |
Protected Attributes | |
CGAtomicGenericModel< Base > * | _atomic |
bool | _evalAtomicForwardOne4CppAD |
Abstract class used to execute a generated model
Definition at line 141 of file declare_cg.hpp.
|
pure virtual |
Defines a CppAD atomic function to be used as an external function by the compiled code. It should match an external function name previously provided to create the source.
atomic | The atomic function. This object must only be deleted after the model. |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Defines a generic model to be used as an external function by the compiled code. It should match an external function name previously provided to create the source. This form should be preferred over ::addAtomicFunction whenever possible.
atomic | The generic model. This object must only be deleted after the model. |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
inlinevirtual |
Provides a wrapper for this compiled model allowing it to be used as an atomic function. The model must not be deleted while the atomic function is in use.
Definition at line 889 of file generic_model.hpp.
|
pure virtual |
Provides the number of independent variables.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
Referenced by CppAD::cg::CGAtomicGenericModel< Base >::CGAtomicGenericModel(), CppAD::cg::GenericModel< Base >::Hessian(), CppAD::cg::GenericModel< Base >::Jacobian(), CppAD::cg::CGAtomicGenericModel< Base >::rev_sparse_hes(), CppAD::cg::GenericModel< Base >::ReverseOne(), CppAD::cg::GenericModel< Base >::ReverseTwo(), CppAD::cg::GenericModel< Base >::SparseHessian(), and CppAD::cg::GenericModel< Base >::SparseJacobian().
|
inline |
Computes results during a forward mode sweep. Computes the first-order Taylor coefficients for dependent variables relative to a single independent variable. This method can be used during the evaluation of the jacobian when the model is used through a user defined external/atomic AD function.
tx | The Taylor coefficients of the independent variables |
Definition at line 429 of file generic_model.hpp.
Referenced by CppAD::cg::CGAtomicGenericModel< Base >::CGAtomicGenericModel(), and CppAD::cg::GenericModelExternalFunctionWrapper< Base >::forward().
|
pure virtual |
Computes results during a forward mode sweep. Computes the first-order Taylor coefficients for dependent variables relative to a single independent variable. This method can be used during the evaluation of the jacobian when the model is used through a user defined external/atomic AD function.
tx | The Taylor coefficients of the independent variables |
ty | The Taylor coefficients of the dependent variables |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Computes results during a first-order forward mode sweep, the first-order Taylor coefficients for dependent variables relative to a single independent variable. This method can be used during the evaluation of the jacobian when the model is used through a user defined external/atomic AD function. This method version avoids some data copies and can be more efficient.
x | independent variable vector |
tx1Nnz | the number of non-zeros of the directional derivatives of the independent variables (seed directions) |
idx | the locations of the non-zero values the partial derivatives of the dependent variables (seeds) |
tx1 | the non-zero values of the partial derivatives of the dependent variables (seeds) |
ty1 |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
inline |
Evaluates the dependent model variables (zero-order). This method considers that the generic model was prepared with a single array for the independent variables (the default behavior).
x | The independent variable vector |
Definition at line 212 of file generic_model.hpp.
Referenced by CppAD::cg::CGAtomicGenericModel< Base >::CGAtomicGenericModel(), CppAD::cg::GenericModelExternalFunctionWrapper< Base >::forward(), and CppAD::cg::GenericModel< Base >::ForwardZero().
|
pure virtual |
Evaluates the dependent model variables (zero-order). This method considers that the generic model was prepared with a single array for the independent variables (the default behavior).
vx | If it is not empty then it provides which independent variables are considered as variables (not parameters) |
vy | If vx and vy are not empty, it identifies which elements of ty are variables |
tx | The independent variable vector |
ty | The dependent variable vector |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
inline |
Evaluates the dependent model variables (zero-order). This method considers that the generic model was prepared using a single array for the independent variables (the default behavior).
x | The independent variable vector |
dep | The dependent variable vector |
Definition at line 245 of file generic_model.hpp.
|
pure virtual |
Evaluates the dependent model variables (zero-order). This method considers that the generic model was prepared using a single array for the independent variables (the default behavior).
x | The independent variable vector |
dep | The dependent variable vector |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Determines the dependent variable values using a variable number of independent variable arrays. This method can be useful if the generic model was prepared considering that the independent variables are provided by several arrays.
x | Contains the several independent variable vectors |
dep | The values of the dependent variables |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
The names of the atomic functions required by this model. All external/atomic functions must be provided before using this model to compute numerical values.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Provides the name for this model.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
Referenced by CppAD::cg::FunctorGenericModel< Base >::addExternalModel().
|
inline |
Determines the dense weighted sum of the Hessians using dense methods.
\[ hess = \frac{\rm d^2 }{{\rm d} x^2 } \sum_{i} w_i F_i (x) \]
\[ i = 0 , \ldots , m - 1 \]
x | The independent variables |
w | The equation multipliers |
Definition at line 347 of file generic_model.hpp.
Referenced by CppAD::cg::GenericModel< Base >::Hessian().
|
inline |
Determines the dense weighted sum of the Hessians using dense methods.
\[ hess = \frac{\rm d^2 }{{\rm d} x^2 } \sum_{i} w_i F_i (x) \]
\[ i = 0 , \ldots , m - 1 \]
x | The independent variables |
w | The equation multipliers |
hess | The values of the dense hessian |
Definition at line 366 of file generic_model.hpp.
|
inline |
Determines the dense Hessian for a given dependent variable using dense methods.
\[ hess = \frac{{\rm d^2} F_i }{{\rm d} x^2 } (x) \]
x | The independent variables |
i | The index of the function/dependent variable |
Definition at line 384 of file generic_model.hpp.
|
pure virtual |
Determines the dense weighted sum of the Hessians using dense methods.
\[ hess = \frac{\rm d^2 }{{\rm d} x^2 } \sum_{i} w_i F_i (x) \]
\[ i = 0 , \ldots , m - 1 \]
x | The independent variables |
w | The equation multipliers |
hess | The values of the dense hessian |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Provides the sparsity of the hessian for a dependent variable.
i | The index of the dependent variable |
rows | The sparsity pattern row indices. |
cols | The sparsity pattern column indices. |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Provides the sparsity of the hessian for a dependent variable.
i | The index of the dependent variable |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Provides the sparsity of the sum of the hessian for each dependent variable.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
Referenced by CppAD::cg::CGAtomicGenericModel< Base >::rev_sparse_hes().
|
pure virtual |
Provides the sparsity of the hessian for a dependent variable.
i | The index of the dependent variable |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Determines whether or not the sparsity pattern for the Hessian associated with a dependent variable can be requested.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Determines whether or not the first-order forward mode dense methods can be called.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
Referenced by CppAD::cg::GenericModel< Base >::Hessian().
|
pure virtual |
Determines whether or not the model evaluation (zero-order forward mode) can be requested.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
Referenced by CppAD::cg::GenericModel< Base >::setAtomicEvalForwardOne4CppAD().
|
pure virtual |
Determines whether or not the dense evaluation of the weighted sum of the Hessians can be requested.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
Referenced by CppAD::cg::GenericModel< Base >::Jacobian().
|
pure virtual |
Determines whether or not the sparsity pattern for the weighted sum of the Hessians can be requested.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Determines whether or not the dense Jacobian evaluation can be requested.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
Referenced by CppAD::cg::GenericModel< Base >::ForwardZero().
|
pure virtual |
Determines whether or not the Jacobian sparsity pattern can be requested.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Determines whether or not the first-order reverse mode dense methods can be called.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
Referenced by CppAD::cg::GenericModel< Base >::ForwardOne().
|
pure virtual |
Determines whether or not the second-order reverse mode dense methods can be called.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
Referenced by CppAD::cg::GenericModel< Base >::ReverseOne().
|
pure virtual |
Determines whether or not the first-order forward mode sparse method can be called.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
Referenced by CppAD::cg::GenericModel< Base >::ForwardOne().
|
pure virtual |
Determines whether or not the sparse evaluation of the weighted sum of the Hessians methods can be called.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
Referenced by CppAD::cg::GenericModel< Base >::SparseJacobian().
|
pure virtual |
Determines whether or not the sparse Jacobian evaluation methods can be called.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
Referenced by CppAD::cg::GenericModel< Base >::ReverseTwo().
|
pure virtual |
Determines whether or not the first-order reverse mode sparse method can be called.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
Referenced by CppAD::cg::GenericModel< Base >::ReverseOne().
|
pure virtual |
Determines whether or not the second-order reverse mode sparse methods can be called.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
Referenced by CppAD::cg::GenericModel< Base >::ReverseTwo().
|
inline |
Calculates a Jacobian using dense methods and saves it into a dense format:
\[ jac[ i n + j ] = \frac{\partial F_i( x ) }{\partial x_j } \]
\( i = 0 , \ldots , m - 1 \) and \(j = 0 , \ldots , n - 1 \).
x | independent variable vector |
Definition at line 293 of file generic_model.hpp.
Referenced by CppAD::cg::GenericModel< Base >::Jacobian().
|
inline |
Calculates a Jacobian using dense methods and saves it into a dense format:
\[ jac[ i n + j ] = \frac{\partial F_i( x ) }{\partial x_j } \]
\( i = 0 , \ldots , m - 1 \) and \(j = 0 , \ldots , n - 1 \).
x | independent variable vector |
jac | a dense Jacobian |
Definition at line 310 of file generic_model.hpp.
|
pure virtual |
Calculates a Jacobian using dense methods and saves it into a dense format:
\[ jac[ i n + j ] = \frac{\partial F_i( x ) }{\partial x_j } \]
\( i = 0 , \ldots , m - 1 \) and \(j = 0 , \ldots , n - 1 \).
x | independent variable vector |
jac | a dense Jacobian |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Provides the number of dependent variables.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
Referenced by CppAD::cg::CGAtomicGenericModel< Base >::CGAtomicGenericModel(), CppAD::cg::GenericModel< Base >::ForwardOne(), CppAD::cg::GenericModel< Base >::ForwardZero(), CppAD::cg::GenericModel< Base >::Hessian(), CppAD::cg::GenericModel< Base >::Jacobian(), CppAD::cg::CGAtomicGenericModel< Base >::rev_sparse_hes(), and CppAD::cg::GenericModel< Base >::SparseJacobian().
|
inline |
Computes results during a reverse mode sweep (adjoints or partial derivatives of independent variables) for the evaluation of the jacobian when the model is used through a user defined external/atomic AD function.
Definition at line 511 of file generic_model.hpp.
Referenced by CppAD::cg::CGAtomicGenericModel< Base >::CGAtomicGenericModel(), CppAD::cg::GenericModelExternalFunctionWrapper< Base >::reverse(), and CppAD::cg::GenericModel< Base >::ReverseOne().
|
inline |
Computes results during a reverse mode sweep (adjoints or partial derivatives of independent variables) for the evaluation of the jacobian when the model is used through a user defined external/atomic AD function.
Definition at line 528 of file generic_model.hpp.
|
pure virtual |
Computes results during a reverse mode sweep (adjoints or partial derivatives of independent variables) for the evaluation of the jacobian when the model is used through a user defined external/atomic AD function.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Computes results during a reverse mode sweep (adjoints or partial derivatives of independent variables) for the evaluation of the jacobian when the model is used through a user defined external/atomic AD function. This method version avoids some data copies and can be more efficient.
x | independent variable vector |
px | partial derivatives of the independent variables (same size as x) |
pyNnz | the number of non-zeros of the partial derivatives of the dependent variables (weight functionals) |
idx | the locations of the non-zero values the partial derivatives of the dependent variables (weight functionals) |
py | the non-zero values of the partial derivatives of the dependent variables (weight functionals) |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
inline |
Computes second-order results during a reverse mode sweep (p = 2). This method can be used during the evaluation of the hessian when the model is used through a user defined external/atomic AD function.
Definition at line 602 of file generic_model.hpp.
Referenced by CppAD::cg::CGAtomicGenericModel< Base >::CGAtomicGenericModel(), CppAD::cg::GenericModelExternalFunctionWrapper< Base >::reverse(), and CppAD::cg::GenericModel< Base >::ReverseTwo().
|
inline |
Computes second-order results during a reverse mode sweep (p = 2). This method can be used during the evaluation of the hessian when the model is used through a user defined external/atomic AD function.
Definition at line 620 of file generic_model.hpp.
|
pure virtual |
Computes second-order results during a reverse mode sweep (p = 2). This method can be used during the evaluation of the hessian when the model is used through a user defined external/atomic AD function.
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Computes second-order results during a reverse mode sweep (p = 2). This method can be used during the evaluation of the hessian when the model is used through a user defined external AD function. This method version avoids some data copies and can be more efficient.
x | independent variable vector |
tx1Nnz | the number of non-zeros of the first-order Taylor coefficients of the independents |
idx | the locations of the non-zero values of the first-order Taylor coefficients of the independents |
tx1 | the values of the non-zero first-order Taylor coefficients of the independents |
px2 | second-order partials of the independents (should have the same size of x) |
py2 | second-order partials of the dependents (should have the size of the dependent variables) |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
inline |
Defines whether or not to evaluate a forward mode of an atomic functions during a reverse sweep so that CppAD checks validate OK. If this model is not used within CppAD then it should be set to false.
evalForwardOne4CppAD | true to perform the forward mode, false to ignore it |
Definition at line 182 of file generic_model.hpp.
|
inline |
Determines the dense weighted sum of the Hessians using sparse methods.
\[ hess = \frac{\rm d^2 }{{\rm d} x^2 } \sum_{i} w_i F_i (x) \]
\[ i = 0 , \ldots , m - 1 \]
x | The independent variables |
w | The equation multipliers |
Definition at line 795 of file generic_model.hpp.
Referenced by CppAD::cg::GenericModel< Base >::SparseHessian().
|
inline |
Determines the dense weighted sum of the Hessians using sparse methods.
\[ hess = \frac{\rm d^2 }{{\rm d} x^2 } \sum_{i} w_i F_i (x) \]
\[ i = 0 , \ldots , m - 1 \]
x | The independent variables |
w | The equation multipliers |
hess | The values of the dense Hessian |
Definition at line 814 of file generic_model.hpp.
|
pure virtual |
Determines the dense weighted sum of the Hessians using sparse methods.
\[ hess = \frac{\rm d^2 }{{\rm d} x^2 } \sum_{i} w_i F_i (x) \]
\[ i = 0 , \ldots , m - 1 \]
x | The independent variables |
w | The equation multipliers |
hess | The values of the dense Hessian |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Determines the sparse weighted sum of the Hessians using a variable number of independent variable arrays.
\[ hess = \frac{\rm d^2 }{{\rm d} x^2 } \sum_{i} w_i F_i (x) \]
\[ i = 0 , \ldots , m - 1 \]
x | The independent variables |
w | The equation multipliers |
hess | The values of the sparse hessian in the order provided by row and col |
row | The row indices of the hessian values |
col | The column indices of the hessian values |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Determines the sparse weighted sum of the Hessians using a variable number of independent variable arrays.
\[ hess = \frac{\rm d^2 }{{\rm d} x^2 } \sum_{i} w_i F_i (x) \]
\[ i = 0 , \ldots , m - 1 \]
x | The independent variables |
w | The equation multipliers |
hess | The values of the sparse hessian in the order provided by row and col |
row | The row indices of the hessian values |
col | The column indices of the hessian values |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Determines the sparse weighted sum of the Hessians using a variable number of independent variable arrays.
\[ hess = \frac{\rm d^2 }{{\rm d} x^2 } \sum_{i} w_i F_i (x) \]
\[ i = 0 , \ldots , m - 1 \]
This method can be useful if the generic model was prepared considering that the independent variables are provided by several arrays.
x | Contains the several independent variable vectors |
w | The equation multipliers |
w_size | The number of equations |
hess | The values of the sparse hessian in the order provided by row and col |
row | The row indices of the hessian values |
col | The column indices of the hessian values |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
inline |
Calculates a Jacobian using sparse methods and saves it into a dense format:
\[ jac[ i n + j ] = \frac{\partial F_i( x ) }{\partial x_j } \]
\( i = 0 , \ldots , m - 1 \) and \(j = 0 , \ldots , n - 1 \).
x | independent variable vector |
Definition at line 697 of file generic_model.hpp.
Referenced by CppAD::cg::GenericModel< Base >::SparseJacobian().
|
inline |
Calculates a Jacobian using sparse methods and saves it into a dense format:
\[ jac[ i n + j ] = \frac{\partial F_i( x ) }{\partial x_j } \]
\( i = 0 , \ldots , m - 1 \) and \(j = 0 , \ldots , n - 1 \).
x | independent variable vector |
jac | a vector where the dense Jacobian will be placed |
Definition at line 714 of file generic_model.hpp.
|
pure virtual |
Calculates a Jacobian using sparse methods and saves it into a dense format:
\[ jac[ i n + j ] = \frac{\partial F_i( x ) }{\partial x_j } \]
\( i = 0 , \ldots , m - 1 \) and \(j = 0 , \ldots , n - 1 \).
x | independent variable array (must have n elements) |
jac | an array where the dense Jacobian will be placed (must be allocated with at least m * n elements) |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Calculates a Jacobian using sparse methods and saves it into a sparse format.
x | independent variable array (must have n elements) |
jac | The values of the sparse Jacobian in the order provided by row and col (must be allocated with at least the same number of non-zero elements as the Jacobian) |
row | The row indices of the Jacobian values |
col | The column indices of the Jacobian values |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Calculates a Jacobian using sparse methods and saves it into a sparse format.
x | independent variable array (must have n elements) |
jac | The values of the sparse Jacobian in the order provided by row and col (must be allocated with at least the same number of non-zero elements as the Jacobian) |
row | The row indices of the Jacobian values |
col | The column indices of the Jacobian values |
Implemented in CppAD::cg::FunctorGenericModel< Base >.
|
pure virtual |
Determines the sparse Jacobian using a variable number of independent variable arrays. This method can be useful if the generic model was prepared considering that the independent variables are provided by several arrays.
x | Contains the several independent variable vectors |
jac | The values of the sparse Jacobian in the order provided by row and col |
row | The row indices of the Jacobian values |
col | The column indices of the Jacobian values |
Implemented in CppAD::cg::FunctorGenericModel< Base >.