CppADCodeGen
HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
|
Public Member Functions | |
LangCDefaultHessianVarNameGenerator (VariableNameGenerator< Base > *nameGen, size_t n) | |
LangCDefaultHessianVarNameGenerator (VariableNameGenerator< Base > *nameGen, std::string multName, size_t n) | |
const std::vector< FuncArgument > & | getDependent () const override |
const std::vector< FuncArgument > & | getTemporary () const override |
size_t | getMinTemporaryVariableID () const override |
size_t | getMaxTemporaryVariableID () const override |
size_t | getMaxTemporaryArrayVariableID () const override |
size_t | getMaxTemporarySparseArrayVariableID () const override |
std::string | generateDependent (size_t index) override |
std::string | generateIndependent (const OperationNode< Base > &independent, size_t id) override |
std::string | generateTemporary (const OperationNode< Base > &variable, size_t id) override |
std::string | generateTemporaryArray (const OperationNode< Base > &variable, size_t id) override |
std::string | generateTemporarySparseArray (const OperationNode< Base > &variable, size_t id) override |
std::string | generateIndexedDependent (const OperationNode< Base > &var, size_t id, const IndexPattern &ip) override |
std::string | generateIndexedIndependent (const OperationNode< Base > &indexedIndep, size_t id, const IndexPattern &ip) override |
const std::string & | getIndependentArrayName (const OperationNode< Base > &indep, size_t id) override |
size_t | getIndependentArrayIndex (const OperationNode< Base > &indep, size_t id) override |
bool | isConsecutiveInIndepArray (const OperationNode< Base > &indepFirst, size_t id1, const OperationNode< Base > &indepSecond, size_t id2) override |
bool | isInSameIndependentArray (const OperationNode< Base > &indep1, size_t id1, const OperationNode< Base > &indep2, size_t id2) override |
void | setTemporaryVariableID (size_t minTempID, size_t maxTempID, size_t maxTempArrayID, size_t maxTempSparseArrayID) override |
const std::string & | getTemporaryVarArrayName (const OperationNode< Base > &var, size_t id) override |
size_t | getTemporaryVarArrayIndex (const OperationNode< Base > &var, size_t id) override |
bool | isConsecutiveInTemporaryVarArray (const OperationNode< Base > &varFirst, size_t idFirst, const OperationNode< Base > &varSecond, size_t idSecond) override |
bool | isInSameTemporaryVarArray (const OperationNode< Base > &var1, size_t id1, const OperationNode< Base > &var2, size_t id2) override |
virtual const std::vector< FuncArgument > & | getIndependent () const |
virtual void | customFunctionVariableDeclarations (std::ostream &out) |
virtual void | prepareCustomFunctionVariables (std::ostream &out) |
virtual void | finalizeCustomFunctionVariables (std::ostream &out) |
Protected Attributes | |
VariableNameGenerator< Base > * | _nameGen |
const size_t | _minMultiplierID |
const std::string | _multName |
std::stringstream | _ss |
std::vector< FuncArgument > | _dependent |
std::vector< FuncArgument > | _independent |
std::vector< FuncArgument > | _temporary |
Creates variables names for the source code generated for Hessian calculations. The independent variables are considered to have been registered first as variable in the code generation handler and then the multipliers.
Definition at line 31 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
Creates a name for a dependent variable.
index | the dependent variable index |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 92 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
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) |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 96 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
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 |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 123 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
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 |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 129 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
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) |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 108 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
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) |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 113 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
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) |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 118 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
Provides the dependent variable arguments used by a function.
Reimplemented from CppAD::cg::VariableNameGenerator< Base >.
Definition at line 68 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlinevirtualinherited |
Provides the independent variable arguments used by a function.
Definition at line 65 of file variable_name_generator.hpp.
Referenced by CppAD::cg::LangCDefaultHessianVarNameGenerator< Base >::isInSameTemporaryVarArray(), and CppAD::cg::LangCDefaultReverse2VarNameGenerator< Base >::setTemporaryVariableID().
|
inlineoverridevirtual |
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) |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 164 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
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) |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 156 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
Provides the maximum variable ID of temporary dense array variables.
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 84 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
Provides the maximum variable ID of temporary sparse array variables.
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 88 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
Provides the maximum used variable ID of temporary variables.
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 80 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
Provides the minimum variable ID of temporary variables.
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 76 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
Provides the temporary variable arguments used by a function.
Reimplemented from CppAD::cg::VariableNameGenerator< Base >.
Definition at line 72 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
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) |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 218 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
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) |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 213 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
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) |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 172 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
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) |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 223 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
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) |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 185 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
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) |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 230 of file lang_c_default_hessian_var_name_gen.hpp.
|
inlineoverridevirtual |
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 |
Implements CppAD::cg::VariableNameGenerator< Base >.
Definition at line 206 of file lang_c_default_hessian_var_name_gen.hpp.