BSplinebasis
Loading...
Searching...
No Matches
Namespaces | Classes | Functions | Variables
bspline Namespace Reference

Main namespace for this library. More...

Namespaces

namespace  exceptions
 Exceptions and error codes.
 
namespace  integration
 Integration routines for Splines.
 
namespace  interpolation
 Code to interpolate data using the bspline::Spline.
 
namespace  operators
 Operator definitions.
 
namespace  support
 Namespace for the Spline's Grid and Support.
 

Classes

class  BSplineGenerator
 Generates the BSplines on a grid. More...
 
class  Spline
 The central Spline class of the library. More...
 

Functions

template<size_t order, typename T >
std::vector< Spline< T, order > > generateBSplines (std::vector< T > knots)
 Convenience method to generate a set of BSplines.
 
template<typename T , size_t ARRAY_SIZE>
 Spline (Support< T > support, std::vector< std::array< T, ARRAY_SIZE > > coefficients) -> Spline< T, ARRAY_SIZE - 1 >
 Deduction guide for spline constructed from array.
 
template<typename T , size_t order>
Spline< T, orderoperator* (const T &d, const Spline< T, order > &b)
 Commutation of spline scalar multiplication operator.
 
template<typename CoeffIter , typename SplineIter >
auto linearCombination (CoeffIter coeffsBegin, CoeffIter coeffsEnd, SplineIter splinesBegin, SplineIter splinesEnd)
 Calculates the linear combination.
 
template<typename CoeffCollection , typename SplineCollection >
auto linearCombination (const CoeffCollection &coeffs, const SplineCollection &splines)
 Calculates the linear combination.
 

Variables

template<typename S >
constexpr bool is_spline_v = is_spline<S>::value
 

Detailed Description

Main namespace for this library.

Function Documentation

◆ generateBSplines()

template<size_t order, typename T >
std::vector< Spline< T, order > > bspline::generateBSplines ( std::vector< T knots)

Convenience method to generate a set of BSplines.

Parameters
knotsThe knots vector to generate the splines from.
Template Parameters
orderThe order of the BSplines to generate.
TThe data type of the knots vector and the generated BSplines.
Exceptions
BSplineExceptionIf the knots vector does not contain enough entries to generate a spline of the requested order.
BSplineExceptionIf the knots are not in increasing order.
Returns
All BSplines of order order defined on the knots vector.

◆ linearCombination() [1/2]

auto bspline::linearCombination ( CoeffIter  coeffsBegin,
CoeffIter  coeffsEnd,
SplineIter  splinesBegin,
SplineIter  splinesEnd 
)

Calculates the linear combination.

Calculates the linear combination of splines. Is more efficient than successive scalar multiplications and spline additions.

Parameters
coeffsBeginThe iterator referencing the first element of the coefficient collection.
coeffsEndThe iterator referencing the end of the coefficient collection.
splinesBeginThe iterator referencing the first element of the spline collection.
splinesEndThe iterator referencing the end of the spline collection.
Template Parameters
CoeffIterAn iterator referencing a coefficient of type T.
SplineIterAn iterator referenchig a spline of type Spline<T, order>.
Returns
The linear combination as a spline of type Spline<T, order>.
Exceptions
BSplineExceptionIf the number of coefficients differs from the number of splines, if the number of coefficients and splines are zero or the grids of all splines are not logically equivalent.

◆ linearCombination() [2/2]

auto bspline::linearCombination ( const CoeffCollection coeffs,
const SplineCollection splines 
)

Calculates the linear combination.

Calculates the linear combination of splines. Is more efficient than successive scalar multiplications and spline additions.

Parameters
coeffsThe coefficient collection.
splinesThe spline collection.
Template Parameters
CoeffCollectionA collection of coefficients of type T. Must provide begin() and end() iterators.
SplineCollectionA collection of splines of type Spline<T, order>. Must provide begin() and end() iterators.
Returns
The linear combination as a spline of type Spline<T, order>.
Exceptions
BSplineExceptionIf the number of coefficients differs from the number of splines, if the number of coefficients and splines are zero or the grids of all splines are not logically equivalent.

◆ operator*()

template<typename T , size_t order>
Spline< T, order > bspline::operator* ( const T d,
const Spline< T, order > &  b 
)
inline

Commutation of spline scalar multiplication operator.

Parameters
dScalar to be multiplied.
bSpline to be multiplied.
Template Parameters
TDatatype of spline and scalar.
orderOrder of the spline.
Returns
A new, scaled spline.

Variable Documentation

◆ is_spline_v

template<typename S >
constexpr bool bspline::is_spline_v = is_spline<S>::value
inlineconstexpr

Indicates whether the type is a spline.

Template Parameters
SThe type to check against the Spline class.