CppADCodeGen  2.4.3
A C++ Algorithmic Differentiation Package with Source Code Generation
CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType > Class Template Reference
Inheritance diagram for CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >:
Inheritance graph
Collaboration diagram for CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >:
Collaboration graph

Public Types

using ActiveIn = CG< ScalarIn >
 
using ActiveOut = CG< ScalarOut >
 
using NodeIn = OperationNode< ScalarIn >
 
using NodeOut = OperationNode< ScalarOut >
 
using ArgIn = Argument< ScalarIn >
 
using ArgOut = Argument< ScalarOut >
 
using Base = EvaluatorBase< ScalarIn, ScalarOut, CG< ScalarOut >, FinalEvaluatorType >
 

Public Member Functions

 EvaluatorCG (CodeHandler< ScalarIn > &handler)
 
void setPrintOutPrintOperations (bool print)
 
bool isPrintOutPrintOperations () const
 

Protected Types

using Super = EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut >, FinalEvaluatorType >
 

Protected Member Functions

void analyzeOutIndeps (const ActiveOut *indep, size_t n)
 
void clear ()
 
void processActiveOut (const NodeIn &node, ActiveOut &a)
 
ActiveOut evalPrint (const NodeIn &node)
 
void evalAtomicOperation (const NodeIn &node)
 
ActiveOut evalArrayElement (const NodeIn &node)
 
ActiveOut makeArray (const NodeIn &node)
 
ActiveOut makeArray (const NodeIn &node, std::vector< ScalarOut > &values, bool &valuesDefined, bool &allParameters)
 
ActiveOut makeDenseArray (const NodeIn &node)
 
ActiveOut makeSparseArray (const NodeIn &node)
 
CG< ScalarOut > evalOperation (OperationNode< ScalarIn > &node)
 
CG< ScalarOut > evalAssign (const NodeIn &node)
 
CG< ScalarOut > evalAbs (const NodeIn &node)
 
CG< ScalarOut > evalAcos (const NodeIn &node)
 
CG< ScalarOut > evalAdd (const NodeIn &node)
 
CG< ScalarOut > evalAlias (const NodeIn &node)
 
CG< ScalarOut > evalAsin (const NodeIn &node)
 
CG< ScalarOut > evalAtan (const NodeIn &node)
 
CG< ScalarOut > evalCompareLt (const NodeIn &node)
 
CG< ScalarOut > evalCompareLe (const NodeIn &node)
 
CG< ScalarOut > evalCompareEq (const NodeIn &node)
 
CG< ScalarOut > evalCompareGe (const NodeIn &node)
 
CG< ScalarOut > evalCompareGt (const NodeIn &node)
 
CG< ScalarOut > evalCompareNe (const NodeIn &node)
 
CG< ScalarOut > evalCosh (const NodeIn &node)
 
CG< ScalarOut > evalCos (const NodeIn &node)
 
CG< ScalarOut > evalDiv (const NodeIn &node)
 
CG< ScalarOut > evalExp (const NodeIn &node)
 
CG< ScalarOut > evalIndependent (const NodeIn &node)
 
CG< ScalarOut > evalLog (const NodeIn &node)
 
CG< ScalarOut > evalMul (const NodeIn &node)
 
CG< ScalarOut > evalPow (const NodeIn &node)
 
CG< ScalarOut > evalSign (const NodeIn &node)
 
CG< ScalarOut > evalSinh (const NodeIn &node)
 
CG< ScalarOut > evalSin (const NodeIn &node)
 
CG< ScalarOut > evalSqrt (const NodeIn &node)
 
CG< ScalarOut > evalSub (const NodeIn &node)
 
CG< ScalarOut > evalTanh (const NodeIn &node)
 
CG< ScalarOut > evalTan (const NodeIn &node)
 
CG< ScalarOut > evalMinus (const NodeIn &node)
 
CG< ScalarOut > evalUnsupportedOperation (const NodeIn &node)
 
CG< ScalarOut > evalArg (const std::vector< Argument< ScalarIn > > &args, size_t pos)
 
CG< ScalarOut > evalArg (const Argument< ScalarIn > &arg, size_t pos)
 

Static Protected Member Functions

static void processArray (const std::vector< ActiveOut > &array, std::vector< ScalarOut > &values, bool &valuesDefined, bool &allParameters)
 
static bool isParameters (const CppAD::vector< ActiveOut > &tx)
 
static bool isValuesDefined (const std::vector< ArgOut > &tx)
 

Protected Attributes

CodeHandler< ScalarOut > * outHandler_
 
std::map< const NodeIn *, std::vector< ScalarOut * > > atomicEvalResults_
 
bool printOutPriOperations_
 

Detailed Description

template<class ScalarIn, class ScalarOut, class FinalEvaluatorType>
class CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >

Specialization of class Evaluator for an output active type of CG<Base>. This class should not be instantiated directly.

Definition at line 27 of file evaluator_cg.hpp.

Member Function Documentation

◆ analyzeOutIndeps()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
void CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::analyzeOutIndeps ( const ActiveOut indep,
size_t  n 
)
inlineprotected
Note
overrides the default analyzeOutIndeps() even though this method is not virtual (hides a method in EvaluatorBase)

Definition at line 88 of file evaluator_cg.hpp.

◆ clear()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
void CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::clear ( )
inlineprotected
Note
overrides the default clear() even though this method is not virtual (hides a method in EvaluatorBase)

Definition at line 98 of file evaluator_cg.hpp.

◆ evalArrayElement()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
ActiveOut CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::evalArrayElement ( const NodeIn node)
inlineprotected
Note
overrides the default evalArrayElement() even though this method is not virtual (hides a method in EvaluatorOperations)

Definition at line 229 of file evaluator_cg.hpp.

◆ evalAtomicOperation()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
void CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::evalAtomicOperation ( const NodeIn node)
inlineprotected
Note
overrides the default evalAtomicOperation() even though this method is not virtual (hides a method in EvaluatorOperations)

Definition at line 152 of file evaluator_cg.hpp.

◆ evalOperation()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalOperation ( OperationNode< ScalarIn > &  node)
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.

Parameters
nodethe original node
Returns
the clone of the original node

Definition at line 374 of file evaluator.hpp.

◆ evalPrint()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
ActiveOut CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::evalPrint ( const NodeIn node)
inlineprotected
Note
overrides the default evalPrint() even though this method is not virtual (hides a method in EvaluatorOperations)

Definition at line 127 of file evaluator_cg.hpp.

◆ isPrintOutPrintOperations()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
bool CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::isPrintOutPrintOperations ( ) const
inline

Whether or not the nodes with an operation type 'Pri' are printed out during the evaluation.

Definition at line 78 of file evaluator_cg.hpp.

◆ processActiveOut()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
void CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::processActiveOut ( const NodeIn node,
ActiveOut a 
)
inlineprotected
Note
overrides the default processActiveOut() even though this method is not virtual (hides a method in EvaluatorOperations)

Definition at line 114 of file evaluator_cg.hpp.

◆ setPrintOutPrintOperations()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
void CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::setPrintOutPrintOperations ( bool  print)
inline

Defines whether or not to print out the nodes with an operation type 'Pri' during the evaluation.

Definition at line 70 of file evaluator_cg.hpp.

Member Data Documentation

◆ atomicEvalResults_

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
std::map<const NodeIn*, std::vector<ScalarOut*> > CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::atomicEvalResults_
protected

Cache for the evaluation of atomic operations

Definition at line 51 of file evaluator_cg.hpp.

Referenced by CppAD::cg::EvaluatorCG< Scalar, Scalar, EvaluatorCloneSolve< Scalar > >::clear().

◆ outHandler_

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
CodeHandler<ScalarOut>* CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::outHandler_
protected

◆ printOutPriOperations_

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
bool CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::printOutPriOperations_
protected

The documentation for this class was generated from the following file: