CppADCodeGen  HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
CppAD::cg::LanguageLatex< Base > Class Template Reference
Inheritance diagram for CppAD::cg::LanguageLatex< Base >:
Inheritance graph
Collaboration diagram for CppAD::cg::LanguageLatex< Base >:
Collaboration graph

Public Types

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

Public Member Functions

 LanguageLatex ()
 
const std::string & getAssignString () const
 
void setAssignString (const std::string &assign)
 
bool isIgnoreZeroDepAssign () const
 
void setIgnoreZeroDepAssign (bool ignore)
 
virtual void setFilename (const std::string &name)
 
virtual void setVariableEnvironment (const std::string &begin, const std::string &end)
 
virtual const std::string & getVariableEnvironmentStart () const
 
virtual const std::string & getVariableEnvironmentEnd () const
 
virtual void setDependentVarEnvironment (const std::string &begin, const std::string &end)
 
virtual const std::string & getDependentVarEnvironmentStart () const
 
virtual const std::string & getDependentVarEnvironmentEnd () const
 
virtual void setIndependentVarEnvironment (const std::string &begin, const std::string &end)
 
virtual const std::string & getIndependentVarEnvironmentStart () const
 
virtual const std::string & getIndependentVarEnvironmentEnd () const
 
virtual void setEquationEnvironment (const std::string &begin, const std::string &end)
 
virtual const std::string & getEquationEnvironmentStart () const
 
virtual const std::string & getEquationEnvironmentEnd () const
 
virtual void setAlgorithmLineEnvironment (const std::string &begin, const std::string &end)
 
virtual const std::string & getAlgorithmLineEnvironmentStart () const
 
virtual const std::string & getAlgorithmLineEnvironmentEnd () const
 
virtual void setEquationBlockEnvironment (const std::string &begin, const std::string &end)
 
virtual const std::string & getEquationBlockEnvironmentStart () const
 
virtual const std::string & getEquationBlockEnvironmentEnd () const
 
virtual void setAgorithmFileEnvironment (const std::string &begin, const std::string &end)
 
virtual const std::string & getAgorithmFileEnvironmentStart () const
 
virtual const std::string & getAgorithmFileEnvironmentEnd () const
 
virtual void setForEnvironment (const std::string &begin, const std::string &end)
 
virtual const std::string & getForEnvironmentStart () const
 
virtual const std::string & getForEnvironmentEnd () const
 
virtual void setConditionEnvironment (const std::string &begin, const std::string &end)
 
virtual const std::string & getConditionEnvironmentStart () const
 
virtual const std::string & getConditionEnvironmentEnd () const
 
virtual void setIfEnvironment (const std::string &begin, const std::string &end)
 
virtual const std::string & getIfEnvironmentStart () const
 
virtual const std::string & getIfEnvironmentEnd () const
 
virtual void setElseIfEnvironment (const std::string &begin, const std::string &end)
 
virtual const std::string & getElseIfEnvironmentStart () const
 
virtual const std::string & getElseIfEnvironmentEnd () const
 
virtual void setElseEnvironment (const std::string &begin, const std::string &end)
 
virtual const std::string & getElseEnvironmentStart () const
 
virtual const std::string & getElseEnvironmentEnd () const
 
virtual size_t getParameterPrecision () const
 
virtual void setParameterPrecision (size_t p)
 
virtual void setAlwaysEnclosePowBase (bool enclose)
 
virtual bool isAlwaysEnclosePowBase () const
 
const std::string & getMultiplicationOperator () const
 
void setMultiplicationOperator (const std::string &multOpStr)
 
const std::string & getMultiplicationConstParOperator () const
 
void setMultiplicationConstParOperator (const std::string &multValOpStr)
 
virtual void setMaxAssignmentsPerFunction (size_t maxAssignmentsPerFunction, std::map< std::string, std::string > *sources)
 
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::string &identation, 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 std::string indexPattern2String (const IndexPattern &ip, const Node &index)
 
static std::string indexPattern2String (const IndexPattern &ip, const std::vector< const Node *> &indexes)
 
static std::string linearIndexPattern2String (const LinearIndexPattern &lip, const Node &index)
 

Protected Member Functions

void generateSourceCode (std::ostream &out, std::unique_ptr< LanguageGenerationData< Base > > info) override
 
size_t getVariableID (const Node &node) const
 
virtual void printAlgorithmFileStart (std::ostream &out)
 
virtual void printAlgorithmFileEnd (std::ostream &out)
 
virtual void checkEquationEnvStart ()
 
virtual void checkEquationEnvEnd ()
 
unsigned printAssignment (Node &node)
 
unsigned printAssignment (Node &nodeName, const Arg &nodeRhs)
 
unsigned printAssignment (Node &nodeName, Node &nodeRhs)
 
virtual void printAssignmentStart (Node &op)
 
virtual void printAssignmentStart (Node &node, const std::string &varName, bool isDep)
 
virtual void printAssignmentEnd ()
 
virtual void printAssignmentEnd (Node &op)
 
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 printIndependentVariableName (Node &op)
 
virtual unsigned print (const Arg &arg)
 
virtual unsigned printExpression (Node &node)
 
virtual unsigned printExpressionNoVarCheck (Node &node)
 
virtual unsigned printAssignOp (Node &node)
 
virtual void printUnaryFunction (Node &op)
 
virtual void printPowFunction (Node &op)
 
virtual unsigned printOperationAlias (Node &op)
 
virtual void printOperationAdd (Node &op)
 
virtual void printOperationMinus (Node &op)
 
virtual void printOperationDiv (Node &op)
 
bool encloseInParenthesesMul (const Arg &arg) const
 
bool encloseInParenthesesMul (const Node *node) const
 
virtual void printOperationMul (Node &op)
 
virtual void printOperationUnaryMinus (Node &op)
 
virtual void printConditionalAssignment (Node &node)
 
bool isSameArgument (const Arg &newArg, const Arg *oldArg)
 
virtual void printArrayCreationOp (Node &op)
 
virtual void printSparseArrayCreationOp (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 printArrayElementOp (Node &op)
 
virtual void printAtomicForwardOp (Node &atomicFor)
 
virtual void printAtomicReverseOp (Node &atomicRev)
 
virtual unsigned printDependentMultiAssign (Node &node)
 
virtual void printLoopStart (Node &node)
 
virtual void printLoopEnd (Node &node)
 
virtual void printLoopIndexedDep (Node &node)
 
virtual void printLoopIndexedIndep (Node &node)
 
virtual void printLoopIndexedTmp (Node &node)
 
virtual void printTmpVar (Node &node)
 
virtual void printIndexAssign (Node &node)
 
virtual void printIndexCondExprOp (Node &node)
 
virtual void printStartIf (Node &node)
 
virtual void printElseIf (Node &node)
 
virtual void printElse (Node &node)
 
virtual void printEndIf (Node &node)
 
virtual void printCondResult (Node &node)
 
virtual void printUserCustom (Node &node)
 
bool isDependent (const Node &arg) const
 
virtual void printParameter (const Base &value)
 
virtual const std::string & getComparison (enum CGOpCode op) const
 
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

LanguageGenerationData< Base > * _info
 
size_t _indentationLevel
 
std::string _startVar
 
std::string _endVar
 
std::string _startDepVar
 
std::string _endDepVar
 
std::string _startIndepVar
 
std::string _endIndepVar
 
std::string _startEq
 
std::string _endEq
 
std::string _startAlgLine
 
std::string _endAlgLine
 
std::string _startEqBlock
 
std::string _endEqBlock
 
std::string _algFileStart
 
std::string _algFileEnd
 
std::string _forStart
 
std::string _forEnd
 
std::string _conditionStart
 
std::string _conditionEnd
 
std::string _ifStart
 
std::string _ifEnd
 
std::string _elseIfStart
 
std::string _elseIfEnd
 
std::string _elseStart
 
std::string _elseEnd
 
std::string _assignStr
 
std::string _multOpStr
 
std::string _multValOpStr
 
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
 
std::map< size_t, Node * > _temporary
 
bool _ignoreZeroDepAssign
 
std::string _filename
 
size_t _maxAssignmentsPerFile
 
std::map< std::string, std::string > * _sources
 
std::vector< const Arg * > _tmpArrayValues
 
std::vector< const Arg * > _tmpSparseArrayValues
 
std::vector< const LoopStartOperationNode< Base > * > _currentLoops
 
size_t _parameterPrecision
 
bool _inEquationEnv
 
bool _powBaseEnclose
 

Static Protected Attributes

static const std::string _C_STATIC_INDEX_ARRAY = "index"
 
static const std::string _C_SPARSE_INDEX_ARRAY = "idx"
 
static const std::string _COMP_OP_LT = "<"
 
static const std::string _COMP_OP_LE = "\\le"
 
static const std::string _COMP_OP_EQ = "=="
 
static const std::string _COMP_OP_GE = "\\ge"
 
static const std::string _COMP_OP_GT = ">"
 
static const std::string _COMP_OP_NE = "\\ne"
 
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::LanguageLatex< Base >

Generates code for the Latex language. It creates a generic implementation using custom latex environments which must be implemented by the user.

Author
Joao Leal

Definition at line 30 of file language_latex.hpp.

Constructor & Destructor Documentation

◆ LanguageLatex()

template<class Base >
CppAD::cg::LanguageLatex< Base >::LanguageLatex ( )
inline

Creates a Latex language source code generator

Definition at line 140 of file language_latex.hpp.

Member Function Documentation

◆ createsNewVariable()

template<class Base >
bool CppAD::cg::LanguageLatex< 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 1060 of file language_latex.hpp.

◆ directlyAssignsVariable()

template<class Base >
virtual bool CppAD::cg::LanguageLatex< 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 1110 of file language_latex.hpp.

◆ generateSourceCode()

template<class Base >
void CppAD::cg::LanguageLatex< 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 master latex file which inputs the other files

encapsulate the code in a function

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

Definition at line 683 of file language_latex.hpp.

◆ getAgorithmFileEnvironmentEnd()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getAgorithmFileEnvironmentEnd ( ) const
inlinevirtual

Provides the string used to terminate the environment for each algorithm file.

Definition at line 385 of file language_latex.hpp.

◆ getAgorithmFileEnvironmentStart()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getAgorithmFileEnvironmentStart ( ) const
inlinevirtual

Provides the string used to create the environment for each algorithm file.

Definition at line 378 of file language_latex.hpp.

◆ getAlgorithmLineEnvironmentEnd()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getAlgorithmLineEnvironmentEnd ( ) const
inlinevirtual

Provides the string used to terminate the environment for each line.

Definition at line 330 of file language_latex.hpp.

◆ getAlgorithmLineEnvironmentStart()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getAlgorithmLineEnvironmentStart ( ) const
inlinevirtual

Provides the string used to create the environment for each line.

Definition at line 323 of file language_latex.hpp.

◆ getConditionEnvironmentEnd()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getConditionEnvironmentEnd ( ) const
inlinevirtual

Provides the string used to terminate the environment for each condition.

Definition at line 437 of file language_latex.hpp.

◆ getConditionEnvironmentStart()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getConditionEnvironmentStart ( ) const
inlinevirtual

Provides the string used to create the environment for each condition.

Definition at line 430 of file language_latex.hpp.

◆ getDependentVarEnvironmentEnd()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getDependentVarEnvironmentEnd ( ) const
inlinevirtual

Provides the string used to terminate the environment for each dependent variable.

Definition at line 252 of file language_latex.hpp.

◆ getDependentVarEnvironmentStart()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getDependentVarEnvironmentStart ( ) const
inlinevirtual

Provides the string used to create the environment for each dependent variable.

Definition at line 245 of file language_latex.hpp.

◆ getElseEnvironmentEnd()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getElseEnvironmentEnd ( ) const
inlinevirtual

Provides the string used to terminate the environment for each else.

Definition at line 515 of file language_latex.hpp.

◆ getElseEnvironmentStart()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getElseEnvironmentStart ( ) const
inlinevirtual

Provides the string used to create the environment for each else.

Definition at line 508 of file language_latex.hpp.

◆ getElseIfEnvironmentEnd()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getElseIfEnvironmentEnd ( ) const
inlinevirtual

Provides the string used to terminate the environment for each else if.

Definition at line 489 of file language_latex.hpp.

◆ getElseIfEnvironmentStart()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getElseIfEnvironmentStart ( ) const
inlinevirtual

Provides the string used to create the environment for each else if.

Definition at line 482 of file language_latex.hpp.

◆ getEquationBlockEnvironmentEnd()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getEquationBlockEnvironmentEnd ( ) const
inlinevirtual

Provides the string used to terminate the environment for each equation block which can contain multiple equation lines with the same indentation.

Definition at line 359 of file language_latex.hpp.

◆ getEquationBlockEnvironmentStart()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getEquationBlockEnvironmentStart ( ) const
inlinevirtual

Provides the string used to create the environment for each equation block which can contain multiple equation lines with the same indentation.

Definition at line 351 of file language_latex.hpp.

◆ getEquationEnvironmentEnd()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getEquationEnvironmentEnd ( ) const
inlinevirtual

Provides the string used to terminate the environment for each equation.

Definition at line 304 of file language_latex.hpp.

◆ getEquationEnvironmentStart()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getEquationEnvironmentStart ( ) const
inlinevirtual

Provides the string used to create the environment for each equation.

Definition at line 297 of file language_latex.hpp.

◆ getForEnvironmentEnd()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getForEnvironmentEnd ( ) const
inlinevirtual

Provides the string used to terminate the environment for each for loop.

Definition at line 411 of file language_latex.hpp.

◆ getForEnvironmentStart()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getForEnvironmentStart ( ) const
inlinevirtual

Provides the string used to create the environment for each for loop.

Definition at line 404 of file language_latex.hpp.

◆ getIfEnvironmentEnd()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getIfEnvironmentEnd ( ) const
inlinevirtual

Provides the string used to terminate the environment for each If.

Definition at line 463 of file language_latex.hpp.

◆ getIfEnvironmentStart()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getIfEnvironmentStart ( ) const
inlinevirtual

Provides the string used to create the environment for each If.

Definition at line 456 of file language_latex.hpp.

◆ getIndependentVarEnvironmentEnd()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getIndependentVarEnvironmentEnd ( ) const
inlinevirtual

Provides the string used to terminate the environment for each independent variable.

Definition at line 278 of file language_latex.hpp.

◆ getIndependentVarEnvironmentStart()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getIndependentVarEnvironmentStart ( ) const
inlinevirtual

Provides the string used to create the environment for each independent variable.

Definition at line 271 of file language_latex.hpp.

◆ getMultiplicationConstParOperator()

template<class Base >
const std::string& CppAD::cg::LanguageLatex< Base >::getMultiplicationConstParOperator ( ) const
inline

Provides the operator used for multiplication of constant parameters. The default is "\times".

Definition at line 589 of file language_latex.hpp.

◆ getMultiplicationOperator()

template<class Base >
const std::string& CppAD::cg::LanguageLatex< Base >::getMultiplicationOperator ( ) const
inline

Provides the operator used to define multiplications. The default is an empty space.

Note
Multiplications of constant parameters use a different multiplication markup string

Definition at line 569 of file language_latex.hpp.

◆ getParameterPrecision()

template<class Base >
virtual size_t CppAD::cg::LanguageLatex< 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 525 of file language_latex.hpp.

◆ getVariableEnvironmentEnd()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getVariableEnvironmentEnd ( ) const
inlinevirtual

Provides the string used to terminate the environment for each variable.

Definition at line 226 of file language_latex.hpp.

◆ getVariableEnvironmentStart()

template<class Base >
virtual const std::string& CppAD::cg::LanguageLatex< Base >::getVariableEnvironmentStart ( ) const
inlinevirtual

Provides the string used to create the environment for each variable.

Definition at line 219 of file language_latex.hpp.

◆ isAlwaysEnclosePowBase()

template<class Base >
virtual bool CppAD::cg::LanguageLatex< Base >::isAlwaysEnclosePowBase ( ) const
inlinevirtual

Whether or not to always enclose the base of a power within parenthesis.

Returns
true if the base is always enclosed within parenthesis

Definition at line 557 of file language_latex.hpp.

◆ printArrayCreationUsingLoop()

template<class Base >
size_t CppAD::cg::LanguageLatex< 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

constant value?

print the loop

update values in the global temporary array

Definition at line 140 of file language_latex_arrays.hpp.

◆ printArrayStructInit()

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

TODO: finish this

Definition at line 317 of file language_latex_arrays.hpp.

◆ printAtomicForwardOp()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::printAtomicForwardOp ( Node atomicFor)
inlineprotectedvirtual

the values of ty are now changed

Definition at line 1739 of file language_latex.hpp.

◆ printAtomicReverseOp()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::printAtomicReverseOp ( Node atomicRev)
inlineprotectedvirtual

the values of px are now changed

Definition at line 1778 of file language_latex.hpp.

◆ printElse()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::printElse ( Node node)
inlineprotectedvirtual

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

Definition at line 2002 of file language_latex.hpp.

◆ printElseIf()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::printElseIf ( 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 1968 of file language_latex.hpp.

◆ printRandomIndexPatternDeclaration()

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

◆ printStartIf()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::printStartIf ( 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 1946 of file language_latex.hpp.

◆ requiresVariableDependencies()

template<class Base >
bool CppAD::cg::LanguageLatex< 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 1189 of file language_latex.hpp.

◆ setAgorithmFileEnvironment()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::setAgorithmFileEnvironment ( const std::string &  begin,
const std::string &  end 
)
inlinevirtual

Defines the Latex environment for each algorithm file.

Parameters
begina string creating the environment
enda string terminating the environment

Definition at line 369 of file language_latex.hpp.

◆ setAlgorithmLineEnvironment()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::setAlgorithmLineEnvironment ( const std::string &  begin,
const std::string &  end 
)
inlinevirtual

Defines the Latex environment for each algorithm line.

Parameters
begina string creating the environment
enda string terminating the environment

Definition at line 314 of file language_latex.hpp.

◆ setAlwaysEnclosePowBase()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::setAlwaysEnclosePowBase ( bool  enclose)
inlinevirtual

Defines whether or not to always enclose the base of a power within parenthesis. By default the base is only enclosed in parenthesis if it contains of a mathematical expression.

Parameters
enclosetrue to always enclose the base in parenthesis

Definition at line 547 of file language_latex.hpp.

◆ setConditionEnvironment()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::setConditionEnvironment ( const std::string &  begin,
const std::string &  end 
)
inlinevirtual

Defines the Latex environment for each condition.

Parameters
begina string creating the environment
enda string terminating the environment

Definition at line 421 of file language_latex.hpp.

◆ setDependentVarEnvironment()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::setDependentVarEnvironment ( const std::string &  begin,
const std::string &  end 
)
inlinevirtual

Defines the Latex environment for each dependent variable.

Parameters
begina string creating the environment
enda string terminating the environment

Definition at line 236 of file language_latex.hpp.

◆ setElseEnvironment()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::setElseEnvironment ( const std::string &  begin,
const std::string &  end 
)
inlinevirtual

Defines the Latex environment for each else.

Parameters
begina string creating the environment
enda string terminating the environment

Definition at line 499 of file language_latex.hpp.

◆ setElseIfEnvironment()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::setElseIfEnvironment ( const std::string &  begin,
const std::string &  end 
)
inlinevirtual

Defines the Latex environment for each else if.

Parameters
begina string creating the environment
enda string terminating the environment

Definition at line 473 of file language_latex.hpp.

◆ setEquationBlockEnvironment()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::setEquationBlockEnvironment ( const std::string &  begin,
const std::string &  end 
)
inlinevirtual

Defines the Latex environment for each equation block which can contain multiple equation lines with the same indentation.

Parameters
begina string creating the environment
enda string terminating the environment

Definition at line 341 of file language_latex.hpp.

◆ setEquationEnvironment()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::setEquationEnvironment ( const std::string &  begin,
const std::string &  end 
)
inlinevirtual

Defines the Latex environment for each equation.

Parameters
begina string creating the environment (e.g. "$", "\\begin{algomathdisplay}", "\\[")
enda string terminating the environment (e.g. "$\\;", "\\end{algomathdisplay}\\;", "\\]\\;")

Definition at line 288 of file language_latex.hpp.

◆ setForEnvironment()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::setForEnvironment ( const std::string &  begin,
const std::string &  end 
)
inlinevirtual

Defines the Latex environment for each for loop.

Parameters
begina string creating the environment
enda string terminating the environment

Definition at line 395 of file language_latex.hpp.

◆ setIfEnvironment()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::setIfEnvironment ( const std::string &  begin,
const std::string &  end 
)
inlinevirtual

Defines the Latex environment for each If.

Parameters
begina string creating the environment
enda string terminating the environment

Definition at line 447 of file language_latex.hpp.

◆ setIndependentVarEnvironment()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::setIndependentVarEnvironment ( const std::string &  begin,
const std::string &  end 
)
inlinevirtual

Defines the Latex environment for each independent variable.

Parameters
begina string creating the environment
enda string terminating the environment

Definition at line 262 of file language_latex.hpp.

◆ setMultiplicationConstParOperator()

template<class Base >
void CppAD::cg::LanguageLatex< Base >::setMultiplicationConstParOperator ( const std::string &  multValOpStr)
inline

Defines the operator used for multiplication of constant parameters. The default is "\times". Another common alternative is "\cdot". Please take into account that numbers too close together are difficult to distinguish.

Definition at line 600 of file language_latex.hpp.

◆ setMultiplicationOperator()

template<class Base >
void CppAD::cg::LanguageLatex< Base >::setMultiplicationOperator ( const std::string &  multOpStr)
inline

Defines the operator used for multiplications. The default is an empty space. Other common alternatives are "\cdot" and "\times".

Note
Multiplications of constant parameters use a different multiplication operator

Definition at line 581 of file language_latex.hpp.

◆ setParameterPrecision()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::setParameterPrecision ( size_t  p)
inlinevirtual

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

Parameters
pthe maximum number of digits

Definition at line 535 of file language_latex.hpp.

◆ setVariableEnvironment()

template<class Base >
virtual void CppAD::cg::LanguageLatex< Base >::setVariableEnvironment ( const std::string &  begin,
const std::string &  end 
)
inlinevirtual

Defines the Latex environment for each variable.

Parameters
begina string creating the environment
enda string terminating the environment

Definition at line 210 of file language_latex.hpp.


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