CppADCodeGen
HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
|
Public Types | |
using | ActiveOut = CppAD::AD< ScalarOut > |
using | NodeIn = OperationNode< ScalarIn > |
using | ArgIn = Argument< ScalarIn > |
using | Super = EvaluatorOperations< ScalarIn, ScalarOut, CppAD::AD< ScalarOut >, FinalEvaluatorType > |
using | Base = EvaluatorBase< ScalarIn, ScalarOut, CppAD::AD< ScalarOut >, FinalEvaluatorType > |
Public Member Functions | |
EvaluatorAD (CodeHandler< ScalarIn > &handler) | |
void | setPrintOutPrintOperations (bool print) |
bool | isPrintOutPrintOperations () const |
virtual bool | addAtomicFunction (size_t id, atomic_base< ScalarOut > &atomic) |
virtual void | addAtomicFunctions (const std::map< size_t, atomic_base< ScalarOut > * > &atomics) |
size_t | getNumberOfEvaluatedAtomics () const |
bool | isUnderEvaluation () |
std::vector< CppAD::AD< ScalarOut > > | evaluate (ArrayView< const CppAD::AD< ScalarOut > > indepNew, ArrayView< const CG< ScalarIn > > depOld) |
void | evaluate (ArrayView< const CppAD::AD< ScalarOut > > indepNew, ArrayView< CppAD::AD< ScalarOut > > depNew, ArrayView< const CG< ScalarIn > > depOld) |
void | evaluate (const CppAD::AD< ScalarOut > *indepNew, size_t indepSize, CppAD::AD< ScalarOut > *depNew, const CG< ScalarIn > *depOld, size_t depSize) |
Protected Types | |
using | SourceCodePath = typename CodeHandler< ScalarIn >::SourceCodePath |
Protected Member Functions | |
void | prepareNewEvaluation () |
void | evalAtomicOperation (NodeIn &node) |
ActiveOut | evalPrint (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalOperation (OperationNode< ScalarIn > &node) |
CppAD::AD< ScalarOut > | evalAssign (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalAbs (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalAcos (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalAdd (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalAlias (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalArrayElement (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalAsin (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalAtan (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalCompareLt (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalCompareLe (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalCompareEq (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalCompareGe (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalCompareGt (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalCompareNe (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalCosh (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalCos (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalDiv (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalExp (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalIndependent (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalLog (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalMul (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalPow (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalSign (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalSinh (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalSin (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalSqrt (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalSub (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalTanh (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalTan (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalMinus (const NodeIn &node) |
CppAD::AD< ScalarOut > | evalUnsupportedOperation (const NodeIn &node) |
void | evalAtomicOperation (const NodeIn &node) |
void | processActiveOut (const NodeIn &node, CppAD::AD< ScalarOut > &a) |
void | clear () |
void | analyzeOutIndeps (const CppAD::AD< ScalarOut > *indep, size_t n) |
CppAD::AD< ScalarOut > | evalCG (const CG< ScalarIn > &dep) |
CppAD::AD< ScalarOut > | evalArg (const std::vector< Argument< ScalarIn > > &args, size_t pos) |
CppAD::AD< ScalarOut > | evalArg (const Argument< ScalarIn > &arg, size_t pos) |
const CppAD::AD< ScalarOut > & | evalOperations (OperationNode< ScalarIn > &node) |
CppAD::AD< ScalarOut > * | saveEvaluation (const OperationNode< ScalarIn > &node, CppAD::AD< ScalarOut > &&result) |
std::vector< CppAD::AD< ScalarOut > > & | evalArrayCreationOperation (const OperationNode< ScalarIn > &node) |
std::vector< CppAD::AD< ScalarOut > > & | evalSparseArrayCreationOperation (const OperationNode< ScalarIn > &node) |
Protected Attributes | |
std::set< NodeIn * > | evalsAtomic_ |
std::map< size_t, CppAD::atomic_base< ScalarOut > *> | atomicFunctions_ |
bool | printOutPriOperations_ |
CodeHandler< ScalarIn > & | handler_ |
const CppAD::AD< ScalarOut > * | indep_ |
CodeHandlerVector< ScalarIn, std::unique_ptr< CppAD::AD< ScalarOut > > > | evals_ |
std::map< size_t, std::vector< CppAD::AD< ScalarOut > > * > | evalsArrays_ |
std::map< size_t, std::vector< CppAD::AD< ScalarOut > > * > | evalsSparseArrays_ |
bool | underEval_ |
size_t | depth_ |
SourceCodePath | path_ |
Specialization of class Evaluator for an output active type of AD<> This class should not be instantiated directly.
Definition at line 27 of file evaluator_ad.hpp.
|
inlinevirtual |
Provides an atomic function.
id | The atomic function ID |
atomic | The atomic function |
Definition at line 83 of file evaluator_ad.hpp.
|
inlineprotectedinherited |
clean-up
Definition at line 197 of file evaluator.hpp.
|
inlineprotected |
CGException | on an internal evaluation error |
Definition at line 131 of file evaluator_ad.hpp.
|
inlineprotectedinherited |
Clones a node with the new type. Override this method to add a custom node generation behaviour which does not follow the original operation graph.
node | the original node |
Definition at line 374 of file evaluator.hpp.
|
inlineprotected |
Definition at line 181 of file evaluator_ad.hpp.
|
inlineinherited |
Performs all the operations required to calculate the dependent variables with a (potentially) new data type
indepNew | The new independent variables. |
depOld | Dependent variable vector representing the operations that are going to be executed to determine the new variables (all variables must belong to the same code handler) |
CGException | on error (such as an unhandled operation type) |
Definition at line 93 of file evaluator.hpp.
|
inlineinherited |
Performs all the operations required to calculate the dependent variables with a (potentially) new data type
indepNew | The new independent variables. |
depNew | The new dependent variable vector to be computed. |
depOld | Dependent variable vector representing the operations that are going to be executed to determine the new variables (all variables must belong to the same code handler) |
CGException | on error (such as an different sizes of depNew and depOld or an unhandled operation type) |
Definition at line 114 of file evaluator.hpp.
|
inlineinherited |
Performs all the operations required to calculate the dependent variables with a (potentially) new data type
indepNew | The new independent variables. |
indepSize | The size of the array of independent variables. |
depNew | The new dependent variable vector that will be created. |
depOld | Dependent variable vector representing the operations that are going to be executed to determine the new variables (all variables must belong to the same code handler) |
depSize | The size of the array of dependent variables. |
CGException | on error (such as an unhandled operation type) |
Definition at line 137 of file evaluator.hpp.
|
inline |
Provides the number of atomic function evaluations. The same function can be considered more than once.
Definition at line 104 of file evaluator_ad.hpp.
|
inline |
Whether or not the nodes with an operation type 'Pri' are printed out during the evaluation.
Definition at line 71 of file evaluator_ad.hpp.
|
inlineinherited |
Definition at line 78 of file evaluator.hpp.
|
inlineprotected |
Do not place this in clear() so that it is possible to determine the number of atomic function evaluations after the evaluation has ended.
Definition at line 114 of file evaluator_ad.hpp.
|
inline |
Defines whether or not to print out the nodes with an operation type 'Pri' during the evaluation.
Definition at line 63 of file evaluator_ad.hpp.
|
protected |
Whether or not the nodes with an operation type 'Pri' are printed out during the evaluation.
Definition at line 49 of file evaluator_ad.hpp.
Referenced by CppAD::cg::EvaluatorAD< ScalarIn, ScalarOut, Evaluator< ScalarIn, ScalarOut, CppAD::AD< ScalarOut > > >::isPrintOutPrintOperations().