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

Public Member Functions

 Loop (EquationPattern< Base > &eq)
 
 Loop (const Loop< Base > &other)=delete
 
Loopoperator= (const Loop< Base > &rhs)=delete
 
void addEquation (EquationPattern< Base > &eq)
 
void setLinkedDependents (const std::set< std::set< size_t > *> &newLoopRelations)
 
void addLinkedEquationsByNonIndexed (EquationPattern< Base > *eq1, EquationPattern< Base > *eq2)
 
size_t getLinkedEquationsByNonIndexedCount () const
 
size_t getIterationCount () const
 
const std::vector< std::set< size_t > > & getIterationDependents () const
 
LoopModel< Base > * getModel () const
 
LoopModel< Base > * releaseLoopModel ()
 
void merge (Loop< Base > &other, const std::set< EquationPattern< Base > *> &indexedLoopRelations, const std::vector< std::pair< EquationPattern< Base > *, EquationPattern< Base > *> > &nonIndexedLoopRelations)
 
void mergeEqGroups (Loop< Base > &other)
 
void createLoopModel (const std::vector< CG< Base > > &dependents, const std::vector< CG< Base > > &independents, const std::map< size_t, EquationPattern< Base > *> &dep2Equation, std::map< OperationNode< Base > *, size_t > &origTemp2Index)
 
void generateDependentLoopIndexes (const std::map< size_t, EquationPattern< Base > *> &dep2Equation)
 
virtual ~Loop ()
 

Public Attributes

std::set< EquationPattern< Base > * > equations
 
IndexedIndependent< Base > indexedOpIndep
 

Detailed Description

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

A for loop.

Definition at line 102 of file declare_cg.hpp.

Constructor & Destructor Documentation

◆ ~Loop()

template<class Base>
virtual CppAD::cg::Loop< Base >::~Loop ( )
inlinevirtual

Destructor

Definition at line 585 of file loop.hpp.

Member Function Documentation

◆ createLoopModel()

template<class Base>
void CppAD::cg::Loop< Base >::createLoopModel ( const std::vector< CG< Base > > &  dependents,
const std::vector< CG< Base > > &  independents,
const std::map< size_t, EquationPattern< Base > *> &  dep2Equation,
std::map< OperationNode< Base > *, size_t > &  origTemp2Index 
)
inline

Determine the reference iteration for each

independent variable index patterns

Clean-up

Definition at line 283 of file loop.hpp.

◆ generateDependentLoopIndexes()

template<class Base>
void CppAD::cg::Loop< Base >::generateDependentLoopIndexes ( const std::map< size_t, EquationPattern< Base > *> &  dep2Equation)
inline

assign a dependent variable from each equation to an iteration

place dependents which only share non-indexed variables

Todo:
reorder iterations according to the lowest dependent in each iteration if there were new iterations only with dependents related by non-indexed shared variables

Definition at line 382 of file loop.hpp.

◆ getIterationCount()

template<class Base>
size_t CppAD::cg::Loop< Base >::getIterationCount ( ) const
inline

The number of iterations this loop will have

Definition at line 209 of file loop.hpp.

◆ merge()

template<class Base>
void CppAD::cg::Loop< Base >::merge ( Loop< Base > &  other,
const std::set< EquationPattern< Base > *> &  indexedLoopRelations,
const std::vector< std::pair< EquationPattern< Base > *, EquationPattern< Base > *> > &  nonIndexedLoopRelations 
)
inline

Combines the provided loop with the current one

Parameters
otherThe other loop

Definition at line 232 of file loop.hpp.

◆ mergeEqGroups()

template<class Base>
void CppAD::cg::Loop< Base >::mergeEqGroups ( Loop< Base > &  other)
inline

Update equation index

Definition at line 262 of file loop.hpp.

Member Data Documentation

◆ equations

template<class Base>
std::set<EquationPattern<Base>*> CppAD::cg::Loop< Base >::equations

The equations inside the loop

Definition at line 59 of file loop.hpp.

Referenced by CppAD::cg::Loop< Base >::merge(), and CppAD::cg::Loop< Base >::mergeEqGroups().

◆ indexedOpIndep

template<class Base>
IndexedIndependent<Base> CppAD::cg::Loop< Base >::indexedOpIndep

Which argument positions of operations (from the reference dependent) use indexed independent variables (operation -> argument index -> iteration -> independent)

Definition at line 65 of file loop.hpp.


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