|
void | prepareNewEvaluation () |
|
void | clear () |
|
void | analyzeOutIndeps (const ActiveOut *indep, size_t n) |
|
ActiveOut | evalCG (const CG< ScalarIn > &dep) |
|
ActiveOut | evalArg (const std::vector< Argument< ScalarIn > > &args, size_t pos) |
|
ActiveOut | evalArg (const Argument< ScalarIn > &arg, size_t pos) |
|
const ActiveOut & | evalOperations (OperationNode< ScalarIn > &node) |
|
ActiveOut * | saveEvaluation (const OperationNode< ScalarIn > &node, ActiveOut &&result) |
|
std::vector< ActiveOut > & | evalArrayCreationOperation (const OperationNode< ScalarIn > &node) |
|
std::vector< ActiveOut > & | evalSparseArrayCreationOperation (const OperationNode< ScalarIn > &node) |
|
template<class ScalarIn, class ScalarOut, class ActiveOut, class FinalEvaluatorType>
class CppAD::cg::EvaluatorBase< ScalarIn, ScalarOut, ActiveOut, FinalEvaluatorType >
A base class for evaluators. Evaluators allow to reprocess operations defined in an operation graph for a different set of independent variables and (possibly) data types.
Operation implementations (sin(), cos(), ...) should be implemented in a subclass of type FinalEvaluatorType. This allows static polymorphism through curiously recurring template pattern (CRTP). Therefore the default behaviour can be overridden without the use of virtual methods.
This class should not be instantiated directly.
- Todo:
- implement nonrecursive algorithm (so that there will never be any stack limit issues)
Definition at line 27 of file evaluator.hpp.
template<class ScalarIn, class ScalarOut, class ActiveOut, class FinalEvaluatorType>
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 |
|
) |
| |
|
inline |
Performs all the operations required to calculate the dependent variables with a (potentially) new data type
- Parameters
-
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. |
- Exceptions
-
CGException | on error (such as an unhandled operation type) |
Definition at line 137 of file evaluator.hpp.