ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
adore::mad::LLinearPiecewiseFunctionA< T, N, k > Class Template Reference

#include <llinearpiecewisefunction.h>

Inheritance diagram for adore::mad::LLinearPiecewiseFunctionA< T, N, k >:
Inheritance graph
Collaboration diagram for adore::mad::LLinearPiecewiseFunctionA< T, N, k >:
Collaboration graph

Classes

class  OneDimension
 

Public Types

typedef AScalarToN< T, N >::DT DT
 
typedef AScalarToN< T, N >::SUBFUN SUBFUN
 
typedef adoreMatrix< T, N, 1 > CT
 
- Public Types inherited from adore::mad::AScalarToN< T, N >
typedef T DT
 
typedef adoreMatrix< T, N, 1 > CT
 
typedef ALFunction< DT, T > SUBFUN
 

Public Member Functions

virtual CT f (DT x) const override
 
virtual T fi (DT x, int dim) const override
 
virtual DT limitHi () const override
 
virtual DT limitLo () const override
 
virtual void setLimits (DT lo, DT hi) override
 
virtual ALFunction< DT, CT > * create_derivative () override
 
virtual void bound (const DT &xmin, const DT &xmax, CT &ymin, CT &ymax) override
 
virtual SUBFUNdimension (int i) override
 
 LLinearPiecewiseFunctionA (T *data, T x0, T x1)
 
virtual ~LLinearPiecewiseFunctionA ()
 
virtual ALFunction< DT, CT > * clone () override
 
virtual void multiply (adoreMatrix< T, 0, 0 > A, int row_start, int row_end) override
 
virtual void add (adoreMatrix< T, 0, 1 > b, int row_start, int row_end) override
 
- Public Member Functions inherited from adore::mad::AScalarToN< T, N >
void toArray (DT *xvec, T *yvec, unsigned int count)
 
void toArray (DT *xvec, T *yvec, unsigned int count, unsigned int row)
 
virtual void operator*= (adoreMatrix< T, N, N > A)
 
virtual void operator+= (adoreMatrix< T, N, 1 > b)
 
virtual void operator-= (adoreMatrix< T, N, 1 > b)
 
- Public Member Functions inherited from adore::mad::ALFunction< T, adoreMatrix< T, N, 1 > >
virtual void f (T *xvec, adoreMatrix< T, N, 1 > *yvec, unsigned int count) const
 
void bound (adoreMatrix< T, N, 1 > &ymin, adoreMatrix< T, N, 1 > &ymax)
 
virtual ~ALFunction ()
 
 ALFunction ()
 
const adoreMatrix< T, N, 1 > operator() (T x) const
 
bool isInDomain (T x)
 
adoreMatrix< T, N, 1 > f_bounded (T x)
 
void invalidateCachedBounds ()
 

Private Member Functions

void idx (DT x, int dim, int &i, int &j) const
 
DT xval (int i)
 

Private Attributes

m_data [N *k]
 
DT m_x0
 
DT m_x1
 
DT m_dx
 
OneDimension single_dimensions [N]
 

Detailed Description

template<typename T, int N, int k>
class adore::mad::LLinearPiecewiseFunctionA< T, N, k >

LLinearPiecewiseFunctionA - an array based linear piecewise function the array T* m_data is assumed to contain data for an N by k matrix, where an entry is located at m_data[col*N+row] the x data is assumed to be spaced equidistantly with m_dx between m_x0 and m_x1, leading to k points.

Member Typedef Documentation

◆ CT

template<typename T , int N, int k>
typedef adoreMatrix<T, N, 1> adore::mad::LLinearPiecewiseFunctionA< T, N, k >::CT

◆ DT

template<typename T , int N, int k>
typedef AScalarToN<T,N>::DT adore::mad::LLinearPiecewiseFunctionA< T, N, k >::DT

◆ SUBFUN

template<typename T , int N, int k>
typedef AScalarToN<T,N>::SUBFUN adore::mad::LLinearPiecewiseFunctionA< T, N, k >::SUBFUN

Constructor & Destructor Documentation

◆ LLinearPiecewiseFunctionA()

template<typename T , int N, int k>
adore::mad::LLinearPiecewiseFunctionA< T, N, k >::LLinearPiecewiseFunctionA ( T *  data,
x0,
x1 
)
inline

◆ ~LLinearPiecewiseFunctionA()

template<typename T , int N, int k>
virtual adore::mad::LLinearPiecewiseFunctionA< T, N, k >::~LLinearPiecewiseFunctionA ( )
inlinevirtual

Member Function Documentation

◆ add()

template<typename T , int N, int k>
virtual void adore::mad::LLinearPiecewiseFunctionA< T, N, k >::add ( adoreMatrix< T, 0, 1 >  b,
int  rowi,
int  rowj 
)
inlineoverridevirtual

apply operation to function subdimensions: add a vector to rowi to rowj

Implements adore::mad::AScalarToN< T, N >.

◆ bound()

template<typename T , int N, int k>
virtual void adore::mad::LLinearPiecewiseFunctionA< T, N, k >::bound ( const DT xmin,
const DT xmax,
CT ymin,
CT ymax 
)
inlineoverridevirtual

bound function values in the x-range defined by the hypercube between corner points lower left xmin and upper right xmax

Implements adore::mad::ALFunction< T, adoreMatrix< T, N, 1 > >.

Here is the call graph for this function:

◆ clone()

template<typename T , int N, int k>
virtual ALFunction<DT, CT>* adore::mad::LLinearPiecewiseFunctionA< T, N, k >::clone ( )
inlineoverridevirtual

create a copy of child class object - is used for function operations

Implements adore::mad::ALFunction< T, adoreMatrix< T, N, 1 > >.

◆ create_derivative()

template<typename T , int N, int k>
virtual ALFunction<DT, CT>* adore::mad::LLinearPiecewiseFunctionA< T, N, k >::create_derivative ( )
inlineoverridevirtual

create a new function object, which is the derivative function

Implements adore::mad::ALFunction< T, adoreMatrix< T, N, 1 > >.

◆ dimension()

template<typename T , int N, int k>
virtual SUBFUN* adore::mad::LLinearPiecewiseFunctionA< T, N, k >::dimension ( int  i)
inlineoverridevirtual

gives access to a scalar sub-function. does not create a new object, so use clone() to get your own instance of the subfunction.

Implements adore::mad::AScalarToN< T, N >.

◆ f()

template<typename T , int N, int k>
virtual CT adore::mad::LLinearPiecewiseFunctionA< T, N, k >::f ( DT  x) const
inlineoverridevirtual

function evaluation returns y of codomain type CT for a value x of domain type DT

Implements adore::mad::ALFunction< T, adoreMatrix< T, N, 1 > >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fi()

template<typename T , int N, int k>
virtual T adore::mad::LLinearPiecewiseFunctionA< T, N, k >::fi ( DT  x,
int  dim 
) const
inlineoverridevirtual

scalar evaluation of function: for y-component dim

Implements adore::mad::AScalarToN< T, N >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ idx()

template<typename T , int N, int k>
void adore::mad::LLinearPiecewiseFunctionA< T, N, k >::idx ( DT  x,
int  dim,
int &  i,
int &  j 
) const
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ limitHi()

template<typename T , int N, int k>
virtual DT adore::mad::LLinearPiecewiseFunctionA< T, N, k >::limitHi ( ) const
inlineoverridevirtual

query upper limit of the domain

Implements adore::mad::ALFunction< T, adoreMatrix< T, N, 1 > >.

Here is the caller graph for this function:

◆ limitLo()

template<typename T , int N, int k>
virtual DT adore::mad::LLinearPiecewiseFunctionA< T, N, k >::limitLo ( ) const
inlineoverridevirtual

lower limit of the domain

Implements adore::mad::ALFunction< T, adoreMatrix< T, N, 1 > >.

Here is the caller graph for this function:

◆ multiply()

template<typename T , int N, int k>
virtual void adore::mad::LLinearPiecewiseFunctionA< T, N, k >::multiply ( adoreMatrix< T, 0, 0 >  A,
int  row_start,
int  row_end 
)
inlineoverridevirtual

apply operation to function: multiply with matrix

Implements adore::mad::AScalarToN< T, N >.

◆ setLimits()

template<typename T , int N, int k>
virtual void adore::mad::LLinearPiecewiseFunctionA< T, N, k >::setLimits ( DT  lo,
DT  hi 
)
inlineoverridevirtual

reduce or increase the limit of the function, without changing y

Implements adore::mad::ALFunction< T, adoreMatrix< T, N, 1 > >.

◆ xval()

template<typename T , int N, int k>
DT adore::mad::LLinearPiecewiseFunctionA< T, N, k >::xval ( int  i)
inlineprivate
Here is the caller graph for this function:

Member Data Documentation

◆ m_data

template<typename T , int N, int k>
T adore::mad::LLinearPiecewiseFunctionA< T, N, k >::m_data[N *k]
private

◆ m_dx

template<typename T , int N, int k>
DT adore::mad::LLinearPiecewiseFunctionA< T, N, k >::m_dx
private

◆ m_x0

template<typename T , int N, int k>
DT adore::mad::LLinearPiecewiseFunctionA< T, N, k >::m_x0
private

◆ m_x1

template<typename T , int N, int k>
DT adore::mad::LLinearPiecewiseFunctionA< T, N, k >::m_x1
private

◆ single_dimensions

template<typename T , int N, int k>
OneDimension adore::mad::LLinearPiecewiseFunctionA< T, N, k >::single_dimensions[N]
private

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