CppADCodeGen 2.4.3
A C++ Algorithmic Differentiation Package with Source Code Generation
|
#include <language_dot.hpp>
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.
|
inherited |
Definition at line 163 of file language.hpp.
|
inline |
Creates a MathML language source code generator
Definition at line 74 of file language_dot.hpp.
|
inlinevirtual |
Definition at line 88 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.
|
inlineprotected |
Definition at line 528 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.
|
inlinestatic |
Definition at line 23 of file language_dot_index_patterns.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.
|
inlineprotectedvirtual |
Definition at line 1389 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 |
Definition at line 451 of file language_dot.hpp.
|
inlinestatic |
Definition at line 138 of file language_dot_index_patterns.hpp.
|
inlinestatic |
Definition at line 145 of file language_dot_index_patterns.hpp.
|
inline |
Definition at line 161 of file language_dot.hpp.
|
inlinestaticprotected |
Definition at line 1457 of file language_dot.hpp.
|
inlineprotected |
Definition at line 1381 of file language_dot.hpp.
|
inlinestaticprotected |
Definition at line 1422 of file language_dot.hpp.
|
inline |
Definition at line 91 of file language_dot.hpp.
|
inlinestaticprotected |
Definition at line 1426 of file language_dot.hpp.
|
inlinestatic |
Definition at line 225 of file language_dot_index_patterns.hpp.
|
inlineprotected |
Definition at line 625 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 635 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 621 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 587 of file language_dot.hpp.
|
protectedvirtual |
Definition at line 23 of file language_dot_arrays.hpp.
|
inlineprotected |
|
protectedvirtual |
Definition at line 135 of file language_dot_arrays.hpp.
|
inlineprotectedvirtual |
Definition at line 868 of file language_dot.hpp.
|
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 |
Definition at line 1365 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 1129 of file language_dot.hpp.
|
inlineprotected |
Definition at line 739 of file language_dot.hpp.
|
inlineprotected |
Definition at line 748 of file language_dot.hpp.
|
inlineprotected |
Definition at line 674 of file language_dot.hpp.
|
inlineprotected |
Definition at line 692 of file language_dot.hpp.
|
inlineprotected |
Definition at line 713 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 |
Definition at line 1355 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 597 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 756 of file language_dot.hpp.
|
inlineprotectedvirtual |
Connections
Definition at line 1258 of file language_dot.hpp.
|
inlinestatic |
Definition at line 168 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 1283 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 1195 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 1207 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 1218 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 1233 of file language_dot.hpp.
|
inlineprotectedvirtual |
|
inlineprotected |
Definition at line 648 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 654 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 919 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 907 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 951 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 935 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 967 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 983 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 606 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 874 of file language_dot.hpp.
|
inline |
1D
2D
Definition at line 56 of file language_dot_index_patterns.hpp.
Referenced by CppAD::cg::LanguageDot< Base >::generateSourceCode().
|
protectedvirtual |
Definition at line 53 of file language_dot_arrays.hpp.
|
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.
|
inline |
Definition at line 93 of file language_dot_index_patterns.hpp.
|
inline |
Definition at line 106 of file language_dot_index_patterns.hpp.
|
inlineprotectedvirtual |
Definition at line 1246 of file language_dot.hpp.
|
inlineprotectedvirtual |
Definition at line 887 of file language_dot.hpp.
|
inlineoverrideprotectedvirtual |
Implements CppAD::cg::Language< Base >.
Definition at line 524 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.
|
inlineprotectedvirtual |
Definition at line 480 of file language_dot.hpp.
|
inline |
Definition at line 154 of file language_dot.hpp.
|
inline |
Defines the style for the dependent variable nodes
Definition at line 140 of file language_dot.hpp.
|
inline |
Definition at line 99 of file language_dot.hpp.
|
inline |
Definition at line 95 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.
|
staticprotected |
Definition at line 31 of file language_dot.hpp.
|
staticprotected |
Definition at line 30 of file language_dot.hpp.
|
protected |
Definition at line 38 of file language_dot.hpp.
|
protected |
Definition at line 61 of file language_dot.hpp.
|
protected |
Definition at line 57 of file language_dot.hpp.
|
protected |
Definition at line 51 of file language_dot.hpp.
|
protected |
Definition at line 49 of file language_dot.hpp.
|
protected |
Definition at line 65 of file language_dot.hpp.
|
protected |
Definition at line 36 of file language_dot.hpp.
|
protected |
Definition at line 55 of file language_dot.hpp.
|
protected |
Definition at line 53 of file language_dot.hpp.
|
protected |
Definition at line 44 of file language_dot.hpp.
|
protected |
Definition at line 63 of file language_dot.hpp.
|
protected |
Definition at line 34 of file language_dot.hpp.
|
protected |
Definition at line 46 of file language_dot.hpp.
|
protected |
Definition at line 40 of file language_dot.hpp.
|
protected |
Definition at line 59 of file language_dot.hpp.
|
protected |
Definition at line 42 of file language_dot.hpp.