The blo Library
Loading...
Searching...
No Matches
Public Member Functions | Related Functions | List of all members
blo::PiecewisePolynomial< T > Class Template Reference

Piecewise polynomial. More...

#include <PiecewisePolynomial.h>

Public Member Functions

 PiecewisePolynomial ()
 Default constructor.
 
 PiecewisePolynomial (int pieces, int numLocalCoefficients)
 Constructs piecewise polynomial of specified size.
 
 PiecewisePolynomial (const T *pBreaks, const T *pCoeffs, int coeffsStride1, int coeffsRows, int coeffsColumns)
 Constructs piecewise polynomial of specified breaks and interval local polynomial coefficients.
 
 PiecewisePolynomial (const PiecewisePolynomial &rhs)
 Copy constructor.
 
 PiecewisePolynomial (PiecewisePolynomial &&rhs) noexcept
 Move constructor.
 
virtual ~PiecewisePolynomial ()
 Destructor.
 
PiecewisePolynomial & operator= (const PiecewisePolynomial &rhs)
 Copy assignment operator.
 
PiecewisePolynomial & operator= (PiecewisePolynomial &&rhs) noexcept
 Move assignment operator.
 
void resize (int pieces, int numLocalCoefficients)
 Resizes piecewise polynomial.
 
void set (const T *pBreaks, const T *pCoeffs, int coeffsStride1, int coeffsRows, int coeffsColumns)
 Sets the piecewise polynomial breaks and interval local polynomial coefficients.
 
const T * ptrBreaks () const
 Pointer to the piecewise polynomial breaks.
 
T * ptrBreaks ()
 Pointer to the piecewise polynomial breaks.
 
const T * ptrPieceCoefficients (int piece) const
 The piecewise polynomial interval local polynomial coefficients.
 
T * ptrPieceCoefficients (int piece)
 The piecewise polynomial interval local polynomial coefficients.
 
int pieces () const
 Number of pieces.
 
int numLocalCoefficients () const
 Number of local polynomial coefficients in each piece.
 
const T evaluate (const T &src) const
 Evaluate piecewise polynomial.
 
void evaluate (const T *pSrc, T *pDst, int count) const
 Evaluate piecewise polynomial.
 

Related Functions

(Note that these are not member functions.)

BLO_EXPIMP_TEMPLATE template class BLO_API PiecewisePolynomial< double >
 
BLO_EXPIMP_TEMPLATE template class BLO_API PiecewisePolynomial< float >
 

Detailed Description

template<typename T>
class blo::PiecewisePolynomial< T >

Piecewise polynomial.

Template Parameters
TData type.

Constructor & Destructor Documentation

◆ PiecewisePolynomial() [1/5]

template<typename T >
blo::PiecewisePolynomial< T >::PiecewisePolynomial ( )

Default constructor.

◆ PiecewisePolynomial() [2/5]

template<typename T >
blo::PiecewisePolynomial< T >::PiecewisePolynomial ( int  pieces,
int  numLocalCoefficients 
)

Constructs piecewise polynomial of specified size.

Parameters
piecesNumber of pieces.
numLocalCoefficientsNumber of local polynomial coefficients in each piece.

◆ PiecewisePolynomial() [3/5]

template<typename T >
blo::PiecewisePolynomial< T >::PiecewisePolynomial ( const T *  pBreaks,
const T *  pCoeffs,
int  coeffsStride1,
int  coeffsRows,
int  coeffsColumns 
)

Constructs piecewise polynomial of specified breaks and interval local polynomial coefficients.

Parameters
pBreaksPointer to the 1D array of length coeffsRows + 1 with strictly increasing elements that represent the start and end of each of the coeffsRows  intervals.
pCoeffsPointer to the 2D array with each row containing the coeffsColumns local polynomial coefficients, ordered in descending powers, corresponding to the the i-th interval [breaks[i], breaks[i + 1]].
coeffsStride1Stride in bytes between the elements in the polynomial coefficients 2D array.
coeffsRowsNumber of rows in the polynomial coefficients 2D array.
coeffsColumnsNumber of columns in the polynomial coefficients 2D array.

◆ PiecewisePolynomial() [4/5]

template<typename T >
blo::PiecewisePolynomial< T >::PiecewisePolynomial ( const PiecewisePolynomial< T > &  rhs)

Copy constructor.

◆ PiecewisePolynomial() [5/5]

template<typename T >
blo::PiecewisePolynomial< T >::PiecewisePolynomial ( PiecewisePolynomial< T > &&  rhs)
noexcept

Move constructor.

◆ ~PiecewisePolynomial()

template<typename T >
virtual blo::PiecewisePolynomial< T >::~PiecewisePolynomial ( )
virtual

Destructor.

Member Function Documentation

◆ evaluate() [1/2]

template<typename T >
const T blo::PiecewisePolynomial< T >::evaluate ( const T &  src) const

Evaluate piecewise polynomial.

This function evaluates the piecewise polynomial at a given point.

Parameters
srcPoint to evaluate the piecewise polynomial at.
Returns
The piecewise polynomial evaluation.

◆ evaluate() [2/2]

template<typename T >
void blo::PiecewisePolynomial< T >::evaluate ( const T *  pSrc,
T *  pDst,
int  count 
) const

Evaluate piecewise polynomial.

This function evaluates the piecewise polynomial at given points.

Parameters
pSrcPointer to the source points to evaluate the piecewise polynomial at.
pDstPointer to the destination piecewise polynomial evaluations.
countThe number of points and evaluations.

◆ numLocalCoefficients()

template<typename T >
int blo::PiecewisePolynomial< T >::numLocalCoefficients ( ) const

Number of local polynomial coefficients in each piece.

Returns
Number of local polynomial coefficients in each piece.

◆ operator=() [1/2]

template<typename T >
PiecewisePolynomial & blo::PiecewisePolynomial< T >::operator= ( const PiecewisePolynomial< T > &  rhs)

Copy assignment operator.

◆ operator=() [2/2]

template<typename T >
PiecewisePolynomial & blo::PiecewisePolynomial< T >::operator= ( PiecewisePolynomial< T > &&  rhs)
noexcept

Move assignment operator.

◆ pieces()

template<typename T >
int blo::PiecewisePolynomial< T >::pieces ( ) const

Number of pieces.

Returns
Number of pieces.

◆ ptrBreaks() [1/2]

template<typename T >
T * blo::PiecewisePolynomial< T >::ptrBreaks ( )

Pointer to the piecewise polynomial breaks.

Note
The 1D array must contain strictly increasing elements that represent the start and end of each interval.
Returns
Pointer to the 1D array of length pieces() + 1.

◆ ptrBreaks() [2/2]

template<typename T >
const T * blo::PiecewisePolynomial< T >::ptrBreaks ( ) const

Pointer to the piecewise polynomial breaks.

Note
The 1D array must contain strictly increasing elements that represent the start and end of each interval.
Returns
Pointer to the 1D array of length pieces() + 1.

◆ ptrPieceCoefficients() [1/2]

template<typename T >
T * blo::PiecewisePolynomial< T >::ptrPieceCoefficients ( int  piece)

The piecewise polynomial interval local polynomial coefficients.

Note
The 1D array must contain the local polynomial coefficients, ordered in descending powers, corresponding to the the i-th interval [breaks[i], breaks[i + 1]].
Parameters
pieceThe i-th piece of the piecewise polynomial.
Returns
Pointer to the 1D array of length numLocalCoefficients().

◆ ptrPieceCoefficients() [2/2]

template<typename T >
const T * blo::PiecewisePolynomial< T >::ptrPieceCoefficients ( int  piece) const

The piecewise polynomial interval local polynomial coefficients.

Note
The 1D array must contain the local polynomial coefficients, ordered in descending powers, corresponding to the the i-th interval [breaks[i], breaks[i + 1]].
Parameters
pieceThe i-th piece of the piecewise polynomial.
Returns
Pointer to the 1D array of length numLocalCoefficients().

◆ resize()

template<typename T >
void blo::PiecewisePolynomial< T >::resize ( int  pieces,
int  numLocalCoefficients 
)

Resizes piecewise polynomial.

Parameters
piecesNumber of pieces.
numLocalCoefficientsNumber of local polynomial coefficients in each piece.

◆ set()

template<typename T >
void blo::PiecewisePolynomial< T >::set ( const T *  pBreaks,
const T *  pCoeffs,
int  coeffsStride1,
int  coeffsRows,
int  coeffsColumns 
)

Sets the piecewise polynomial breaks and interval local polynomial coefficients.

Parameters
pBreaksPointer to the 1D array of length coeffsRows + 1 with strictly increasing elements that represent the start and end of each of the coeffsRows  intervals.
pCoeffsPointer to the 2D array with each row containing the coeffsColumns local polynomial coefficients, ordered in descending powers, corresponding to the the i-th interval [breaks[i], breaks[i + 1]].
coeffsStride1Stride in bytes between the elements in the polynomial coefficients 2D array.
coeffsRowsNumber of rows in the polynomial coefficients 2D array.
coeffsColumnsNumber of columns in the polynomial coefficients 2D array.

Friends And Related Function Documentation

◆ PiecewisePolynomial< double >

template<typename T >
BLO_EXPIMP_TEMPLATE template class BLO_API PiecewisePolynomial< double >
related

◆ PiecewisePolynomial< float >

template<typename T >
BLO_EXPIMP_TEMPLATE template class BLO_API PiecewisePolynomial< float >
related

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