BSplinebasis
Loading...
Searching...
No Matches
Classes | Enumerations | Functions
bspline::interpolation Namespace Reference

Code to interpolate data using the bspline::Spline. More...

Classes

struct  Boundary
 A boundary condition. More...
 

Enumerations

enum class  Node { FIRST , LAST }
 Node marker for boundary conditions. More...
 

Functions

template<typename T , size_t order, class Solver >
bspline::Spline< T, orderinterpolate (Support< T > x, const std::vector< T > &y, const std::array< Boundary< T >, order - 1 > &boundaries=internal::defaultBoundaries< T, order >())
 Interpolation using generic Solver.
 
template<size_t order>
bspline::Spline< double, orderinterpolateUsingArmadillo (Support< double > x, const std::vector< double > &y, const std::array< Boundary< double >, order - 1 > &boundaries=internal::defaultBoundaries< double, order >())
 Interpolation using armadillo Solver.
 
template<typename T , size_t order>
bspline::Spline< T, orderinterpolateUsingEigen (Support< T > x, const std::vector< T > &y, const std::array< Boundary< T >, order - 1 > &boundaries=internal::defaultBoundaries< T, order >())
 Interpolation using eigen solver.
 

Detailed Description

Code to interpolate data using the bspline::Spline.

Enumeration Type Documentation

◆ Node

Node marker for boundary conditions.

Represents either the first or last node of the interpolation grid. Used to define boundary conditions.

Function Documentation

◆ interpolate()

template<typename T , size_t order, class Solver >
bspline::Spline< T, order > bspline::interpolation::interpolate ( Support< T x,
const std::vector< T > &  y,
const std::array< Boundary< T >, order - 1 > &  boundaries = internal::defaultBoundaries<Torder>() 
)

Interpolation using generic Solver.

Interpolates the data given by x and y with a spline of order order. order-1 additional conditions are needed for a well defined problem. These can be supplied by fixing derivatives on the first and last node.

Parameters
xData on the abscissa.
yData on the ordinate.
boundariesBoundary conditions.
Template Parameters
TDatatype of the spline and data.
orderOrder of the spline.
SolverClass Wrapping the linear algebra routines.
Exceptions
BSplineExceptionIf the number of values on the abscissa and ordinate differ.
BSplineExceptionIf less than two data points are provided.
Returns
The spline interpolating the input data.

◆ interpolateUsingArmadillo()

template<size_t order>
bspline::Spline< double, order > bspline::interpolation::interpolateUsingArmadillo ( Support< double x,
const std::vector< double > &  y,
const std::array< Boundary< double >, order - 1 > &  boundaries = internal::defaultBoundaries<doubleorder>() 
)

Interpolation using armadillo Solver.

Wrapper method around interpolate() using armadillo for the linear algebra routines. Supports only double precision. This method will only be activated if the macro BSPLINE_INTERPOLATION_USE_ARMADILLO is defined.

Parameters
xData on the abscissa. The grid points must be in (steadily) increasing order.
yData on the ordinate.
boundariesBoundary conditions.
Template Parameters
orderOrder of the spline.
Exceptions
BSplineExceptionIf the number of values on the abscissa and ordinate differ.
BSplineExceptionIf less than two data points are provided.
Returns
The spline interpolating the input data.

◆ interpolateUsingEigen()

template<typename T , size_t order>
bspline::Spline< T, order > bspline::interpolation::interpolateUsingEigen ( Support< T x,
const std::vector< T > &  y,
const std::array< Boundary< T >, order - 1 > &  boundaries = internal::defaultBoundaries<Torder>() 
)

Interpolation using eigen solver.

Wrapper method around interpolate() using eigen for the linear algebra routines. This method will only be activated if the macro BSPLINE_INTERPOLATION_USE_EIGEN is defined.

Parameters
xData on the abscissa. The grid points must be in (steadily) increasing order.
yData on the ordinate.
boundariesBoundary conditions.
Template Parameters
TDatatype of the spline and data.
orderOrder of the spline.
Exceptions
BSplineExceptionIf the number of values on the abscissa and ordinate differ.
BSplineExceptionIf less than two data points are provided.
Returns
The spline interpolating the input data.