CppADCodeGen 2.4.3
A C++ Algorithmic Differentiation Package with Source Code Generation
Loading...
Searching...
No Matches
CppAD::cg::Plane2DIndexPattern Class Reference

#include <plane_2d_index_pattern.hpp>

Inheritance diagram for CppAD::cg::Plane2DIndexPattern:
Inheritance graph
Collaboration diagram for CppAD::cg::Plane2DIndexPattern:
Collaboration graph

Public Member Functions

 Plane2DIndexPattern (IndexPattern *pattern1, IndexPattern *pattern2)
 
 Plane2DIndexPattern (const Plane2DIndexPattern &orig)=delete
 
const IndexPatterngetPattern1 () const
 
const IndexPatterngetPattern2 () const
 
IndexPatternType getType () const override
 
void getSubIndexes (std::set< IndexPattern * > &indexes) const override
 

Static Public Member Functions

static Plane2DIndexPatterndetectPlane2D (const std::map< size_t, std::map< size_t, size_t > > &x2y2z)
 
template<class VectorSizeT >
static IndexPatterndetect (const VectorSizeT &x2y)
 
static IndexPatterndetect (const std::map< size_t, size_t > &x2y)
 
static bool isConstant (const IndexPattern &ip)
 

Protected Attributes

IndexPatternpattern1_
 
IndexPatternpattern2_
 

Detailed Description

A plane index pattern (2D) defined by two index patterns for each index coordinate

z = f1(x) + f2(y)

Definition at line 28 of file plane_2d_index_pattern.hpp.

Constructor & Destructor Documentation

◆ Plane2DIndexPattern()

CppAD::cg::Plane2DIndexPattern::Plane2DIndexPattern ( IndexPattern pattern1,
IndexPattern pattern2 
)
inline

Definition at line 37 of file plane_2d_index_pattern.hpp.

◆ ~Plane2DIndexPattern()

virtual CppAD::cg::Plane2DIndexPattern::~Plane2DIndexPattern ( )
inlinevirtual

Definition at line 69 of file plane_2d_index_pattern.hpp.

Member Function Documentation

◆ detect() [1/2]

IndexPattern * CppAD::cg::IndexPattern::detect ( const std::map< size_t, size_t > &  x2y)
inlinestaticinherited

Detects the index pattern for the provided points (y = f(x))

Parameters
indexXthe index of the independents (x)
x2ymaps the independents to the dependents (x,y)
Returns
the generated index pattern (must be deleted by user)

Definition at line 38 of file index_pattern_impl.hpp.

◆ detect() [2/2]

template<class VectorSizeT >
IndexPattern * CppAD::cg::IndexPattern::detect ( const VectorSizeT &  x2y)
inlinestaticinherited

Detects the index pattern for the provided points (y = f(x))

Parameters
indexXthe index of the independents (x)
x2ymaps the independents to the dependents (indexes[x] = y )
Returns
the generated index pattern (must be deleted by user)

Definition at line 22 of file index_pattern_impl.hpp.

Referenced by detectPlane2D(), CppAD::cg::ModelCSourceGen< Base >::prepareSparseForwardOneWithLoops(), CppAD::cg::ModelCSourceGen< Base >::prepareSparseReverseOneWithLoops(), and CppAD::cg::ModelCSourceGen< Base >::prepareSparseReverseTwoWithLoops().

◆ detectPlane2D()

static Plane2DIndexPattern * CppAD::cg::Plane2DIndexPattern::detectPlane2D ( const std::map< size_t, std::map< size_t, size_t > > &  x2y2z)
inlinestatic

try to fit a combination of two patterns: z = fStart(x) + flit(y);

try to fit a combination of two patterns: z = fStart(x) + flit(y);

try to detect a pattern for the initial iteration index based on x

try to detect a pattern for the following iterations based on the local loop index (local index != model index)

only need to keep one

Definition at line 78 of file plane_2d_index_pattern.hpp.

Referenced by CppAD::cg::ModelCSourceGen< Base >::prepareSparseForwardOneWithLoops(), and CppAD::cg::ModelCSourceGen< Base >::prepareSparseReverseTwoWithLoops().

◆ getPattern1()

const IndexPattern * CppAD::cg::Plane2DIndexPattern::getPattern1 ( ) const
inline

Definition at line 46 of file plane_2d_index_pattern.hpp.

◆ getPattern2()

const IndexPattern * CppAD::cg::Plane2DIndexPattern::getPattern2 ( ) const
inline

Definition at line 50 of file plane_2d_index_pattern.hpp.

◆ getSubIndexes()

void CppAD::cg::Plane2DIndexPattern::getSubIndexes ( std::set< IndexPattern * > &  indexes) const
inlineoverridevirtual

Implements CppAD::cg::IndexPattern.

Definition at line 58 of file plane_2d_index_pattern.hpp.

◆ getType()

IndexPatternType CppAD::cg::Plane2DIndexPattern::getType ( ) const
inlineoverridevirtual

Implements CppAD::cg::IndexPattern.

Definition at line 54 of file plane_2d_index_pattern.hpp.

◆ isConstant()

bool CppAD::cg::IndexPattern::isConstant ( const IndexPattern ip)
inlinestaticinherited

Definition at line 53 of file index_pattern_impl.hpp.

Member Data Documentation

◆ pattern1_

IndexPattern* CppAD::cg::Plane2DIndexPattern::pattern1_
protected

maps the start of the linear section (first x) to the linear pattern

Definition at line 33 of file plane_2d_index_pattern.hpp.

◆ pattern2_

IndexPattern* CppAD::cg::Plane2DIndexPattern::pattern2_
protected

Definition at line 34 of file plane_2d_index_pattern.hpp.


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