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

#include <linear_index_pattern.hpp>

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

Public Member Functions

 LinearIndexPattern (long xOffset, long dy, long dx, long b)
 
long getXOffset () const
 
long getLinearSlopeDy () const
 
void setLinearSlopeDy (long dy)
 
long getLinearSlopeDx () const
 
long getLinearConstantTerm () const
 
void setLinearConstantTerm (long b)
 
IndexPatternType getType () const override
 
void getSubIndexes (std::set< IndexPattern * > &indexes) const override
 
long evaluate (long x) const
 

Static Public Member Functions

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

long xOffset_
 
long dy_
 
long dx_
 
long b_
 

Detailed Description

Linear pattern y = ((x - offset) / dx) * dy + b

Definition at line 25 of file linear_index_pattern.hpp.

Constructor & Destructor Documentation

◆ LinearIndexPattern()

CppAD::cg::LinearIndexPattern::LinearIndexPattern ( long  xOffset,
long  dy,
long  dx,
long  b 
)
inline

Definition at line 35 of file linear_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 CppAD::cg::Plane2DIndexPattern::detectPlane2D(), CppAD::cg::ModelCSourceGen< Base >::prepareSparseForwardOneWithLoops(), CppAD::cg::ModelCSourceGen< Base >::prepareSparseReverseOneWithLoops(), and CppAD::cg::ModelCSourceGen< Base >::prepareSparseReverseTwoWithLoops().

◆ evaluate()

long CppAD::cg::LinearIndexPattern::evaluate ( long  x) const
inline

Definition at line 76 of file linear_index_pattern.hpp.

◆ getLinearConstantTerm()

long CppAD::cg::LinearIndexPattern::getLinearConstantTerm ( ) const
inline

Definition at line 60 of file linear_index_pattern.hpp.

◆ getLinearSlopeDx()

long CppAD::cg::LinearIndexPattern::getLinearSlopeDx ( ) const
inline

Definition at line 56 of file linear_index_pattern.hpp.

◆ getLinearSlopeDy()

long CppAD::cg::LinearIndexPattern::getLinearSlopeDy ( ) const
inline

Definition at line 48 of file linear_index_pattern.hpp.

◆ getSubIndexes()

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

Implements CppAD::cg::IndexPattern.

Definition at line 72 of file linear_index_pattern.hpp.

◆ getType()

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

Implements CppAD::cg::IndexPattern.

Definition at line 68 of file linear_index_pattern.hpp.

◆ getXOffset()

long CppAD::cg::LinearIndexPattern::getXOffset ( ) const
inline

Definition at line 44 of file linear_index_pattern.hpp.

◆ isConstant()

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

Definition at line 53 of file index_pattern_impl.hpp.

◆ setLinearConstantTerm()

void CppAD::cg::LinearIndexPattern::setLinearConstantTerm ( long  b)
inline

Definition at line 64 of file linear_index_pattern.hpp.

◆ setLinearSlopeDy()

void CppAD::cg::LinearIndexPattern::setLinearSlopeDy ( long  dy)
inline

Definition at line 52 of file linear_index_pattern.hpp.

Member Data Documentation

◆ b_

long CppAD::cg::LinearIndexPattern::b_
protected

Definition at line 32 of file linear_index_pattern.hpp.

◆ dx_

long CppAD::cg::LinearIndexPattern::dx_
protected

Definition at line 30 of file linear_index_pattern.hpp.

◆ dy_

long CppAD::cg::LinearIndexPattern::dy_
protected

Definition at line 29 of file linear_index_pattern.hpp.

◆ xOffset_

long CppAD::cg::LinearIndexPattern::xOffset_
protected

Definition at line 27 of file linear_index_pattern.hpp.


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