|
| DictionarySubstitutionVisitor ()=default |
|
virtual | ~DictionarySubstitutionVisitor () override=default |
|
void | init (const types::symbol_vector &independent_symbols, const Expression &dependent_function, const bool use_cse=false) |
|
void | init (const SymEngine::vec_basic &independent_symbols, const SymEngine::Basic &dependent_function, const bool use_cse=false) |
|
void | init (const types::symbol_vector &independent_symbols, const types::symbol_vector &dependent_functions, const bool use_cse=false) |
|
void | init (const SymEngine::vec_basic &independent_symbols, const SymEngine::vec_basic &dependent_functions, const bool use_cse=false) |
|
void | call (ReturnType *output_values, const ReturnType *substitution_values) |
|
ReturnType | call (const std::vector< ReturnType > &substitution_values) |
|
template<class Archive > |
void | save (Archive &archive, const unsigned int version) const |
|
template<class Archive > |
void | load (Archive &archive, const unsigned int version) |
|
template<class Archive > |
void | serialize (Archive &archive, const unsigned int version) |
|
template<typename StreamType > |
void | print (StreamType &stream, const bool print_independent_symbols=false, const bool print_dependent_functions=false, const bool print_cse_reductions=false) const |
|
template<typename ReturnType, typename ExpressionType>
class Differentiation::SD::internal::DictionarySubstitutionVisitor< ReturnType, ExpressionType >
A class to perform dictionary-based substitution as if it were an optimizer of the "lambda" or "LLVM" variety.
This class is only really useful to assist in the easy switching between different optimizers and, more importantly, for integrating CSE into a dictionary substitution scheme. It is therefore only intended to be created and used by a BatchOptimizer.
Definition at line 262 of file symengine_number_visitor_internal.h.
template<typename ReturnType , typename ExpressionType >
Initialization, and registration of the independent and dependent variables.
This variation of the initialization function registers a single dependent expression. If the use_cse
is set to true
, then common subexpression elimination is also performed at the time of initialization.
- Parameters
-
independent_symbols | A vector of symbols that represent the independent variables that are arguments to the dependent_function . |
dependent_function | A single symbolic expression that represents a dependent variable. |
use_cse | A flag to indicate whether or not to use common subexpression elimination. |
- Note
- After this function is called, no further registration of dependent functions can be performed. If it is desired that multiple dependent expressions be registered, then the other variant of this function that takes in a vector of dependent expressions should be used.
template<typename ReturnType , typename ExpressionType >
Initialization, and registration of the independent and dependent variables.
This function performs the same action as the other init() function, described above, except that it works with native SymEngine data types. The independent_symbols
are represented by a vector of SymEngine::RCP<const SymEngine::Basic>
, and the dependent_function
is of type SymEngine::RCP<const SymEngine::Basic>
.
- Parameters
-
independent_symbols | A vector of symbols that represent the independent variables that are arguments to the dependent_function . |
dependent_function | A single symbolic expression that represents a dependent variable. |
use_cse | A flag to indicate whether or not to use common subexpression elimination. |
- Note
- The caveats described in the documentation of the other init() function apply here as well.
template<typename ReturnType , typename ExpressionType >
Initialization, and registration of the independent and dependent variables.
This variation of the initialization function registers a vector of dependent expressions. If the use_cse
is set to true
, then common subexpression elimination is also performed at the time of initialization.
- Parameters
-
independent_symbols | A vector of symbols that represent the independent variables that are arguments to the dependent_functions . |
dependent_functions | A vector of symbolic expressions that represent the dependent variables. |
use_cse | A flag to indicate whether or not to use common subexpression elimination. |
- Note
- After this function is called, no further registration of dependent functions can be performed.
template<typename ReturnType , typename ExpressionType >
Initialization, and registration of the independent and dependent variables.
This function performs the same action as the other init() function, described above, except that it works with native SymEngine data types. Both the independent_symbols
and dependent_functions
are represented by a vector of SymEngine::RCP<const SymEngine::Basic>
.
- Parameters
-
independent_symbols | A vector of symbols that represent the independent variables that are arguments to the dependent_functions . |
dependent_functions | A vector of symbolic expressions that represent the dependent variables. |
use_cse | A flag to indicate whether or not to use common subexpression elimination. |
- Note
- The caveats described in the documentation of the other init() function apply here as well.