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

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
 

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)
 
CppAD::AD< ScalarOut > evalArg (const std::vector< Argument< ScalarIn > > &args, size_t pos)
 
CppAD::AD< ScalarOut > evalArg (const Argument< ScalarIn > &arg, size_t pos)
 

Protected Attributes

std::set< NodeIn * > evalsAtomic_
 
std::map< size_t, CppAD::atomic_base< ScalarOut > * > atomicFunctions_
 
bool printOutPriOperations_
 

Detailed Description

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

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.

Member Function Documentation

◆ addAtomicFunction()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
virtual bool CppAD::cg::EvaluatorAD< ScalarIn, ScalarOut, FinalEvaluatorType >::addAtomicFunction ( size_t  id,
atomic_base< ScalarOut > &  atomic 
)
inlinevirtual

Provides an atomic function.

Parameters
idThe atomic function ID
atomicThe atomic function
Returns
True if an atomic function with the same ID was already defined, false otherwise.

Definition at line 83 of file evaluator_ad.hpp.

◆ evalAtomicOperation()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
void CppAD::cg::EvaluatorAD< ScalarIn, ScalarOut, FinalEvaluatorType >::evalAtomicOperation ( NodeIn node)
inlineprotected
Exceptions
CGExceptionon an internal evaluation error
Note
overrides the default evalAtomicOperation() even though this method is not virtual (hides a method in EvaluatorOperations)

Definition at line 131 of file evaluator_ad.hpp.

◆ evalOperation()

CppAD::AD< ScalarOut > CppAD::cg::EvaluatorOperations< ScalarIn, ScalarOut, CppAD::AD< 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::EvaluatorAD< 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 181 of file evaluator_ad.hpp.

◆ getNumberOfEvaluatedAtomics()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
size_t CppAD::cg::EvaluatorAD< ScalarIn, ScalarOut, FinalEvaluatorType >::getNumberOfEvaluatedAtomics ( ) const
inline

Provides the number of atomic function evaluations. The same function can be considered more than once.

Returns
the number of atomic functions evaluations.

Definition at line 104 of file evaluator_ad.hpp.

◆ isPrintOutPrintOperations()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
bool CppAD::cg::EvaluatorAD< 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 71 of file evaluator_ad.hpp.

◆ prepareNewEvaluation()

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

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.

◆ setPrintOutPrintOperations()

template<class ScalarIn , class ScalarOut , class FinalEvaluatorType >
void CppAD::cg::EvaluatorAD< 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 63 of file evaluator_ad.hpp.

Member Data Documentation

◆ printOutPriOperations_

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

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