CppADCodeGen
HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
|
Public Types | |
using | Super = BaseAbstractAtomicFun< Base > |
using | CGB = CppAD::cg::CG< Base > |
using | Arg = Argument< Base > |
Public Member Functions | |
template<class ADVector > | |
void | operator() (const ADVector &ax, ADVector &ay, size_t id=0) |
size_t | getId () const |
bool | isStandAlone () const |
bool | forward (size_t q, size_t p, const CppAD::vector< bool > &vx, CppAD::vector< bool > &vy, const CppAD::vector< CGB > &tx, CppAD::vector< CGB > &ty) override |
bool | reverse (size_t p, const CppAD::vector< CGB > &tx, const CppAD::vector< CGB > &ty, CppAD::vector< CGB > &px, const CppAD::vector< CGB > &py) override |
virtual CppAD::vector< std::set< size_t > > | jacobianForwardSparsitySet (size_t m, const CppAD::vector< CGB > &x) |
virtual CppAD::vector< std::set< size_t > > | jacobianReverseSparsitySet (size_t m, const CppAD::vector< CGB > &x) |
virtual CppAD::vector< std::set< size_t > > | hessianSparsitySet (size_t m, const CppAD::vector< CGB > &x) |
virtual CppAD::vector< std::set< size_t > > | hessianSparsitySet (const CppAD::vector< bool > &s, const CppAD::vector< CGB > &x) |
Static Public Member Functions | |
static size_t | createNewAtomicFunctionID () |
Protected Member Functions | |
CGAbstractAtomicFun (const std::string &name, bool standAlone=false) | |
virtual void | zeroOrderDependency (const CppAD::vector< bool > &vx, CppAD::vector< bool > &vy, const CppAD::vector< CGB > &x)=0 |
virtual bool | atomicForward (size_t q, size_t p, const CppAD::vector< Base > &tx, CppAD::vector< Base > &ty)=0 |
virtual bool | atomicReverse (size_t p, const CppAD::vector< Base > &tx, const CppAD::vector< Base > &ty, CppAD::vector< Base > &px, const CppAD::vector< Base > &py)=0 |
Static Protected Member Functions | |
static void | appendAsArguments (typename std::vector< Arg >::iterator begin, const CppAD::vector< CGB > &tx) |
static OperationNode< Base > * | makeArray (CodeHandler< Base > &handler, const CppAD::vector< CGB > &tx) |
static OperationNode< Base > * | makeArray (CodeHandler< Base > &handler, const CppAD::vector< CGB > &tx, size_t p, size_t k) |
static OperationNode< Base > * | makeZeroArray (CodeHandler< Base > &handler, size_t size) |
static OperationNode< Base > * | makeEmptySparseArray (CodeHandler< Base > &handler, size_t size) |
static OperationNode< Base > * | makeSparseArray (CodeHandler< Base > &handler, const CppAD::vector< CGB > &py, size_t p, size_t k) |
static bool | isParameters (const CppAD::vector< CGB > &tx) |
static bool | isValuesDefined (const CppAD::vector< CGB > &tx) |
Protected Attributes | |
const size_t | id_ |
bool | standAlone_ |
An atomic function for source code generation
Definition at line 28 of file abstract_atomic_fun.hpp.
|
inlineexplicitprotected |
Creates a new atomic function that is responsible for defining the dependencies to calls of a user atomic function.
name | The atomic function name. |
standAlone | Whether or not forward and reverse function calls do not require the Taylor coefficients for the dependent variables (ty) and any previous evaluation of other forward/reverse modes. |
Definition at line 57 of file abstract_atomic_fun.hpp.
|
protectedpure virtual |
Used to evaluate function values and forward mode function values and derivatives.
q | Lowest order for this forward mode calculation. |
p | Highest order for this forward mode calculation. |
vx | If size not zero, which components of x are variables |
vy | If size not zero, which components of y are variables |
tx | Taylor coefficients corresponding to x for this calculation |
ty | Taylor coefficient corresponding to y for this calculation |
Implemented in CppAD::cg::CGAtomicFunBridge< Base >, and CppAD::cg::CGAtomicFun< Base >.
Referenced by CppAD::cg::CGAbstractAtomicFun< ScalarOut >::createNewAtomicFunctionID().
|
protectedpure virtual |
Used to evaluate reverse mode function derivatives.
p | Highest order for this forward mode calculation. |
tx | Taylor coefficients corresponding to x for this calculation |
ty | Taylor coefficient corresponding to y for this calculation |
px | Partials w.r.t. the x Taylor coefficients. |
py | Partials w.r.t. the y Taylor coefficients |
Implemented in CppAD::cg::CGAtomicFunBridge< Base >, and CppAD::cg::CGAtomicFun< Base >.
Referenced by CppAD::cg::CGAbstractAtomicFun< ScalarOut >::createNewAtomicFunctionID().
|
inlinestatic |
Uses an internal counter to produce IDs for atomic functions.
Definition at line 495 of file abstract_atomic_fun.hpp.
|
inlineoverride |
Use the jacobian sparsity to determine which elements will always be zero
Definition at line 94 of file abstract_atomic_fun.hpp.
|
inline |
Provides a unique identifier for this atomic function type.
Definition at line 81 of file abstract_atomic_fun.hpp.
|
inlinevirtual |
Determine the sparsity pattern p for Hessian of w^T F
Definition at line 462 of file abstract_atomic_fun.hpp.
|
inline |
Whether or not forward and reverse function calls do not require the Taylor coefficients for the dependent variables (ty) and any previous evaluation of other forward/reverse modes.
Definition at line 90 of file abstract_atomic_fun.hpp.
|
inlineoverride |
Use the Jacobian sparsity to determine which elements will always be zero
Use the Hessian sparsity to determine which elements will always be zero
Definition at line 233 of file abstract_atomic_fun.hpp.
|
protected |
A unique identifier for this atomic function type
Definition at line 37 of file abstract_atomic_fun.hpp.
Referenced by CppAD::cg::CGAbstractAtomicFun< ScalarOut >::getId().
|
protected |
Whether or not forward and reverse function calls do not require the Taylor coefficients for the dependent variables (ty) and any previous evaluation of other forward/reverse modes.
Definition at line 43 of file abstract_atomic_fun.hpp.
Referenced by CppAD::cg::CGAbstractAtomicFun< ScalarOut >::isStandAlone().