tfel
Loading...
Searching...
No Matches
tfel::math::CubicSpline< AbscissaType, ValueType > Struct Template Reference

structure in charge of computing the cubic spline of a series of collocation points More...

#include </home/runner/work/tfel/tfel/include/TFEL/Math/CubicSpline.hxx>

Classes

struct  PointComparator
 internal structure to compare collocation points More...

Public Member Functions

template<typename AIterator, typename OIterator>
void setCollocationPoints (AIterator, AIterator, OIterator)
template<typename AContainer, typename OContainer>
void setCollocationPoints (const AContainer &, const OContainer &)
ValueType operator() (const AbscissaType) const
result_type< ValueType, AbscissaType, OpMult > computeIntegral (const AbscissaType, const AbscissaType) const
ValueType computeMeanValue (const AbscissaType, const AbscissaType) const
ValueType getValue (const AbscissaType) const
void getValues (ValueType &, derivative_type< ValueType, AbscissaType > &, const AbscissaType) const
void getValues (ValueType &, derivative_type< ValueType, AbscissaType > &, derivative_type< ValueType, AbscissaType, AbscissaType > &, const AbscissaType) const
const auto & getCollocationPoints () const
 return the collocation points

Protected Types

using Point = CubicSplineCollocationPoint<AbscissaType, ValueType>
 a simple alias

Protected Member Functions

void solveTridiagonalLinearSystem (const AbscissaType *const, AbscissaType *const)
void buildInterpolation ()
 build the spline interpolation

Protected Attributes

std::vector< Point > points
 collocation points

Detailed Description

template<typename AbscissaType, typename ValueType = AbscissaType>
struct tfel::math::CubicSpline< AbscissaType, ValueType >

structure in charge of computing the cubic spline of a series of collocation points

Template Parameters
AbscissaTypefloatting type number used for the computations
ValueTyperesult type

Member Function Documentation

◆ computeIntegral()

template<typename AbscissaType, typename ValueType>
result_type< ValueType, AbscissaType, OpMult > tfel::math::CubicSpline< AbscissaType, ValueType >::computeIntegral ( const AbscissaType xa,
const AbscissaType xb ) const
nodiscard
Returns
the spline integral
Parameters
[in]xabeginning of interval
[in]xbend of interval

◆ computeMeanValue()

template<typename AbscissaType, typename ValueType>
ValueType tfel::math::CubicSpline< AbscissaType, ValueType >::computeMeanValue ( const AbscissaType xa,
const AbscissaType xb ) const
nodiscard
Returns
the spline mean value
Parameters
[in]xabeginning of interval
[in]xbend of interval

◆ getValue()

template<typename AbscissaType, typename ValueType>
ValueType tfel::math::CubicSpline< AbscissaType, ValueType >::getValue ( const AbscissaType x) const
nodiscard
Returns
the spline value at the given point
Parameters
[in]x: point at which the spline is evaluated

◆ getValues() [1/2]

template<typename AbscissaType, typename ValueType>
void tfel::math::CubicSpline< AbscissaType, ValueType >::getValues ( ValueType & f,
derivative_type< ValueType, AbscissaType > & df,
const AbscissaType x ) const
Returns
the value of the spline and the value of its derivative at the given point
Parameters
[out]f: spline value
[out]df: spline derivative value
[in]x: point at which the spline is evaluated

◆ getValues() [2/2]

template<typename AbscissaType, typename ValueType>
void tfel::math::CubicSpline< AbscissaType, ValueType >::getValues ( ValueType & f,
derivative_type< ValueType, AbscissaType > & df,
derivative_type< ValueType, AbscissaType, AbscissaType > & d2f,
const AbscissaType x ) const
Returns
the value of the spline and the value of its derivative at the given point
Parameters
[out]f: spline value
[out]df: spline derivative value
[out]d2f: spline second derivative value
[in]x: point at which the spline is evaluated

◆ operator()()

template<typename AbscissaType, typename ValueType>
ValueType tfel::math::CubicSpline< AbscissaType, ValueType >::operator() ( const AbscissaType x) const
nodiscard
Returns
the spline value at the given point
Parameters
[in]x: point at which the spline is evaluated

◆ setCollocationPoints() [1/2]

template<typename AbscissaType, typename ValueType>
template<typename AIterator, typename OIterator>
void tfel::math::CubicSpline< AbscissaType, ValueType >::setCollocationPoints ( AIterator px,
AIterator pxe,
OIterator py )
Parameters
[in]px: iterator to the first abscissa
[in]pxe: iterator past the last abscissa
[in]py: iterator to the first ordinate

◆ setCollocationPoints() [2/2]

template<typename AbscissaType, typename ValueType>
template<typename AContainer, typename OContainer>
void tfel::math::CubicSpline< AbscissaType, ValueType >::setCollocationPoints ( const AContainer & x,
const OContainer & y )
Parameters
[in]x: abscissa
[in]y: ordinates

◆ solveTridiagonalLinearSystem()

template<typename AbscissaType, typename ValueType>
void tfel::math::CubicSpline< AbscissaType, ValueType >::solveTridiagonalLinearSystem ( const AbscissaType * const c,
AbscissaType * const b )
protected

http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm n - number of equations c - sup-diagonal (means it is the diagonal above the main diagonal) – indexed from 0..n-2 b - the main diagonal x - the answer


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