CppADCodeGen
HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
|
Public Types | |
using | Node = OperationNode< Base > |
Public Member Functions | |
LanguageDot () | |
bool | isIgnoreZeroDepAssign () const |
void | setIgnoreZeroDepAssign (bool ignore) |
void | setFilename (const std::string &name) |
virtual size_t | getParameterPrecision () const |
virtual void | setParameterPrecision (size_t p) |
void | setIndepNodeStyle (const std::string &indepNodeStyle) |
const std::string & | getIndepNodeStyle () const |
void | setDepNodeStyle (const std::string &depNodeStyle) |
const std::string & | getDepNodeStyle () const |
void | setCombineParameterNodes (bool combineParameterNodes) |
bool | isCombineParameterNodes () const |
void | printStaticIndexArray (std::ostringstream &os, const std::string &name, const std::vector< size_t > &values) |
void | printStaticIndexMatrix (std::ostringstream &os, const std::string &name, const std::map< size_t, std::map< size_t, size_t > > &values) |
void | printRandomIndexPatternDeclaration (std::ostringstream &os, const std::set< RandomIndexPattern *> &randomPatterns) |
Static Public Member Functions | |
static void | printIndexCondExpr (std::ostringstream &out, const std::vector< size_t > &info, const std::string &index) |
static void | generateNames4RandomIndexPatterns (const std::set< RandomIndexPattern *> &randomPatterns) |
static void | indexPattern2String (std::ostream &os, const IndexPattern &ip, const OperationNode< Base > &index) |
static void | indexPattern2String (std::ostream &os, const IndexPattern &ip, const std::vector< const OperationNode< Base > *> &indexes) |
static void | linearIndexPattern2String (std::ostream &os, const LinearIndexPattern &lip, const OperationNode< Base > &index) |
Protected Member Functions | |
void | generateSourceCode (std::ostream &out, std::unique_ptr< LanguageGenerationData< Base > > info) override |
size_t | getVariableID (const OperationNode< Base > &node) const |
bool | createsNewVariable (const OperationNode< Base > &var, size_t totalUseCount, size_t opCount) const override |
virtual bool | requiresVariableName (const OperationNode< Base > &var) const |
virtual bool | directlyAssignsVariable (const OperationNode< Base > &var) const |
bool | requiresVariableArgument (enum CGOpCode op, size_t argIndex) const override |
const std::string & | createVariableName (OperationNode< Base > &var) |
bool | requiresVariableDependencies () const override |
virtual std::string | print (const Argument< Base > &arg) |
virtual std::string | printExpression (OperationNode< Base > &node) |
virtual std::string | printParameter (const Base &value) |
virtual std::string | makeNodeName (const OperationNode< Base > &node) |
std::string | makeNodeName (const Argument< Base > &arg) |
virtual std::string | makeNodeName (const Base &value) |
std::string | printNodeDeclaration (const OperationNode< Base > &op, const std::ostringstream &label, const std::string &shape="") |
virtual std::string | printNodeDeclaration (const OperationNode< Base > &op, const std::string &label="", const std::string &shape="") |
void | printEdges (const std::string &name, const OperationNode< Base > &node, const std::string &style="") |
void | printEdges (const std::string &name, const OperationNode< Base > &node, const std::vector< std::string > &args, const std::string &style="") |
void | printEdges (const std::string &name, const OperationNode< Base > &node, const std::vector< std::string > &args, const std::vector< std::string > &styles) |
void | printEdge (const OperationNode< Base > &from, const std::string &to, const std::string &style="") |
void | printEdge (const std::string &from, const std::string &to, const std::string &style="") |
virtual std::string | printExpressionNoVarCheck (OperationNode< Base > &node) |
virtual std::string | printAssignOp (OperationNode< Base > &node) |
virtual std::string | printPowFunction (OperationNode< Base > &op) |
virtual std::string | printUnaryFunction (OperationNode< Base > &op) |
virtual std::string | printOperationAlias (OperationNode< Base > &op) |
virtual std::string | printOperationAdd (OperationNode< Base > &op) |
virtual std::string | printOperationMinus (OperationNode< Base > &op) |
virtual std::string | printOperationDiv (OperationNode< Base > &op) |
virtual std::string | printOperationMul (OperationNode< Base > &op) |
virtual std::string | printOperationUnaryMinus (OperationNode< Base > &op) |
virtual std::string | printConditionalAssignment (OperationNode< Base > &node) |
virtual std::string | printArrayCreationOp (OperationNode< Base > &op) |
virtual std::string | printSparseArrayCreationOp (OperationNode< Base > &op) |
size_t | printArrayCreationUsingLoop (const std::string &arrayName, const OperationNode< Base > &array, size_t startj, const size_t *indexes) |
virtual std::string | printArrayElementOp (OperationNode< Base > &op) |
virtual std::string | printAtomicForwardOp (OperationNode< Base > &atomicFor) |
virtual std::string | printAtomicReverseOp (OperationNode< Base > &atomicRev) |
virtual std::string | printDependentMultiAssign (OperationNode< Base > &node) |
virtual std::string | printLoopStart (OperationNode< Base > &node) |
virtual std::string | printLoopEnd (OperationNode< Base > &node) |
virtual std::string | printLoopIndexedDep (OperationNode< Base > &node) |
virtual std::string | printLoopIndexedIndep (OperationNode< Base > &node) |
virtual std::string | printLoopIndexedTmp (OperationNode< Base > &node) |
virtual std::string | printTmpVar (OperationNode< Base > &node) |
virtual std::string | printIndexAssign (OperationNode< Base > &node) |
virtual std::string | printIndexCondExprOp (OperationNode< Base > &node) |
virtual std::string | printStartIf (OperationNode< Base > &node) |
virtual std::string | printElseIf (OperationNode< Base > &node) |
virtual std::string | printElse (OperationNode< Base > &node) |
virtual std::string | printEndIf (OperationNode< Base > &node) |
virtual std::string | printCondResult (OperationNode< Base > &node) |
bool | isDependent (const OperationNode< Base > &arg) const |
virtual void | getComparison (std::ostream &os, enum CGOpCode op) const |
Static Protected Member Functions | |
static bool | isFunction (enum CGOpCode op) |
static bool | isUnaryFunction (enum CGOpCode op) |
static bool | isCondAssign (enum CGOpCode op) |
Protected Attributes | |
LanguageGenerationData< Base > * | _info |
std::string | _endline |
std::ostringstream | _code |
VariableNameGenerator< Base > * | _nameGen |
std::ostringstream | _ss |
size_t | _independentSize |
size_t | _minTemporaryVarID |
std::map< size_t, size_t > | _dependentIDs |
const ArrayView< CG< Base > > * | _dependent |
bool | _ignoreZeroDepAssign |
std::string | _filename |
std::vector< const LoopStartOperationNode< Base > * > | _currentLoops |
size_t | _parameterPrecision |
bool | _combineParameterNodes |
std::string | _indepNodeStyle |
std::string | _depNodeStyle |
Static Protected Attributes | |
static const std::string | _C_STATIC_INDEX_ARRAY = "index" |
static const std::string | _C_SPARSE_INDEX_ARRAY = "idx" |
Generates the model using the dot language used by graphviz.
Definition at line 28 of file language_dot.hpp.
|
inline |
Creates a MathML language source code generator
Definition at line 74 of file language_dot.hpp.
|
inlineoverrideprotectedvirtual |
Whether or not a new variable is created as a result of this operation
op | Operation |
totalUseCount | the number of times this node has been used as an argument in other operations |
Implements CppAD::cg::Language< Base >.
Definition at line 455 of file language_dot.hpp.
|
inlineprotectedvirtual |
Whether or not this operation assign its expression to a variable by itself.
var | the operation node |
Definition at line 505 of file language_dot.hpp.
|
inlineoverrideprotectedvirtual |
generate index array names (might be used for variable names)
generate variable names
Loop indexes
function variable declaration
Determine the dependent variables that result from the same operations
non-constant variables
Source code generation magic!
Implements CppAD::cg::Language< Base >.
Definition at line 238 of file language_dot.hpp.
|
inline |
Provides the style for the dependent variable nodes
Definition at line 147 of file language_dot.hpp.
|
inline |
Provides the style for the independent variable nodes
Definition at line 133 of file language_dot.hpp.
|
inlinevirtual |
Provides the maximum precision used to print constant values in the generated source code
Definition at line 109 of file language_dot.hpp.
|
inlineprotected |
constant value?
print the loop
Definition at line 91 of file language_dot_arrays.hpp.
Referenced by CppAD::cg::LanguageDot< Base >::printConditionalAssignment().
|
inlineprotectedvirtual |
Edges
Definition at line 1033 of file language_dot.hpp.
|
inlineprotectedvirtual |
Edges
Definition at line 1075 of file language_dot.hpp.
|
inlineprotectedvirtual |
Connections
Definition at line 997 of file language_dot.hpp.
|
inlineprotectedvirtual |
the first argument is the if start node, the following arguments are assignments in the previous if branch
Definition at line 1339 of file language_dot.hpp.
|
inlineprotectedvirtual |
the first argument is the condition, the second argument is the if start node, the following arguments are assignments in the previous if branch
Definition at line 1320 of file language_dot.hpp.
|
inlineprotectedvirtual |
Connections
Definition at line 1258 of file language_dot.hpp.
|
inlineprotectedvirtual |
|
inline |
1D
2D
Definition at line 56 of file language_dot_index_patterns.hpp.
Referenced by CppAD::cg::LanguageDot< Base >::getDepNodeStyle().
|
inlineprotectedvirtual |
the first argument is the condition, following arguments are just extra dependencies that must be defined outside the if
Definition at line 1302 of file language_dot.hpp.
|
inlineoverrideprotectedvirtual |
Whether or not this language can use information regarding the dependencies between different equations/variables.
Implements CppAD::cg::Language< Base >.
Definition at line 583 of file language_dot.hpp.
|
inline |
Defines the style for the dependent variable nodes
Definition at line 140 of file language_dot.hpp.
|
inline |
Defines the style for the independent variable nodes
Definition at line 126 of file language_dot.hpp.
|
inlinevirtual |
Defines the maximum precision used to print constant values in the generated source code
p | the maximum number of digits |
Definition at line 119 of file language_dot.hpp.