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

Public Types

using CGBase = CG< Base >
 

Public Member Functions

 DependentPatternMatcher (const std::vector< std::set< size_t > > &relatedDepCandidates, const std::vector< CGBase > &dependents, const std::vector< CGBase > &independents)
 
const std::vector< EquationPattern< Base > * > & getEquationPatterns () const
 
const std::vector< Loop< Base > * > & getLoops () const
 
virtual void generateTapes (LoopFreeModel< Base > *&nonLoopTape, std::set< LoopModel< Base > *> &loopTapes)
 

Detailed Description

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

Finds common patterns in operation graphs

Definition at line 99 of file declare_cg.hpp.

Constructor & Destructor Documentation

◆ DependentPatternMatcher()

template<class Base >
CppAD::cg::DependentPatternMatcher< Base >::DependentPatternMatcher ( const std::vector< std::set< size_t > > &  relatedDepCandidates,
const std::vector< CGBase > &  dependents,
const std::vector< CGBase > &  independents 
)
inline

Creates a new DependentPatternMatcher

Parameters
relatedDepCandidatesGroups of dependent variable indexes that are believed to have the same expression pattern.
dependentsThe dependent variable values
independentsThe independent variable values

Definition at line 113 of file dependent_pattern_matcher.hpp.

Member Function Documentation

◆ generateTapes()

template<class Base >
virtual void CppAD::cg::DependentPatternMatcher< Base >::generateTapes ( LoopFreeModel< Base > *&  nonLoopTape,
std::set< LoopModel< Base > *> &  loopTapes 
)
inlinevirtual

Detects common equation patterns and generates a new tape for the model using loops. This method should only be called once!

Parameters
nonLoopTapeThe new tape without the loops or nullptr if there are no non-indexed expressions in the model
loopTapesThe models for each loop (must be deleted by the user)

Definition at line 148 of file dependent_pattern_matcher.hpp.


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