CppADCodeGen 2.4.3
A C++ Algorithmic Differentiation Package with Source Code Generation
Loading...
Searching...
No Matches
CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType > Class Template Reference

#include <evaluator_cg.hpp>

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
 
bool isUnderEvaluation ()
 
std::vector< ActiveOutevaluate (ArrayView< const ActiveOut > indepNew, ArrayView< const CG< ScalarIn > > depOld)
 
void evaluate (ArrayView< const ActiveOut > indepNew, ArrayView< ActiveOut > depNew, ArrayView< const CG< ScalarIn > > depOld)
 
void evaluate (const ActiveOut *indepNew, size_t indepSize, ActiveOut *depNew, const CG< ScalarIn > *depOld, size_t depSize)
 

Protected Types

using Super = EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut >, FinalEvaluatorType >
 
using SourceCodePath = typename CodeHandler< ScalarIn >::SourceCodePath
 

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)
 
void prepareNewEvaluation ()
 
void analyzeOutIndeps (const ActiveOut *indep, size_t n)
 
ActiveOut evalCG (const CG< ScalarIn > &dep)
 
const ActiveOutevalOperations (OperationNode< ScalarIn > &node)
 
ActiveOutsaveEvaluation (const OperationNode< ScalarIn > &node, ActiveOut &&result)
 
std::vector< ActiveOut > & evalArrayCreationOperation (const OperationNode< ScalarIn > &node)
 
std::vector< ActiveOut > & evalSparseArrayCreationOperation (const OperationNode< ScalarIn > &node)
 

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_
 
CodeHandler< ScalarIn > & handler_
 
const ActiveOutindep_
 
CodeHandlerVector< ScalarIn, std::unique_ptr< ActiveOut > > evals_
 
std::map< size_t, std::vector< ActiveOut > * > evalsArrays_
 
std::map< size_t, std::vector< ActiveOut > * > evalsSparseArrays_
 
bool underEval_
 
size_t depth_
 
SourceCodePath path_
 

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 Typedef Documentation

◆ ActiveIn

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
using CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::ActiveIn = CG<ScalarIn>

Definition at line 35 of file evaluator_cg.hpp.

◆ ActiveOut

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
using CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::ActiveOut = CG<ScalarOut>

Definition at line 36 of file evaluator_cg.hpp.

◆ ArgIn

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
using CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::ArgIn = Argument<ScalarIn>

Definition at line 39 of file evaluator_cg.hpp.

◆ ArgOut

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
using CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::ArgOut = Argument<ScalarOut>

Definition at line 40 of file evaluator_cg.hpp.

◆ Base

using CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::Base = EvaluatorBase<ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType>
inherited

Definition at line 352 of file evaluator.hpp.

◆ NodeIn

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
using CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::NodeIn = OperationNode<ScalarIn>

Definition at line 37 of file evaluator_cg.hpp.

◆ NodeOut

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
using CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::NodeOut = OperationNode<ScalarOut>

Definition at line 38 of file evaluator_cg.hpp.

◆ SourceCodePath

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
using CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::SourceCodePath = typename CodeHandler<ScalarIn>::SourceCodePath
protectedinherited

Definition at line 48 of file evaluator.hpp.

◆ Super

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
using CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::Super = EvaluatorOperations<ScalarIn, ScalarOut, CG<ScalarOut>, FinalEvaluatorType>
protected

Definition at line 42 of file evaluator_cg.hpp.

Constructor & Destructor Documentation

◆ EvaluatorCG()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::EvaluatorCG ( CodeHandler< ScalarIn > &  handler)
inline

Definition at line 60 of file evaluator_cg.hpp.

Member Function Documentation

◆ analyzeOutIndeps() [1/2]

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
void CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::analyzeOutIndeps ( const ActiveOut *  indep,
size_t  n 
)
inlineprotectedinherited

Definition at line 211 of file evaluator.hpp.

◆ analyzeOutIndeps() [2/2]

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.

◆ evalAbs()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalAbs ( const NodeIn node)
inlineprotectedinherited

Definition at line 487 of file evaluator.hpp.

◆ evalAcos()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalAcos ( const NodeIn node)
inlineprotectedinherited

Definition at line 493 of file evaluator.hpp.

◆ evalAdd()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalAdd ( const NodeIn node)
inlineprotectedinherited

Definition at line 499 of file evaluator.hpp.

◆ evalAlias()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalAlias ( const NodeIn node)
inlineprotectedinherited

Definition at line 505 of file evaluator.hpp.

◆ evalArg() [1/2]

CG< ScalarOut > CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalArg ( const Argument< ScalarIn > &  arg,
size_t  pos 
)
inlineprotectedinherited

Definition at line 364 of file evaluator.hpp.

◆ evalArg() [2/2]

CG< ScalarOut > CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalArg ( const std::vector< Argument< ScalarIn > > &  args,
size_t  pos 
)
inlineprotectedinherited

Definition at line 364 of file evaluator.hpp.

◆ evalArrayCreationOperation()

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
std::vector< ActiveOut > & CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::evalArrayCreationOperation ( const OperationNode< ScalarIn > &  node)
inlineprotectedinherited

Definition at line 281 of file evaluator.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.

◆ evalAsin()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalAsin ( const NodeIn node)
inlineprotectedinherited

Definition at line 527 of file evaluator.hpp.

◆ evalAssign()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalAssign ( const NodeIn node)
inlineprotectedinherited

Definition at line 481 of file evaluator.hpp.

◆ evalAtan()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalAtan ( const NodeIn node)
inlineprotectedinherited

Definition at line 533 of file evaluator.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.

◆ evalCG()

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
ActiveOut CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::evalCG ( const CG< ScalarIn > &  dep)
inlineprotectedinherited

Definition at line 216 of file evaluator.hpp.

◆ evalCompareEq()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalCompareEq ( const NodeIn node)
inlineprotectedinherited

Definition at line 551 of file evaluator.hpp.

◆ evalCompareGe()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalCompareGe ( const NodeIn node)
inlineprotectedinherited

Definition at line 557 of file evaluator.hpp.

◆ evalCompareGt()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalCompareGt ( const NodeIn node)
inlineprotectedinherited

Definition at line 563 of file evaluator.hpp.

◆ evalCompareLe()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalCompareLe ( const NodeIn node)
inlineprotectedinherited

Definition at line 545 of file evaluator.hpp.

◆ evalCompareLt()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalCompareLt ( const NodeIn node)
inlineprotectedinherited

Definition at line 539 of file evaluator.hpp.

◆ evalCompareNe()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalCompareNe ( const NodeIn node)
inlineprotectedinherited

Definition at line 569 of file evaluator.hpp.

◆ evalCos()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalCos ( const NodeIn node)
inlineprotectedinherited

Definition at line 581 of file evaluator.hpp.

◆ evalCosh()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalCosh ( const NodeIn node)
inlineprotectedinherited

Definition at line 575 of file evaluator.hpp.

◆ evalDiv()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalDiv ( const NodeIn node)
inlineprotectedinherited

Definition at line 587 of file evaluator.hpp.

◆ evalExp()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalExp ( const NodeIn node)
inlineprotectedinherited

Definition at line 593 of file evaluator.hpp.

◆ evalIndependent()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalIndependent ( const NodeIn node)
inlineprotectedinherited

Definition at line 599 of file evaluator.hpp.

◆ evalLog()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalLog ( const NodeIn node)
inlineprotectedinherited

Definition at line 604 of file evaluator.hpp.

◆ evalMinus()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalMinus ( const NodeIn node)
inlineprotectedinherited

Definition at line 670 of file evaluator.hpp.

◆ evalMul()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalMul ( const NodeIn node)
inlineprotectedinherited

Definition at line 610 of file evaluator.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.

◆ evalOperations()

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
const ActiveOut & CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::evalOperations ( OperationNode< ScalarIn > &  node)
inlineprotectedinherited

Definition at line 242 of file evaluator.hpp.

◆ evalPow()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalPow ( const NodeIn node)
inlineprotectedinherited

Definition at line 616 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.

◆ evalSign()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalSign ( const NodeIn node)
inlineprotectedinherited

Definition at line 628 of file evaluator.hpp.

◆ evalSin()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalSin ( const NodeIn node)
inlineprotectedinherited

Definition at line 640 of file evaluator.hpp.

◆ evalSinh()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalSinh ( const NodeIn node)
inlineprotectedinherited

Definition at line 634 of file evaluator.hpp.

◆ evalSparseArrayCreationOperation()

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
std::vector< ActiveOut > & CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::evalSparseArrayCreationOperation ( const OperationNode< ScalarIn > &  node)
inlineprotectedinherited

Definition at line 306 of file evaluator.hpp.

◆ evalSqrt()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalSqrt ( const NodeIn node)
inlineprotectedinherited

Definition at line 646 of file evaluator.hpp.

◆ evalSub()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalSub ( const NodeIn node)
inlineprotectedinherited

Definition at line 652 of file evaluator.hpp.

◆ evalTan()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalTan ( const NodeIn node)
inlineprotectedinherited

Definition at line 664 of file evaluator.hpp.

◆ evalTanh()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalTanh ( const NodeIn node)
inlineprotectedinherited

Definition at line 658 of file evaluator.hpp.

◆ evaluate() [1/3]

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
void CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::evaluate ( ArrayView< const ActiveOut >  indepNew,
ArrayView< ActiveOut >  depNew,
ArrayView< const CG< ScalarIn > >  depOld 
)
inlineinherited

Performs all the operations required to calculate the dependent variables with a (potentially) new data type

Parameters
indepNewThe new independent variables.
depNewThe new dependent variable vector to be computed.
depOldDependent 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)
Exceptions
CGExceptionon error (such as an different sizes of depNew and depOld or an unhandled operation type)

Definition at line 114 of file evaluator.hpp.

◆ evaluate() [2/3]

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
std::vector< ActiveOut > CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::evaluate ( ArrayView< const ActiveOut >  indepNew,
ArrayView< const CG< ScalarIn > >  depOld 
)
inlineinherited

Performs all the operations required to calculate the dependent variables with a (potentially) new data type

Parameters
indepNewThe new independent variables.
depOldDependent 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)
Returns
The dependent variable values
Exceptions
CGExceptionon error (such as an unhandled operation type)

Definition at line 93 of file evaluator.hpp.

Referenced by CppAD::cg::CodeHandler< Base >::collectVariable(), CppAD::cg::CodeHandler< Base >::collectVariableAddSub(), CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::evaluate(), CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::evaluate(), CppAD::cg::BipartiteGraph< Base >::generateNewModel(), and CppAD::cg::DummyDerivatives< Base >::generateReorderedModel().

◆ evaluate() [3/3]

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
void CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::evaluate ( const ActiveOut *  indepNew,
size_t  indepSize,
ActiveOut *  depNew,
const CG< ScalarIn > *  depOld,
size_t  depSize 
)
inlineinherited

Performs all the operations required to calculate the dependent variables with a (potentially) new data type

Parameters
indepNewThe new independent variables.
indepSizeThe size of the array of independent variables.
depNewThe new dependent variable vector that will be created.
depOldDependent 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)
depSizeThe size of the array of dependent variables.
Exceptions
CGExceptionon error (such as an unhandled operation type)

Definition at line 137 of file evaluator.hpp.

◆ evalUnsupportedOperation()

CG< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CG< ScalarOut > , FinalEvaluatorType >::evalUnsupportedOperation ( const NodeIn node)
inlineprotectedinherited

Definition at line 676 of file evaluator.hpp.

◆ isParameters()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
static bool CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::isParameters ( const CppAD::vector< ActiveOut > &  tx)
inlinestaticprotected

Definition at line 348 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.

◆ isUnderEvaluation()

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
bool CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::isUnderEvaluation ( )
inlineinherited
Returns
true if this Evaluator is currently being used.

Definition at line 78 of file evaluator.hpp.

◆ isValuesDefined()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
static bool CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::isValuesDefined ( const std::vector< ArgOut > &  tx)
inlinestaticprotected

Definition at line 357 of file evaluator_cg.hpp.

◆ makeArray() [1/2]

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
ActiveOut CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::makeArray ( const NodeIn node)
inlineprotected

Definition at line 262 of file evaluator_cg.hpp.

◆ makeArray() [2/2]

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
ActiveOut CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::makeArray ( const NodeIn node,
std::vector< ScalarOut > &  values,
bool &  valuesDefined,
bool &  allParameters 
)
inlineprotected

Definition at line 270 of file evaluator_cg.hpp.

◆ makeDenseArray()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
ActiveOut CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::makeDenseArray ( const NodeIn node)
inlineprotected

Definition at line 290 of file evaluator_cg.hpp.

◆ makeSparseArray()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
ActiveOut CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::makeSparseArray ( const NodeIn node)
inlineprotected

Definition at line 310 of file evaluator_cg.hpp.

◆ prepareNewEvaluation()

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
void CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::prepareNewEvaluation ( )
inlineprotectedinherited

Definition at line 190 of file evaluator.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.

◆ processArray()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
static void CppAD::cg::EvaluatorCG< ScalarIn, ScalarOut, FinalEvaluatorType >::processArray ( const std::vector< ActiveOut > &  array,
std::vector< ScalarOut > &  values,
bool &  valuesDefined,
bool &  allParameters 
)
inlinestaticprotected

Definition at line 330 of file evaluator_cg.hpp.

◆ saveEvaluation()

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
ActiveOut * CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::saveEvaluation ( const OperationNode< ScalarIn > &  node,
ActiveOut &&  result 
)
inlineprotectedinherited

Definition at line 267 of file evaluator.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

◆ depth_

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
size_t CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::depth_
protectedinherited

Definition at line 56 of file evaluator.hpp.

◆ evals_

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
CodeHandlerVector<ScalarIn, std::unique_ptr<ActiveOut> > CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::evals_
protectedinherited

Definition at line 52 of file evaluator.hpp.

◆ evalsArrays_

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
std::map<size_t, std::vector<ActiveOut>* > CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::evalsArrays_
protectedinherited

Definition at line 53 of file evaluator.hpp.

◆ evalsSparseArrays_

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
std::map<size_t, std::vector<ActiveOut>* > CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::evalsSparseArrays_
protectedinherited

Definition at line 54 of file evaluator.hpp.

◆ handler_

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
CodeHandler<ScalarIn>& CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::handler_
protectedinherited

Definition at line 50 of file evaluator.hpp.

◆ indep_

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
const ActiveOut* CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::indep_
protectedinherited

Definition at line 51 of file evaluator.hpp.

◆ outHandler_

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

◆ path_

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
SourceCodePath CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::path_
protectedinherited

Definition at line 57 of file evaluator.hpp.

◆ printOutPriOperations_

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

◆ underEval_

template<class ScalarIn , class ScalarOut , class ActiveOut , class FinalEvaluatorType >
bool CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >::underEval_
protectedinherited

Definition at line 55 of file evaluator.hpp.


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