CppADCodeGen 2.4.3
A C++ Algorithmic Differentiation Package with Source Code Generation
Loading...
Searching...
No Matches
CppAD::cg::LanguageC< Base > Class Template Reference

#include <language_c.hpp>

Inheritance diagram for CppAD::cg::LanguageC< Base >:
Inheritance graph
Collaboration diagram for CppAD::cg::LanguageC< Base >:
Collaboration graph

Public Types

using Node = OperationNode< Base >
 
using Arg = Argument< Base >
 

Public Member Functions

 LanguageC (std::string varTypeName, size_t spaces=3)
 
const std::string & getArgumentIn () const
 
void setArgumentIn (const std::string &inArgName)
 
const std::string & getArgumentOut () const
 
void setArgumentOut (const std::string &outArgName)
 
const std::string & getArgumentAtomic () const
 
void setArgumentAtomic (const std::string &atomicArgName)
 
const std::string & getDependentAssignOperation () const
 
void setDependentAssignOperation (const std::string &depAssignOperation)
 
bool isIgnoreZeroDepAssign () const
 
void setIgnoreZeroDepAssign (bool ignore)
 
virtual void setGenerateFunction (const std::string &functionName)
 
virtual void setFunctionIndexArgument (const Node &funcArgIndex)
 
virtual void setFunctionIndexArguments (const std::vector< const Node * > &funcArgIndexes)
 
virtual const std::vector< const Node * > & getFunctionIndexArguments () const
 
virtual size_t getParameterPrecision () const
 
virtual void setParameterPrecision (size_t p)
 
virtual void setMaxAssignmentsPerFunction (size_t maxAssignmentsPerFunction, std::map< std::string, std::string > *sources)
 
size_t getMaxOperationsPerAssignment () const
 
void setMaxOperationsPerAssignment (size_t maxOperationsPerAssignment)
 
std::string generateTemporaryVariableDeclaration (bool isWrapperFunction, bool zeroArrayDependents, const std::vector< int > &atomicMaxForward, const std::vector< int > &atomicMaxReverse)
 
virtual std::string generateTemporaryVariableDeclaration (bool isWrapperFunction=false, bool zeroArrayDependents=false, int maxForwardOrder=-1, int maxReverseOrder=-1)
 
void generateArrayContainersDeclaration (std::ostringstream &ss, const std::vector< int > &atomicMaxForward, const std::vector< int > &atomicMaxReverse)
 
virtual void generateArrayContainersDeclaration (std::ostringstream &ss, int maxForwardOrder=-1, int maxReverseOrder=-1)
 
virtual std::string generateDependentVariableDeclaration ()
 
virtual std::string generateIndependentVariableDeclaration ()
 
std::string generateArgumentAtomicDcl () const
 
virtual std::string generateFunctionArgumentsDcl () const
 
virtual std::vector< std::string > generateFunctionArgumentsDcl2 () const
 
virtual std::string generateDefaultFunctionArgumentsDcl () const
 
virtual std::vector< std::string > generateDefaultFunctionArgumentsDcl2 () const
 
virtual std::string generateFunctionIndexArgumentsDcl () const
 
virtual std::vector< std::string > generateFunctionIndexArgumentsDcl2 () const
 
virtual std::string generateDefaultFunctionArguments () const
 
virtual std::string generateFunctionIndexArguments () const
 
void createIndexDeclaration ()
 

Static Public Member Functions

static void printFunctionDeclaration (std::ostringstream &out, const std::string &returnType, const std::string &functionName, const std::vector< std::string > &arguments, const std::vector< std::string > &arguments2={})
 
static void printIndexCondExpr (std::ostringstream &out, const std::vector< size_t > &info, const std::string &index)
 
static void printStaticIndexArray (std::ostringstream &os, const std::string &name, const std::vector< size_t > &values)
 
static void printStaticIndexMatrix (std::ostringstream &os, const std::string &name, const std::map< size_t, std::map< size_t, size_t > > &values)
 
static void generateNames4RandomIndexPatterns (const std::set< RandomIndexPattern * > &randomPatterns)
 
static void printRandomIndexPatternDeclaration (std::ostringstream &os, const std::string &identation, const std::set< RandomIndexPattern * > &randomPatterns)
 
static std::string indexPattern2String (const IndexPattern &ip, const Node &index)
 
static std::string indexPattern2String (const IndexPattern &ip, const std::string &index)
 
static std::string indexPattern2String (const IndexPattern &ip, const std::vector< const Node * > &indexes)
 
static std::string indexPattern2String (const IndexPattern &ip, const std::vector< const std::string * > &indexes)
 
static std::string linearIndexPattern2String (const LinearIndexPattern &lip, const Node &index)
 
static std::string linearIndexPattern2String (const LinearIndexPattern &lip, const std::string &index)
 
static bool isOffsetBy (const IndexPattern *ip, const IndexPattern *refIp, long offset)
 
static bool isOffsetBy (const LinearIndexPattern *lIp, const LinearIndexPattern *refLIp, long offset)
 
static bool isOffsetBy (const LinearIndexPattern &lIp, const LinearIndexPattern &refLIp, long offset)
 
static bool isOffsetBy (const SectionedIndexPattern *sIp, const SectionedIndexPattern *refSecp, long offset)
 
static bool isOffsetBy (const SectionedIndexPattern &lIp, const SectionedIndexPattern &refSecp, long offset)
 
static Plane2DIndexPatternencapsulateIndexPattern (const LinearIndexPattern &refLIp, size_t starti)
 
static Plane2DIndexPatternencapsulateIndexPattern (const SectionedIndexPattern &refSecp, size_t starti)
 

Static Public Attributes

static const std::string U_INDEX_TYPE = "unsigned long"
 
static const std::string ATOMICFUN_STRUCT_DEFINITION
 

Protected Member Functions

void generateSourceCode (std::ostream &out, std::unique_ptr< LanguageGenerationData< Base > > info) override
 
size_t getVariableID (const Node &node) const
 
unsigned printAssignment (Node &node)
 
unsigned pushAssignment (Node &nodeName, const Arg &nodeRhs)
 
unsigned pushAssignment (Node &nodeName, Node &nodeRhs)
 
virtual void pushAssignmentStart (Node &op)
 
virtual void pushAssignmentStart (Node &node, const std::string &varName, bool isDep)
 
virtual void pushAssignmentEnd (Node &op)
 
virtual std::string argumentDeclaration (const FuncArgument &funcArg) const
 
virtual void saveLocalFunction (std::vector< std::string > &localFuncNames, bool zeroDependentArray)
 
bool createsNewVariable (const Node &var, size_t totalUseCount, size_t opCount) const override
 
virtual bool requiresVariableName (const Node &var) const
 
virtual bool directlyAssignsVariable (const Node &var) const
 
bool requiresVariableArgument (enum CGOpCode op, size_t argIndex) const override
 
const std::string & createVariableName (Node &var)
 
bool requiresVariableDependencies () const override
 
virtual void pushIndependentVariableName (Node &op)
 
virtual unsigned push (const Arg &arg)
 
virtual unsigned pushExpression (Node &op)
 
virtual unsigned pushExpressionNoVarCheck2 (Node &node)
 
virtual unsigned pushExpressionNoVarCheck (Node &node)
 
virtual unsigned pushAssignOp (Node &node)
 
virtual void pushUnaryFunction (Node &op)
 
virtual void pushPowFunction (Node &op)
 
virtual void pushSignFunction (Node &op)
 
virtual unsigned pushOperationAlias (Node &op)
 
virtual void pushOperationAdd (Node &op)
 
virtual void pushOperationMinus (Node &op)
 
bool encloseInParenthesesDiv (const Node *node) const
 
virtual void pushOperationDiv (Node &op)
 
bool encloseInParenthesesMul (const Node *node) const
 
virtual void pushOperationMul (Node &op)
 
virtual void pushOperationUnaryMinus (Node &op)
 
virtual void pushPrintOperation (const Node &node)
 
virtual void pushConditionalAssignment (Node &node)
 
bool isSameArgument (const Arg &newArg, const Arg *oldArg)
 
virtual void pushArrayCreationOp (Node &op)
 
virtual void pushSparseArrayCreationOp (Node &op)
 
void printArrayStructInit (const std::string &dataArrayName, size_t pos, const std::vector< Node * > &arrays, size_t k)
 
void printArrayStructInit (const std::string &dataArrayName, Node &array)
 
void markArrayChanged (Node &ty)
 
size_t printArrayCreationUsingLoop (size_t startPos, Node &array, size_t startj, std::vector< const Arg * > &tmpArrayValues)
 
std::string getTempArrayName (const Node &op)
 
virtual void pushArrayElementOp (Node &op)
 
virtual void pushAtomicForwardOp (Node &atomicFor)
 
virtual void pushAtomicReverseOp (Node &atomicRev)
 
virtual unsigned pushDependentMultiAssign (Node &node)
 
virtual void pushLoopStart (Node &node)
 
virtual void pushLoopEnd (Node &node)
 
virtual size_t printLoopIndexDeps (const std::vector< Node * > &variableOrder, size_t pos)
 
virtual size_t printLoopIndexedDepsUsingLoop (const std::vector< Node * > &variableOrder, size_t starti)
 
virtual void pushLoopIndexedDep (Node &node)
 
virtual void pushLoopIndexedIndep (Node &node)
 
virtual void pushLoopIndexedTmp (Node &node)
 
virtual void pushTmpVar (Node &node)
 
virtual void pushIndexAssign (Node &node)
 
virtual void pushIndexCondExprOp (Node &node)
 
virtual void pushStartIf (Node &node)
 
virtual void pushElseIf (Node &node)
 
virtual void pushElse (Node &node)
 
virtual void pushEndIf (Node &node)
 
virtual void pushCondResult (Node &node)
 
virtual void pushUserCustom (Node &node)
 
bool isDependent (const Node &arg) const
 
virtual void printParameter (const Base &value)
 
virtual void pushParameter (const Base &value)
 
template<class Output >
void writeParameter (const Base &value, Output &output)
 
virtual const std::string & getComparison (enum CGOpCode op) const
 
const std::string & getPrintfBaseFormat ()
 
const std::string & getPrintfBaseFormat ()
 
const std::string & getPrintfBaseFormat ()
 

Static Protected Member Functions

static bool isFunction (enum CGOpCode op)
 
static bool isUnaryFunction (enum CGOpCode op)
 
static bool isCondAssign (enum CGOpCode op)
 

Protected Attributes

const std::string _baseTypeName
 
const std::string _spaces
 
std::unique_ptr< LanguageGenerationData< Base > > _info
 
std::string _indentation
 
std::string _inArgName
 
std::string _outArgName
 
std::string _atomicArgName
 
std::ostringstream _code
 
VariableNameGenerator< Base > * _nameGen
 
std::ostringstream _ss
 
LangStreamStack< Base > _streamStack
 
size_t _independentSize
 
size_t _minTemporaryVarID
 
std::map< size_t, size_t > _dependentIDs
 
const ArrayView< CG< Base > > * _dependent
 
std::map< size_t, Node * > _temporary
 
std::string _depAssignOperation
 
bool _ignoreZeroDepAssign
 
std::string _functionName
 
size_t _maxAssignmentsPerFunction
 
size_t _maxOperationsPerAssignment
 
std::map< std::string, std::string > * _sources
 
std::vector< const Arg * > _tmpArrayValues
 
std::vector< const Arg * > _tmpSparseArrayValues
 
std::map< std::string, AtomicFuncArray > _atomicFuncArrays
 
std::vector< const Node * > _funcArgIndexes
 
std::vector< const LoopStartOperationNode< Base > * > _currentLoops
 
size_t _parameterPrecision
 

Static Protected Attributes

static const std::string _C_COMP_OP_LT = "<"
 
static const std::string _C_COMP_OP_LE = "<="
 
static const std::string _C_COMP_OP_EQ = "=="
 
static const std::string _C_COMP_OP_GE = ">="
 
static const std::string _C_COMP_OP_GT = ">"
 
static const std::string _C_COMP_OP_NE = "!="
 
static const std::string _C_STATIC_INDEX_ARRAY = "index"
 
static const std::string _C_SPARSE_INDEX_ARRAY = "idx"
 
static const std::string _ATOMIC_TX = "atx"
 
static const std::string _ATOMIC_TY = "aty"
 
static const std::string _ATOMIC_PX = "apx"
 
static const std::string _ATOMIC_PY = "apy"
 

Detailed Description

template<class Base>
class CppAD::cg::LanguageC< Base >

Generates code for the C language

Author
Joao Leal

Definition at line 34 of file language_c.hpp.

Member Typedef Documentation

◆ Arg

template<class Base >
using CppAD::cg::LanguageC< Base >::Arg = Argument<Base>

Definition at line 37 of file language_c.hpp.

◆ Node

template<class Base >
using CppAD::cg::LanguageC< Base >::Node = OperationNode<Base>

Definition at line 36 of file language_c.hpp.

Constructor & Destructor Documentation

◆ LanguageC()

template<class Base >
CppAD::cg::LanguageC< Base >::LanguageC ( std::string  varTypeName,
size_t  spaces = 3 
)
inlineexplicit

Creates a C language source code generator

Parameters
varTypeNamevariable data type (e.g. double)
spacesnumber of spaces for indentations

Definition at line 127 of file language_c.hpp.

Member Function Documentation

◆ argumentDeclaration()

template<class Base >
virtual std::string CppAD::cg::LanguageC< Base >::argumentDeclaration ( const FuncArgument funcArg) const
inlineprotectedvirtual

Definition at line 1040 of file language_c.hpp.

◆ createIndexDeclaration()

template<class Base >
void CppAD::cg::LanguageC< Base >::createIndexDeclaration
inline

Definition at line 86 of file language_c_index_patterns.hpp.

◆ createsNewVariable()

template<class Base >
bool CppAD::cg::LanguageC< Base >::createsNewVariable ( const Node op,
size_t  totalUseCount,
size_t  opCount 
) const
inlineoverrideprotectedvirtual

Whether or not a new variable is created as a result of this operation

Parameters
opOperation
totalUseCountthe number of times this node has been used as an argument in other operations
Returns
true if a new variable is created

Implements CppAD::cg::Language< Base >.

Definition at line 1091 of file language_c.hpp.

◆ createVariableName()

template<class Base >
const std::string & CppAD::cg::LanguageC< Base >::createVariableName ( Node var)
inlineprotected

Definition at line 1170 of file language_c.hpp.

◆ directlyAssignsVariable()

template<class Base >
virtual bool CppAD::cg::LanguageC< Base >::directlyAssignsVariable ( const Node var) const
inlineprotectedvirtual

Whether or not this operation assign its expression to a variable by itself.

Parameters
varthe operation node
Returns

Definition at line 1146 of file language_c.hpp.

◆ encapsulateIndexPattern() [1/2]

template<class Base >
Plane2DIndexPattern * CppAD::cg::LanguageC< Base >::encapsulateIndexPattern ( const LinearIndexPattern refLIp,
size_t  starti 
)
inlinestatic

Definition at line 413 of file language_c_index_patterns.hpp.

◆ encapsulateIndexPattern() [2/2]

template<class Base >
Plane2DIndexPattern * CppAD::cg::LanguageC< Base >::encapsulateIndexPattern ( const SectionedIndexPattern refSecp,
size_t  starti 
)
inlinestatic

Definition at line 425 of file language_c_index_patterns.hpp.

◆ encloseInParenthesesDiv()

template<class Base >
bool CppAD::cg::LanguageC< Base >::encloseInParenthesesDiv ( const Node node) const
inlineprotected

Definition at line 1595 of file language_c.hpp.

◆ encloseInParenthesesMul()

template<class Base >
bool CppAD::cg::LanguageC< Base >::encloseInParenthesesMul ( const Node node) const
inlineprotected

Definition at line 1635 of file language_c.hpp.

◆ generateArgumentAtomicDcl()

template<class Base >
std::string CppAD::cg::LanguageC< Base >::generateArgumentAtomicDcl ( ) const
inline

Definition at line 447 of file language_c.hpp.

◆ generateArrayContainersDeclaration() [1/2]

template<class Base >
void CppAD::cg::LanguageC< Base >::generateArrayContainersDeclaration ( std::ostringstream &  ss,
const std::vector< int > &  atomicMaxForward,
const std::vector< int > &  atomicMaxReverse 
)
inline

Definition at line 389 of file language_c.hpp.

◆ generateArrayContainersDeclaration() [2/2]

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::generateArrayContainersDeclaration ( std::ostringstream &  ss,
int  maxForwardOrder = -1,
int  maxReverseOrder = -1 
)
inlinevirtual

Definition at line 403 of file language_c.hpp.

◆ generateDefaultFunctionArguments()

template<class Base >
virtual std::string CppAD::cg::LanguageC< Base >::generateDefaultFunctionArguments ( ) const
inlinevirtual

Definition at line 489 of file language_c.hpp.

◆ generateDefaultFunctionArgumentsDcl()

template<class Base >
virtual std::string CppAD::cg::LanguageC< Base >::generateDefaultFunctionArgumentsDcl ( ) const
inlinevirtual

Definition at line 467 of file language_c.hpp.

◆ generateDefaultFunctionArgumentsDcl2()

template<class Base >
virtual std::vector< std::string > CppAD::cg::LanguageC< Base >::generateDefaultFunctionArgumentsDcl2 ( ) const
inlinevirtual

Definition at line 471 of file language_c.hpp.

◆ generateDependentVariableDeclaration()

template<class Base >
virtual std::string CppAD::cg::LanguageC< Base >::generateDependentVariableDeclaration ( )
inlinevirtual

Definition at line 417 of file language_c.hpp.

◆ generateFunctionArgumentsDcl()

template<class Base >
virtual std::string CppAD::cg::LanguageC< Base >::generateFunctionArgumentsDcl ( ) const
inlinevirtual

Definition at line 451 of file language_c.hpp.

◆ generateFunctionArgumentsDcl2()

template<class Base >
virtual std::vector< std::string > CppAD::cg::LanguageC< Base >::generateFunctionArgumentsDcl2 ( ) const
inlinevirtual

Definition at line 460 of file language_c.hpp.

◆ generateFunctionIndexArguments()

template<class Base >
virtual std::string CppAD::cg::LanguageC< Base >::generateFunctionIndexArguments ( ) const
inlinevirtual

Definition at line 493 of file language_c.hpp.

◆ generateFunctionIndexArgumentsDcl()

template<class Base >
virtual std::string CppAD::cg::LanguageC< Base >::generateFunctionIndexArgumentsDcl ( ) const
inlinevirtual

Definition at line 477 of file language_c.hpp.

◆ generateFunctionIndexArgumentsDcl2()

template<class Base >
virtual std::vector< std::string > CppAD::cg::LanguageC< Base >::generateFunctionIndexArgumentsDcl2 ( ) const
inlinevirtual

Definition at line 481 of file language_c.hpp.

◆ generateIndependentVariableDeclaration()

template<class Base >
virtual std::string CppAD::cg::LanguageC< Base >::generateIndependentVariableDeclaration ( )
inlinevirtual

Definition at line 432 of file language_c.hpp.

◆ generateNames4RandomIndexPatterns()

template<class Base >
void CppAD::cg::LanguageC< Base >::generateNames4RandomIndexPatterns ( const std::set< RandomIndexPattern * > &  randomPatterns)
inlinestatic

Definition at line 23 of file language_c_index_patterns.hpp.

◆ generateSourceCode()

template<class Base >
void CppAD::cg::LanguageC< Base >::generateSourceCode ( std::ostream &  out,
std::unique_ptr< LanguageGenerationData< Base > >  info 
)
inlineoverrideprotectedvirtual

generate index array names (might be used for variable names)

generate variable names

function variable declaration

Determine the dependent variables that result from the same operations

non-constant variables

Source code generation magic!

Create the wrapper function which calls the other functions

encapsulate the code in a function

Implements CppAD::cg::Language< Base >.

Definition at line 663 of file language_c.hpp.

◆ generateTemporaryVariableDeclaration() [1/2]

template<class Base >
std::string CppAD::cg::LanguageC< Base >::generateTemporaryVariableDeclaration ( bool  isWrapperFunction,
bool  zeroArrayDependents,
const std::vector< int > &  atomicMaxForward,
const std::vector< int > &  atomicMaxReverse 
)
inline

Definition at line 277 of file language_c.hpp.

◆ generateTemporaryVariableDeclaration() [2/2]

template<class Base >
virtual std::string CppAD::cg::LanguageC< Base >::generateTemporaryVariableDeclaration ( bool  isWrapperFunction = false,
bool  zeroArrayDependents = false,
int  maxForwardOrder = -1,
int  maxReverseOrder = -1 
)
inlinevirtual

Declares temporary variables used by a function.

Parameters
isWrapperFunctiontrue if the declarations are for a wrapper function which calls other functions where the actual work is performed
zeroArrayDependentswhether or not the dependent variables should be set to zero before executing the operation graph
maxForwardOrderthe maximum order of forward mode calls to atomic functions
maxReverseOrderthe maximum order of reverse mode calls to atomic functions
Returns
the string with the declarations for the temporary variables

temporary variables

temporary array variables

temporary sparse array variables

Definition at line 308 of file language_c.hpp.

◆ getArgumentAtomic()

template<class Base >
const std::string & CppAD::cg::LanguageC< Base >::getArgumentAtomic ( ) const
inline

Definition at line 166 of file language_c.hpp.

◆ getArgumentIn()

template<class Base >
const std::string & CppAD::cg::LanguageC< Base >::getArgumentIn ( ) const
inline

Definition at line 150 of file language_c.hpp.

◆ getArgumentOut()

template<class Base >
const std::string & CppAD::cg::LanguageC< Base >::getArgumentOut ( ) const
inline

Definition at line 158 of file language_c.hpp.

◆ getComparison()

template<class Base >
virtual const std::string & CppAD::cg::LanguageC< Base >::getComparison ( enum CGOpCode  op) const
inlineprotectedvirtual

Definition at line 2109 of file language_c.hpp.

◆ getDependentAssignOperation()

template<class Base >
const std::string & CppAD::cg::LanguageC< Base >::getDependentAssignOperation ( ) const
inline

Definition at line 174 of file language_c.hpp.

◆ getFunctionIndexArguments()

template<class Base >
virtual const std::vector< const Node * > & CppAD::cg::LanguageC< Base >::getFunctionIndexArguments ( ) const
inlinevirtual

Definition at line 217 of file language_c.hpp.

◆ getMaxOperationsPerAssignment()

template<class Base >
size_t CppAD::cg::LanguageC< Base >::getMaxOperationsPerAssignment ( ) const
inline

The maximum number of operations per variable assignment.

Returns
The maximum number of operations per variable assignment

Definition at line 263 of file language_c.hpp.

◆ getParameterPrecision()

template<class Base >
virtual size_t CppAD::cg::LanguageC< Base >::getParameterPrecision ( ) const
inlinevirtual

Provides the maximum precision used to print constant values in the generated source code

Returns
the maximum number of digits

Definition at line 227 of file language_c.hpp.

◆ getPrintfBaseFormat() [1/3]

template<class Base >
const std::string & CppAD::cg::LanguageC< Base >::getPrintfBaseFormat ( )
inlineprotected

Definition at line 2136 of file language_c.hpp.

◆ getPrintfBaseFormat() [2/3]

const std::string & CppAD::cg::LanguageC< double >::getPrintfBaseFormat ( )
inlineprotected

Definition at line 33 of file language_c_double.hpp.

◆ getPrintfBaseFormat() [3/3]

const std::string & CppAD::cg::LanguageC< float >::getPrintfBaseFormat ( )
inlineprotected

Definition at line 144 of file language_c_float.hpp.

◆ getTempArrayName()

template<class Base >
std::string CppAD::cg::LanguageC< Base >::getTempArrayName ( const Node op)
inlineprotected

Definition at line 301 of file language_c_arrays.hpp.

◆ getVariableID()

template<class Base >
size_t CppAD::cg::LanguageC< Base >::getVariableID ( const Node node) const
inlineprotected

Definition at line 962 of file language_c.hpp.

◆ indexPattern2String() [1/4]

template<class Base >
std::string CppAD::cg::LanguageC< Base >::indexPattern2String ( const IndexPattern ip,
const Node index 
)
inlinestatic

Definition at line 182 of file language_c_index_patterns.hpp.

◆ indexPattern2String() [2/4]

template<class Base >
std::string CppAD::cg::LanguageC< Base >::indexPattern2String ( const IndexPattern ip,
const std::string &  index 
)
inlinestatic

Definition at line 188 of file language_c_index_patterns.hpp.

◆ indexPattern2String() [3/4]

template<class Base >
std::string CppAD::cg::LanguageC< Base >::indexPattern2String ( const IndexPattern ip,
const std::vector< const Node * > &  indexes 
)
inlinestatic

Definition at line 194 of file language_c_index_patterns.hpp.

◆ indexPattern2String() [4/4]

template<class Base >
std::string CppAD::cg::LanguageC< Base >::indexPattern2String ( const IndexPattern ip,
const std::vector< const std::string * > &  indexes 
)
inlinestatic

Definition at line 203 of file language_c_index_patterns.hpp.

◆ isCondAssign()

template<class Base >
static bool CppAD::cg::LanguageC< Base >::isCondAssign ( enum CGOpCode  op)
inlinestaticprotected

Definition at line 2175 of file language_c.hpp.

◆ isDependent()

template<class Base >
bool CppAD::cg::LanguageC< Base >::isDependent ( const Node arg) const
inlineprotected

Definition at line 2075 of file language_c.hpp.

◆ isFunction()

template<class Base >
static bool CppAD::cg::LanguageC< Base >::isFunction ( enum CGOpCode  op)
inlinestaticprotected

Definition at line 2141 of file language_c.hpp.

◆ isIgnoreZeroDepAssign()

template<class Base >
bool CppAD::cg::LanguageC< Base >::isIgnoreZeroDepAssign ( ) const
inline

Whether or not source code to set dependent variables to zero will be generated. It may be used not to set the dependent variables to zero when it is known they are already set to zero before the source code generation.

Returns
true if source code to explicitly set dependent variables to zero will NOT be created.

Definition at line 189 of file language_c.hpp.

◆ isOffsetBy() [1/5]

template<class Base >
bool CppAD::cg::LanguageC< Base >::isOffsetBy ( const IndexPattern ip,
const IndexPattern refIp,
long  offset 
)
inlinestatic

Definition at line 319 of file language_c_index_patterns.hpp.

◆ isOffsetBy() [2/5]

template<class Base >
bool CppAD::cg::LanguageC< Base >::isOffsetBy ( const LinearIndexPattern lIp,
const LinearIndexPattern refLIp,
long  offset 
)
inlinestatic

Definition at line 363 of file language_c_index_patterns.hpp.

◆ isOffsetBy() [3/5]

template<class Base >
bool CppAD::cg::LanguageC< Base >::isOffsetBy ( const LinearIndexPattern lIp,
const LinearIndexPattern refLIp,
long  offset 
)
inlinestatic

Definition at line 352 of file language_c_index_patterns.hpp.

◆ isOffsetBy() [4/5]

template<class Base >
bool CppAD::cg::LanguageC< Base >::isOffsetBy ( const SectionedIndexPattern lIp,
const SectionedIndexPattern refSecp,
long  offset 
)
inlinestatic

Definition at line 383 of file language_c_index_patterns.hpp.

◆ isOffsetBy() [5/5]

template<class Base >
bool CppAD::cg::LanguageC< Base >::isOffsetBy ( const SectionedIndexPattern sIp,
const SectionedIndexPattern refSecp,
long  offset 
)
inlinestatic

Definition at line 373 of file language_c_index_patterns.hpp.

◆ isSameArgument()

template<class Base >
bool CppAD::cg::LanguageC< Base >::isSameArgument ( const Arg newArg,
const Arg oldArg 
)
inlineprotected

Definition at line 1754 of file language_c.hpp.

◆ isUnaryFunction()

template<class Base >
static bool CppAD::cg::LanguageC< Base >::isUnaryFunction ( enum CGOpCode  op)
inlinestaticprotected

Definition at line 2145 of file language_c.hpp.

◆ linearIndexPattern2String() [1/2]

template<class Base >
std::string CppAD::cg::LanguageC< Base >::linearIndexPattern2String ( const LinearIndexPattern lip,
const Node index 
)
inlinestatic

Definition at line 277 of file language_c_index_patterns.hpp.

◆ linearIndexPattern2String() [2/2]

template<class Base >
std::string CppAD::cg::LanguageC< Base >::linearIndexPattern2String ( const LinearIndexPattern lip,
const std::string &  index 
)
inlinestatic

Definition at line 283 of file language_c_index_patterns.hpp.

◆ markArrayChanged()

template<class Base >
void CppAD::cg::LanguageC< Base >::markArrayChanged ( Node ty)
inlineprotected

Definition at line 439 of file language_c_arrays.hpp.

◆ printArrayCreationUsingLoop()

template<class Base >
size_t CppAD::cg::LanguageC< Base >::printArrayCreationUsingLoop ( size_t  startPos,
Node array,
size_t  startj,
std::vector< const Arg * > &  tmpArrayValues 
)
inlineprotected

from independents array

from independents array in a loop

from temporary variable array

constant value?

print the loop

update values in the global temporary array

Definition at line 125 of file language_c_arrays.hpp.

◆ printArrayStructInit() [1/2]

template<class Base >
void CppAD::cg::LanguageC< Base >::printArrayStructInit ( const std::string &  dataArrayName,
Node array 
)
inlineprotected

Definition at line 335 of file language_c_arrays.hpp.

◆ printArrayStructInit() [2/2]

template<class Base >
void CppAD::cg::LanguageC< Base >::printArrayStructInit ( const std::string &  dataArrayName,
size_t  pos,
const std::vector< Node * > &  arrays,
size_t  k 
)
inlineprotected

Definition at line 325 of file language_c_arrays.hpp.

◆ printAssignment()

template<class Base >
unsigned CppAD::cg::LanguageC< Base >::printAssignment ( Node node)
inlineprotected

Definition at line 966 of file language_c.hpp.

◆ printFunctionDeclaration()

template<class Base >
static void CppAD::cg::LanguageC< Base >::printFunctionDeclaration ( std::ostringstream &  out,
const std::string &  returnType,
const std::string &  functionName,
const std::vector< std::string > &  arguments,
const std::vector< std::string > &  arguments2 = {} 
)
inlinestatic

Prints a function declaration where each argument is in a different line.

Parameters
outthe stream where the declaration is printed
returnTypethe function return type
functionNamethe function name
argumentsfunction arguments
arguments2additional function arguments

Definition at line 538 of file language_c.hpp.

Referenced by CppAD::cg::ModelCSourceGen< Base >::generateGlobalDirectionalFunctionSource(), CppAD::cg::LanguageC< Base >::generateSourceCode(), CppAD::cg::ModelCSourceGen< Base >::generateSparseHessianRev2MultiThreadSource(), and CppAD::cg::ModelCSourceGen< Base >::generateSparseJacobianForRevMultiThreadSource().

◆ printIndexCondExpr()

template<class Base >
static void CppAD::cg::LanguageC< Base >::printIndexCondExpr ( std::ostringstream &  out,
const std::vector< size_t > &  info,
const std::string &  index 
)
inlinestatic

Definition at line 563 of file language_c.hpp.

◆ printLoopIndexDeps()

template<class Base >
size_t CppAD::cg::LanguageC< Base >::printLoopIndexDeps ( const std::vector< Node * > &  variableOrder,
size_t  pos 
)
protectedvirtual

Definition at line 31 of file language_c_loops.hpp.

◆ printLoopIndexedDepsUsingLoop()

template<class Base >
size_t CppAD::cg::LanguageC< Base >::printLoopIndexedDepsUsingLoop ( const std::vector< Node * > &  variableOrder,
size_t  starti 
)
inlineprotectedvirtual

Check that the assigned value is from an array

check that the type of index pattern can be used within a loop

Find last compatible variable in variableOrder

Create the dependent variable name with the new index pattern

print the loop

Definition at line 58 of file language_c_loops.hpp.

◆ printParameter()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::printParameter ( const Base &  value)
inlineprotectedvirtual

Definition at line 2083 of file language_c.hpp.

◆ printRandomIndexPatternDeclaration()

template<class Base >
void CppAD::cg::LanguageC< Base >::printRandomIndexPatternDeclaration ( std::ostringstream &  os,
const std::string &  identation,
const std::set< RandomIndexPattern * > &  randomPatterns 
)
inlinestatic

1D

2D

Definition at line 56 of file language_c_index_patterns.hpp.

◆ printStaticIndexArray()

template<class Base >
void CppAD::cg::LanguageC< Base >::printStaticIndexArray ( std::ostringstream &  os,
const std::string &  name,
const std::vector< size_t > &  values 
)
inlinestatic

Definition at line 114 of file language_c_index_patterns.hpp.

◆ printStaticIndexMatrix()

template<class Base >
void CppAD::cg::LanguageC< Base >::printStaticIndexMatrix ( std::ostringstream &  os,
const std::string &  name,
const std::map< size_t, std::map< size_t, size_t > > &  values 
)
inlinestatic

Definition at line 128 of file language_c_index_patterns.hpp.

◆ push()

template<class Base >
virtual unsigned CppAD::cg::LanguageC< Base >::push ( const Arg arg)
inlineprotectedvirtual

Definition at line 1241 of file language_c.hpp.

◆ pushArrayCreationOp()

template<class Base >
void CppAD::cg::LanguageC< Base >::pushArrayCreationOp ( Node op)
protectedvirtual

Definition at line 23 of file language_c_arrays.hpp.

◆ pushArrayElementOp()

template<class Base >
void CppAD::cg::LanguageC< Base >::pushArrayElementOp ( Node op)
protectedvirtual

Definition at line 309 of file language_c_arrays.hpp.

◆ pushAssignment() [1/2]

template<class Base >
unsigned CppAD::cg::LanguageC< Base >::pushAssignment ( Node nodeName,
const Arg nodeRhs 
)
inlineprotected

Definition at line 970 of file language_c.hpp.

◆ pushAssignment() [2/2]

template<class Base >
unsigned CppAD::cg::LanguageC< Base >::pushAssignment ( Node nodeName,
Node nodeRhs 
)
inlineprotected

Definition at line 985 of file language_c.hpp.

◆ pushAssignmentEnd()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushAssignmentEnd ( Node op)
inlineprotectedvirtual

Definition at line 1036 of file language_c.hpp.

◆ pushAssignmentStart() [1/2]

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushAssignmentStart ( Node node,
const std::string &  varName,
bool  isDep 
)
inlineprotectedvirtual

Definition at line 1015 of file language_c.hpp.

◆ pushAssignmentStart() [2/2]

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushAssignmentStart ( Node op)
inlineprotectedvirtual

Definition at line 1011 of file language_c.hpp.

◆ pushAssignOp()

template<class Base >
virtual unsigned CppAD::cg::LanguageC< Base >::pushAssignOp ( Node node)
inlineprotectedvirtual

Definition at line 1433 of file language_c.hpp.

◆ pushAtomicForwardOp()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushAtomicForwardOp ( Node atomicFor)
inlineprotectedvirtual

the values of ty are now changed

Definition at line 1791 of file language_c.hpp.

◆ pushAtomicReverseOp()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushAtomicReverseOp ( Node atomicRev)
inlineprotectedvirtual

the values of px are now changed

Definition at line 1833 of file language_c.hpp.

◆ pushConditionalAssignment()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushConditionalAssignment ( Node node)
inlineprotectedvirtual

Definition at line 1717 of file language_c.hpp.

◆ pushCondResult()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushCondResult ( Node node)
inlineprotectedvirtual

Definition at line 2058 of file language_c.hpp.

◆ pushDependentMultiAssign()

template<class Base >
virtual unsigned CppAD::cg::LanguageC< Base >::pushDependentMultiAssign ( Node node)
inlineprotectedvirtual

Definition at line 1881 of file language_c.hpp.

◆ pushElse()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushElse ( Node node)
inlineprotectedvirtual

the first argument is the if start node, the following arguments are assignments in the previous if branch

Definition at line 2035 of file language_c.hpp.

◆ pushElseIf()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushElseIf ( Node node)
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 2015 of file language_c.hpp.

◆ pushEndIf()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushEndIf ( Node node)
inlineprotectedvirtual

Definition at line 2050 of file language_c.hpp.

◆ pushExpression()

template<class Base >
virtual unsigned CppAD::cg::LanguageC< Base >::pushExpression ( Node op)
inlineprotectedvirtual

Definition at line 1252 of file language_c.hpp.

◆ pushExpressionNoVarCheck()

template<class Base >
virtual unsigned CppAD::cg::LanguageC< Base >::pushExpressionNoVarCheck ( Node node)
inlineprotectedvirtual

Definition at line 1289 of file language_c.hpp.

◆ pushExpressionNoVarCheck2()

template<class Base >
virtual unsigned CppAD::cg::LanguageC< Base >::pushExpressionNoVarCheck2 ( Node node)
inlineprotectedvirtual

Definition at line 1264 of file language_c.hpp.

◆ pushIndependentVariableName()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushIndependentVariableName ( Node op)
inlineprotectedvirtual

Definition at line 1235 of file language_c.hpp.

◆ pushIndexAssign()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushIndexAssign ( Node node)
inlineprotectedvirtual

Definition at line 1974 of file language_c.hpp.

◆ pushIndexCondExprOp()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushIndexCondExprOp ( Node node)
inlineprotectedvirtual

Definition at line 1985 of file language_c.hpp.

◆ pushLoopEnd()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushLoopEnd ( Node node)
inlineprotectedvirtual

Definition at line 1927 of file language_c.hpp.

◆ pushLoopIndexedDep()

template<class Base >
void CppAD::cg::LanguageC< Base >::pushLoopIndexedDep ( Node node)
protectedvirtual

Definition at line 23 of file language_c_loops.hpp.

◆ pushLoopIndexedIndep()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushLoopIndexedIndep ( Node node)
inlineprotectedvirtual

Definition at line 1946 of file language_c.hpp.

◆ pushLoopIndexedTmp()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushLoopIndexedTmp ( Node node)
inlineprotectedvirtual

Definition at line 1956 of file language_c.hpp.

◆ pushLoopStart()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushLoopStart ( Node node)
inlineprotectedvirtual

Definition at line 1904 of file language_c.hpp.

◆ pushOperationAdd()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushOperationAdd ( Node op)
inlineprotectedvirtual

Definition at line 1551 of file language_c.hpp.

◆ pushOperationAlias()

template<class Base >
virtual unsigned CppAD::cg::LanguageC< Base >::pushOperationAlias ( Node op)
inlineprotectedvirtual

Definition at line 1546 of file language_c.hpp.

◆ pushOperationDiv()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushOperationDiv ( Node op)
inlineprotectedvirtual

Definition at line 1609 of file language_c.hpp.

◆ pushOperationMinus()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushOperationMinus ( Node op)
inlineprotectedvirtual

Definition at line 1569 of file language_c.hpp.

◆ pushOperationMul()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushOperationMul ( Node op)
inlineprotectedvirtual

Definition at line 1651 of file language_c.hpp.

◆ pushOperationUnaryMinus()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushOperationUnaryMinus ( Node op)
inlineprotectedvirtual

Definition at line 1677 of file language_c.hpp.

◆ pushParameter()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushParameter ( const Base &  value)
inlineprotectedvirtual

Definition at line 2087 of file language_c.hpp.

◆ pushPowFunction()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushPowFunction ( Node op)
inlineprotectedvirtual

Definition at line 1514 of file language_c.hpp.

◆ pushPrintOperation()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushPrintOperation ( const Node node)
inlineprotectedvirtual

Definition at line 1696 of file language_c.hpp.

◆ pushSignFunction()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushSignFunction ( Node op)
inlineprotectedvirtual

Definition at line 1524 of file language_c.hpp.

◆ pushSparseArrayCreationOp()

template<class Base >
void CppAD::cg::LanguageC< Base >::pushSparseArrayCreationOp ( Node op)
protectedvirtual

Definition at line 60 of file language_c_arrays.hpp.

◆ pushStartIf()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushStartIf ( Node node)
inlineprotectedvirtual

the first argument is the condition, following arguments are just extra dependencies that must be defined outside the if

Definition at line 1999 of file language_c.hpp.

◆ pushTmpVar()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushTmpVar ( Node node)
inlineprotectedvirtual

Definition at line 1965 of file language_c.hpp.

◆ pushUnaryFunction()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushUnaryFunction ( Node op)
inlineprotectedvirtual

Definition at line 1439 of file language_c.hpp.

◆ pushUserCustom()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::pushUserCustom ( Node node)
inlineprotectedvirtual

Definition at line 2069 of file language_c.hpp.

◆ requiresVariableArgument()

template<class Base >
bool CppAD::cg::LanguageC< Base >::requiresVariableArgument ( enum CGOpCode  op,
size_t  argIndex 
) const
inlineoverrideprotectedvirtual

Implements CppAD::cg::Language< Base >.

Definition at line 1166 of file language_c.hpp.

◆ requiresVariableDependencies()

template<class Base >
bool CppAD::cg::LanguageC< Base >::requiresVariableDependencies ( ) const
inlineoverrideprotectedvirtual

Whether or not this language can use information regarding the dependencies between different equations/variables.

Implements CppAD::cg::Language< Base >.

Definition at line 1231 of file language_c.hpp.

◆ requiresVariableName()

template<class Base >
virtual bool CppAD::cg::LanguageC< Base >::requiresVariableName ( const Node var) const
inlineprotectedvirtual

Definition at line 1117 of file language_c.hpp.

◆ saveLocalFunction()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::saveLocalFunction ( std::vector< std::string > &  localFuncNames,
bool  zeroDependentArray 
)
inlineprotectedvirtual

Definition at line 1048 of file language_c.hpp.

◆ setArgumentAtomic()

template<class Base >
void CppAD::cg::LanguageC< Base >::setArgumentAtomic ( const std::string &  atomicArgName)
inline

Definition at line 170 of file language_c.hpp.

◆ setArgumentIn()

template<class Base >
void CppAD::cg::LanguageC< Base >::setArgumentIn ( const std::string &  inArgName)
inline

Definition at line 154 of file language_c.hpp.

◆ setArgumentOut()

template<class Base >
void CppAD::cg::LanguageC< Base >::setArgumentOut ( const std::string &  outArgName)
inline

Definition at line 162 of file language_c.hpp.

◆ setDependentAssignOperation()

template<class Base >
void CppAD::cg::LanguageC< Base >::setDependentAssignOperation ( const std::string &  depAssignOperation)
inline

Definition at line 178 of file language_c.hpp.

◆ setFunctionIndexArgument()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::setFunctionIndexArgument ( const Node funcArgIndex)
inlinevirtual

Definition at line 208 of file language_c.hpp.

◆ setFunctionIndexArguments()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::setFunctionIndexArguments ( const std::vector< const Node * > &  funcArgIndexes)
inlinevirtual

Definition at line 213 of file language_c.hpp.

◆ setGenerateFunction()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::setGenerateFunction ( const std::string &  functionName)
inlinevirtual

Definition at line 204 of file language_c.hpp.

◆ setIgnoreZeroDepAssign()

template<class Base >
void CppAD::cg::LanguageC< Base >::setIgnoreZeroDepAssign ( bool  ignore)
inline

Whether or not to generate expressions to set dependent variables to zero. It may be used not to set the dependent variables to zero when it is known they are already set to zero before the source code generation.

Parameters
ignoretrue if source code to explicitly set dependent variables to zero will NOT be created.

Definition at line 200 of file language_c.hpp.

◆ setMaxAssignmentsPerFunction()

template<class Base >
virtual void CppAD::cg::LanguageC< Base >::setMaxAssignmentsPerFunction ( size_t  maxAssignmentsPerFunction,
std::map< std::string, std::string > *  sources 
)
inlinevirtual

Defines the maximum number of assignment per generated function. Zero means it is disabled (no limit). By setting a limit, it is possible to reduce the compiler workload by having multiple file/function instead of a very large one. Note that it is not possible to split some function (e.g., containing loops) and, therefore, this limit can be violated.

Parameters
maxAssignmentsPerFunctionthe maximum number of assignments per file/function
sourcesA map where the file names are associated with their contents.

Definition at line 252 of file language_c.hpp.

Referenced by CppAD::cg::ModelCSourceGen< Base >::generateSparseForwardOneSourcesNoAtomics(), CppAD::cg::ModelCSourceGen< Base >::generateSparseForwardOneSourcesWithAtomics(), CppAD::cg::ModelCSourceGen< Base >::generateSparseHessianSourceDirectly(), CppAD::cg::ModelCSourceGen< Base >::generateSparseReverseOneSourcesNoAtomics(), CppAD::cg::ModelCSourceGen< Base >::generateSparseReverseOneSourcesWithAtomics(), CppAD::cg::ModelCSourceGen< Base >::generateSparseReverseTwoSourcesNoAtomics(), CppAD::cg::ModelCSourceGen< Base >::generateZeroSource(), and CppAD::cg::ModelCSourceGen< Base >::prepareSparseReverseTwoWithLoops().

◆ setMaxOperationsPerAssignment()

template<class Base >
void CppAD::cg::LanguageC< Base >::setMaxOperationsPerAssignment ( size_t  maxOperationsPerAssignment)
inline

◆ setParameterPrecision()

◆ writeParameter()

template<class Base >
template<class Output >
void CppAD::cg::LanguageC< Base >::writeParameter ( const Base &  value,
Output &  output 
)
inlineprotected

Definition at line 2092 of file language_c.hpp.

Member Data Documentation

◆ _ATOMIC_PX

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::_ATOMIC_PX = "apx"
staticprotected

Definition at line 52 of file language_c.hpp.

◆ _ATOMIC_PY

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::_ATOMIC_PY = "apy"
staticprotected

Definition at line 53 of file language_c.hpp.

◆ _ATOMIC_TX

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::_ATOMIC_TX = "atx"
staticprotected

Definition at line 50 of file language_c.hpp.

◆ _ATOMIC_TY

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::_ATOMIC_TY = "aty"
staticprotected

Definition at line 51 of file language_c.hpp.

◆ _atomicArgName

template<class Base >
std::string CppAD::cg::LanguageC< Base >::_atomicArgName
protected

Definition at line 70 of file language_c.hpp.

◆ _atomicFuncArrays

template<class Base >
std::map<std::string, AtomicFuncArray> CppAD::cg::LanguageC< Base >::_atomicFuncArrays
protected

Definition at line 107 of file language_c.hpp.

◆ _baseTypeName

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::_baseTypeName
protected

Definition at line 58 of file language_c.hpp.

◆ _C_COMP_OP_EQ

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::_C_COMP_OP_EQ = "=="
staticprotected

Definition at line 44 of file language_c.hpp.

◆ _C_COMP_OP_GE

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::_C_COMP_OP_GE = ">="
staticprotected

Definition at line 45 of file language_c.hpp.

◆ _C_COMP_OP_GT

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::_C_COMP_OP_GT = ">"
staticprotected

Definition at line 46 of file language_c.hpp.

◆ _C_COMP_OP_LE

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::_C_COMP_OP_LE = "<="
staticprotected

Definition at line 43 of file language_c.hpp.

◆ _C_COMP_OP_LT

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::_C_COMP_OP_LT = "<"
staticprotected

Definition at line 42 of file language_c.hpp.

◆ _C_COMP_OP_NE

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::_C_COMP_OP_NE = "!="
staticprotected

Definition at line 47 of file language_c.hpp.

◆ _C_SPARSE_INDEX_ARRAY

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::_C_SPARSE_INDEX_ARRAY = "idx"
staticprotected

Definition at line 49 of file language_c.hpp.

◆ _C_STATIC_INDEX_ARRAY

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::_C_STATIC_INDEX_ARRAY = "index"
staticprotected

Definition at line 48 of file language_c.hpp.

◆ _code

template<class Base >
std::ostringstream CppAD::cg::LanguageC< Base >::_code
protected

Definition at line 72 of file language_c.hpp.

◆ _currentLoops

template<class Base >
std::vector<const LoopStartOperationNode<Base>*> CppAD::cg::LanguageC< Base >::_currentLoops
protected

Definition at line 110 of file language_c.hpp.

◆ _depAssignOperation

template<class Base >
std::string CppAD::cg::LanguageC< Base >::_depAssignOperation
protected

Definition at line 91 of file language_c.hpp.

◆ _dependent

template<class Base >
const ArrayView<CG<Base> >* CppAD::cg::LanguageC< Base >::_dependent
protected

Definition at line 87 of file language_c.hpp.

◆ _dependentIDs

template<class Base >
std::map<size_t, size_t> CppAD::cg::LanguageC< Base >::_dependentIDs
protected

Definition at line 85 of file language_c.hpp.

◆ _funcArgIndexes

template<class Base >
std::vector<const Node*> CppAD::cg::LanguageC< Base >::_funcArgIndexes
protected

Definition at line 109 of file language_c.hpp.

◆ _functionName

template<class Base >
std::string CppAD::cg::LanguageC< Base >::_functionName
protected

Definition at line 95 of file language_c.hpp.

◆ _ignoreZeroDepAssign

template<class Base >
bool CppAD::cg::LanguageC< Base >::_ignoreZeroDepAssign
protected

Definition at line 93 of file language_c.hpp.

◆ _inArgName

template<class Base >
std::string CppAD::cg::LanguageC< Base >::_inArgName
protected

Definition at line 66 of file language_c.hpp.

◆ _indentation

template<class Base >
std::string CppAD::cg::LanguageC< Base >::_indentation
protected

Definition at line 64 of file language_c.hpp.

◆ _independentSize

template<class Base >
size_t CppAD::cg::LanguageC< Base >::_independentSize
protected

Definition at line 80 of file language_c.hpp.

◆ _info

template<class Base >
std::unique_ptr<LanguageGenerationData<Base> > CppAD::cg::LanguageC< Base >::_info
protected

Definition at line 62 of file language_c.hpp.

◆ _maxAssignmentsPerFunction

template<class Base >
size_t CppAD::cg::LanguageC< Base >::_maxAssignmentsPerFunction
protected

Definition at line 97 of file language_c.hpp.

◆ _maxOperationsPerAssignment

template<class Base >
size_t CppAD::cg::LanguageC< Base >::_maxOperationsPerAssignment
protected

Definition at line 99 of file language_c.hpp.

◆ _minTemporaryVarID

template<class Base >
size_t CppAD::cg::LanguageC< Base >::_minTemporaryVarID
protected

Definition at line 82 of file language_c.hpp.

◆ _nameGen

template<class Base >
VariableNameGenerator<Base>* CppAD::cg::LanguageC< Base >::_nameGen
protected

Definition at line 74 of file language_c.hpp.

◆ _outArgName

template<class Base >
std::string CppAD::cg::LanguageC< Base >::_outArgName
protected

Definition at line 68 of file language_c.hpp.

◆ _parameterPrecision

template<class Base >
size_t CppAD::cg::LanguageC< Base >::_parameterPrecision
protected

Definition at line 112 of file language_c.hpp.

◆ _sources

template<class Base >
std::map<std::string, std::string>* CppAD::cg::LanguageC< Base >::_sources
protected

Definition at line 101 of file language_c.hpp.

◆ _spaces

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::_spaces
protected

Definition at line 60 of file language_c.hpp.

◆ _ss

template<class Base >
std::ostringstream CppAD::cg::LanguageC< Base >::_ss
protected

Definition at line 76 of file language_c.hpp.

◆ _streamStack

template<class Base >
LangStreamStack<Base> CppAD::cg::LanguageC< Base >::_streamStack
protected

Definition at line 78 of file language_c.hpp.

◆ _temporary

template<class Base >
std::map<size_t, Node*> CppAD::cg::LanguageC< Base >::_temporary
protected

Definition at line 89 of file language_c.hpp.

◆ _tmpArrayValues

template<class Base >
std::vector<const Arg*> CppAD::cg::LanguageC< Base >::_tmpArrayValues
protected

Definition at line 103 of file language_c.hpp.

◆ _tmpSparseArrayValues

template<class Base >
std::vector<const Arg*> CppAD::cg::LanguageC< Base >::_tmpSparseArrayValues
protected

Definition at line 105 of file language_c.hpp.

◆ ATOMICFUN_STRUCT_DEFINITION

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::ATOMICFUN_STRUCT_DEFINITION
static
Initial value:
=
"typedef struct Array {\n"
" void* data;\n"
" " + U_INDEX_TYPE + " size;\n"
" int sparse;\n"
" const " + U_INDEX_TYPE + "* idx;\n"
" " + U_INDEX_TYPE + " nnz;\n"
"} Array;\n"
"\n"
"struct LangCAtomicFun {\n"
" void* libModel;\n"
" int (*forward)(void* libModel,\n"
" int atomicIndex,\n"
" int q,\n"
" int p,\n"
" const Array tx[],\n"
" Array* ty);\n"
" int (*reverse)(void* libModel,\n"
" int atomicIndex,\n"
" int p,\n"
" const Array tx[],\n"
" Array* px,\n"
" const Array py[]);\n"
"};"

Definition at line 40 of file language_c.hpp.

◆ U_INDEX_TYPE

template<class Base >
const std::string CppAD::cg::LanguageC< Base >::U_INDEX_TYPE = "unsigned long"
static

Definition at line 39 of file language_c.hpp.


The documentation for this class was generated from the following files: