|
CppADCodeGen 2.4.3
A C++ Algorithmic Differentiation Package with Source Code Generation
|
#include <variable_name_generator.hpp>


Public Member Functions | |
| virtual const std::vector< FuncArgument > & | getDependent () const |
| virtual const std::vector< FuncArgument > & | getIndependent () const |
| virtual const std::vector< FuncArgument > & | getTemporary () const |
| virtual size_t | getMinTemporaryVariableID () const =0 |
| virtual size_t | getMaxTemporaryVariableID () const =0 |
| virtual size_t | getMaxTemporaryArrayVariableID () const =0 |
| virtual size_t | getMaxTemporarySparseArrayVariableID () const =0 |
| virtual std::string | generateDependent (size_t index)=0 |
| virtual std::string | generateIndependent (const OperationNode< Base > &variable, size_t id)=0 |
| virtual std::string | generateTemporary (const OperationNode< Base > &variable, size_t id)=0 |
| virtual std::string | generateTemporaryArray (const OperationNode< Base > &variable, size_t id)=0 |
| virtual std::string | generateTemporarySparseArray (const OperationNode< Base > &variable, size_t id)=0 |
| virtual std::string | generateIndexedDependent (const OperationNode< Base > &var, size_t id, const IndexPattern &ip)=0 |
| virtual std::string | generateIndexedIndependent (const OperationNode< Base > &var, size_t id, const IndexPattern &ip)=0 |
| virtual void | setTemporaryVariableID (size_t minTempID, size_t maxTempID, size_t maxTempArrayID, size_t maxTempSparseArrayID)=0 |
| virtual const std::string & | getIndependentArrayName (const OperationNode< Base > &indep, size_t id)=0 |
| virtual size_t | getIndependentArrayIndex (const OperationNode< Base > &indep, size_t id)=0 |
| virtual bool | isConsecutiveInIndepArray (const OperationNode< Base > &indepFirst, size_t idFirst, const OperationNode< Base > &indepSecond, size_t idSecond)=0 |
| virtual bool | isInSameIndependentArray (const OperationNode< Base > &indep1, size_t id1, const OperationNode< Base > &indep2, size_t id2)=0 |
| virtual const std::string & | getTemporaryVarArrayName (const OperationNode< Base > &var, size_t id)=0 |
| virtual size_t | getTemporaryVarArrayIndex (const OperationNode< Base > &var, size_t id)=0 |
| virtual bool | isConsecutiveInTemporaryVarArray (const OperationNode< Base > &varFirst, size_t idFirst, const OperationNode< Base > &varSecond, size_t idSecond)=0 |
| virtual bool | isInSameTemporaryVarArray (const OperationNode< Base > &var1, size_t id1, const OperationNode< Base > &var2, size_t id2)=0 |
| virtual void | customFunctionVariableDeclarations (std::ostream &out) |
| virtual void | prepareCustomFunctionVariables (std::ostream &out) |
| virtual void | finalizeCustomFunctionVariables (std::ostream &out) |
Protected Attributes | |
| std::vector< FuncArgument > | _dependent |
| std::vector< FuncArgument > | _independent |
| std::vector< FuncArgument > | _temporary |
Creates variables names for the source code.
Definition at line 44 of file variable_name_generator.hpp.
|
inlinevirtual |
Definition at line 321 of file variable_name_generator.hpp.
|
inlinevirtual |
Definition at line 312 of file variable_name_generator.hpp.
|
inlinevirtual |
Definition at line 318 of file variable_name_generator.hpp.
|
pure virtual |
Creates a name for a dependent variable.
| index | the dependent variable index |
Implemented in CppAD::cg::LangCCustomVariableNameGenerator< Base >, CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexCustomVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, CppAD::cg::LangMathMLCustomVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Creates a name for a dependent variable.
| variable | the node representing the independent variable |
| id | an ID assigned by the CodeHandler to the operation node (unique for independent variables) |
Implemented in CppAD::cg::LangCCustomVariableNameGenerator< Base >, CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexCustomVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, CppAD::cg::LangMathMLCustomVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Creates a name for a reference to an indexed dependent variable expression.
| var | the node representing an indexed dependent variable |
| id | an ID assigned by the CodeHandler to the operation node (potentially not unique) |
| ip | the index pattern |
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Creates a name for a reference to an indexed independent variable expression.
| var | the node representing an indexed independent variable |
| id | an ID assigned by the CodeHandler to the operation node (unique for indexed independent variables) |
| ip | the index pattern |
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Creates a name for a temporary variable.
| variable | the node representing the temporary variable |
| id | an ID assigned by the CodeHandler to the operation node (potentially not unique) |
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Creates a name for a temporary dense array variable.
| variable | the node representing the dense array variable creation |
| id | an ID assigned by the CodeHandler to the operation node (potentially not unique) |
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Creates a name for a temporary sparse array variable.
| variable | the node representing the sparse array variable creation |
| id | an ID assigned by the CodeHandler to the operation node (potentially not unique) |
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
inlinevirtual |
Provides the dependent variable arguments used by a function.
Reimplemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, and CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >.
Definition at line 56 of file variable_name_generator.hpp.
|
inlinevirtual |
Provides the independent variable arguments used by a function.
Definition at line 65 of file variable_name_generator.hpp.
|
pure virtual |
Provides the index in the associated independent array of an independent variable. It should only be called if independents are saved in an array.
| indep | the independent variable node (CGInvOp) |
| id | an ID assigned by the CodeHandler to the operation node (unique for independent variable arrays) |
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Provides the array name where independent variables are provided to the function. It should only be called if independents are saved in an array.
| indep | the independent variable node (CGInvOp) |
| id | an ID assigned by the CodeHandler to the operation node (unique for independent variable arrays) |
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Provides the maximum variable ID of temporary dense array variables.
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Provides the maximum variable ID of temporary sparse array variables.
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Provides the maximum used variable ID of temporary variables.
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Provides the minimum variable ID of temporary variables.
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
inlinevirtual |
Provides the temporary variable arguments used by a function.
Reimplemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, and CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >.
Definition at line 74 of file variable_name_generator.hpp.
|
pure virtual |
Provides the index in the associated temporary array of a temporary variable. It should only be called if temporary variables are saved in an array.
| var | the temporary variable node |
| id | an ID assigned by the CodeHandler to the operation node (potentially not unique) |
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Provides the array name for the temporary variables. It should only be called if temporary variables are saved in an array.
| var | the temporary variable node |
| id | an ID assigned by the CodeHandler to the operation node (potentially not unique) |
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Whether or not two independent variables are considered to be part of the same independent variable array at consecutive locations.
| indepFirst | the independent node (CGInvOp) with the lower index |
| idFirst | an ID assigned by the CodeHandler to the first node (unique for independent variables) |
| indepSecond | the independent node (CGInvOp) with the higher index |
| idSecond | an ID assigned by the CodeHandler to the second node (unique for independent variables) |
Implemented in CppAD::cg::LangCCustomVariableNameGenerator< Base >, CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexCustomVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, CppAD::cg::LangMathMLCustomVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Whether or not two temporary variables are considered to be part of the same temporary variable array at consecutive locations.
| varFirst | the temporary variable node with the lower index |
| idFirst | an ID assigned by the CodeHandler to the first node (potentially not unique) |
| varSecond | the temporary variable node with the higher index |
| varSecond | an ID assigned by the CodeHandler to the second node (potentially not unique) |
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Determines whether or not two independents are part of the same independent variable array.
| indep1 | the first independent node (CGInvOp or CGLoopIndexedIndepOp) |
| id1 | an ID assigned by the CodeHandler to indep1 (unique for independent variables) |
| indep2 | the second independent node (CGInvOp or CGLoopIndexedIndepOp) |
| id2 | an ID assigned by the CodeHandler to indep2 (unique for independent variables) |
Implemented in CppAD::cg::LangCCustomVariableNameGenerator< Base >, CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexCustomVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, CppAD::cg::LangMathMLCustomVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
pure virtual |
Determines whether or not two temporary variables are part of the same temporary variable array.
| var1 | the temporary variable node |
| id1 | an ID assigned by the CodeHandler to var1 (potentially not unique) |
| var2 | the temporary variable node |
| id2 | an ID assigned by the CodeHandler to var2 (potentially not unique) |
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
inlinevirtual |
Definition at line 315 of file variable_name_generator.hpp.
|
pure virtual |
Defines the ID ranges used by each variable type.
| minTempID | the lowest ID of temporary variables |
| maxTempID | the highest used ID of temporary variables |
| maxTempArrayID | the highest used ID of temporary dense array variables |
| maxTempSparseArrayID | the highest used ID of temporary sparse array variables |
Implemented in CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >, CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >, CppAD::cg::LangCDefaultVariableNameGenerator< Base >, CppAD::cg::LangLatexDefaultVariableNameGenerator< Base >, and CppAD::cg::LangMathMLDefaultVariableNameGenerator< Base >.
|
protected |
Definition at line 46 of file variable_name_generator.hpp.
|
protected |
Definition at line 47 of file variable_name_generator.hpp.
|
protected |
Definition at line 48 of file variable_name_generator.hpp.