BSplinebasis
|
The central Spline class of the library. More...
#include <Spline.h>
Public Types | |
using | data_type = T |
The data type T of the spline. | |
Public Member Functions | |
Spline (Support< T > support, std::vector< std::array< T, ARRAY_SIZE > > coefficients) | |
Constructor setting the data. Performs sanity checks. | |
Spline (Grid< T > grid) | |
Constructs an empty spline on the global grid. | |
const Support< T > & | getSupport () const noexcept |
Returns the spline's support. | |
const std::vector< std::array< T, ARRAY_SIZE > > & | getCoefficients () const noexcept |
The spline's polynomial coefficients. | |
T | operator() (const T &x) const |
Evaluates the spline at point x. | |
const T & | front () const |
Returns the begin of the spline's support. | |
const T & | back () const |
Returns the end of the spline's support. | |
template<size_t order2> | |
bool | checkOverlap (const Spline< T, order2 > &m2) const |
Checks whether the supports of the two splines overlap. | |
bool | isZero () const |
Checks whether this spline is a zero over the whole number line. | |
Spline< T, order > | operator/ (const T &d) const |
Scalar-division operator. | |
Spline< T, order > | operator* (const T &d) const |
Scalar-multiplication operator. | |
Spline< T, order > & | operator*= (const T &d) |
In-place scalar-multiplication operator. | |
Spline< T, order > & | operator/= (const T &d) |
In-place scalar-division operator. | |
Spline< T, order > | operator- () const |
Unary minus operator. | |
template<size_t ordera> | |
Spline< T, order > & | operator= (const Spline< T, ordera > &a) |
Copy assign operator. | |
template<size_t ordera> | |
Spline< T, order+ordera > | operator* (const Spline< T, ordera > &a) const |
Spline-spline multiplication operator. | |
template<size_t ordera> | |
Spline< T, std::max(order, ordera)> | operator+ (const Spline< T, ordera > &a) const |
Spline addition operator. | |
template<size_t ordera> | |
Spline< T, order > & | operator+= (const Spline< T, ordera > &a) |
In-place addition operator. | |
template<size_t ordera> | |
Spline< T, order > & | operator-= (const Spline< T, ordera > &a) |
Binary in-place subtraction operator. | |
template<size_t ordera> | |
Spline< T, std::max(order, ordera)> | operator- (const Spline< T, ordera > &a) const |
Binary subtraction operator. | |
bool | operator== (const Spline &other) const |
Compares two splines for equality. | |
bool | operator!= (const Spline &other) const |
Compares two splines for inequality. | |
Static Public Attributes | |
static constexpr size_t | spline_order = order |
The order of the spline. | |
The central Spline class of the library.
Spline class representing spline of datatype T and order order. The coefficients of the spline are defined with respect to the center point xm of each interval.
T | Datatype of the spline. |
order | Order of the spline. |
|
inline |
Constructor setting the data. Performs sanity checks.
support | The spline's support. |
coefficients | Polynomial coefficients of the spline on each interval. |
|
inlineexplicit |
Constructs an empty spline on the global grid.
grid | The global grid. |
Returns the end of the spline's support.
Returns the end of the support of this spline. If the spline is empty, an exception is thrown.
BSplineException | If the spline's support is empty. |
|
inline |
Checks whether the supports of the two splines overlap.
m2 | Other spline against which to check. |
order2 | Order of spline m2. |
Returns the begin of the spline's support.
Returns the beginning of the support of this spline. If the spline is empty, an exception is thrown.
BSplineException | If the spline's support is empty. |
|
inlinenoexcept |
The spline's polynomial coefficients.
Returns the polynomial coefficients of the spline for each interval.
Returns the spline's support.
Checks whether this spline is a zero over the whole number line.
Checks whether this spline returns zero for all x. Can be the case, either if the support contains no intervals (i.e. the vector intervals is empty) or if all coefficients are zero.
Compares two splines for inequality.
other | The spline to compare this spline to. |
Evaluates the spline at point x.
x | Point at which to evaluate the spline. If x is outside of the support of the spline, zero is returned. |
|
inline |
Spline-spline multiplication operator.
Spline-spline multiplication operator. Returns a spline of order order + ordera.
a | Spline to be multiplied with this spline. |
ordera | Order of spline a. |
BSplineException | If the two splines are defined on different grids. |
Scalar-multiplication operator.
Scalar-multiplication operator. Multiplies this spline with the scalar d.
d | Scalar by which to multiply this spline. |
In-place scalar-multiplication operator.
In-place scalar-multiplication operator. Multiplies this spline with the scalar d in-place.
d | Scalar by which to multiply this spline. |
|
inline |
In-place addition operator.
In-place addition operator. Adds spline a to this spline. The operation is only well defined if the order of spline a is lower than or equal to the order of this spline object.
a | Spline to be added. |
ordera | Order of spline a. |
BSplineException | If the two splines are defined on different grids. |
Unary minus operator.
|
inline |
Binary subtraction operator.
Binary subtraction operator. Subtracts spline a from this spline.
a | Spline to be subtracted. |
ordera | Order of spline a. |
BSplineException | If the two splines are defined on different grids. |
|
inline |
Binary in-place subtraction operator.
Binary in-place subtraction operator. Subtracts spline a from this spline. The operation is only well defined if the order of the spline to be subtracted is lower than or equal to the order of this spline object.
a | Spline to be subtracted. |
ordera | Order of spline a. |
BSplineException | If the two splines are defined on different grids. |
Scalar-division operator.
Scalar-division operator. Divides this spline by the scalar d.
d | Scalar by which to divide this spline. |
In-place scalar-division operator.
In-place scalar-division operator. Divides this spline by the scalar d in-place.
d | Scalar by which to divide this spline. |
|
inline |
Copy assign operator.
Copy assign of spline to this spline object. The operation is only well defined if the order of the spline to be assigned is lower than or equal to the order of this spline object.
a | Spline to be assigned. |
ordera | Order of spline a. |
Compares two splines for equality.
other | The spline to compare this spline to. |