0.2.0
|
Cubic Spline class. More...
Classes | |
struct | BoundaryCondition |
Boundary conditions for the spline end-points. More... | |
Public Member Functions | |
CubicSpline ()=default | |
Default Constructor. | |
CubicSpline (const std::vector< Scalar > &X, const std::vector< Scalar > &Y, BoundaryCondition leftBoundaryCondition={ BoundaryCondition::SecondDerivative, 0.0 }, BoundaryCondition rightBoundaryCondition={ BoundaryCondition::SecondDerivative, 0.0 }) | |
Constructor. | |
Scalar | derivative (size_t order, Scalar x) const |
Calculates the derivative of the spline. | |
Scalar | operator() (Scalar x) const |
Interpolates or extrapolates a value on the spline. | |
void | setBoundaries (BoundaryCondition leftBoundaryCondition, BoundaryCondition rightBoundaryCondition) |
Set the boundaries conditions. Has to be called before setPoints. | |
void | setPoints (const std::vector< Scalar > &x, const std::vector< Scalar > &y) |
Set the points/knots of the spline and calculate the spline coefficients. | |
size_t | size () const noexcept |
Returns the size of the spline vector. | |
Cubic Spline class.
|
inline |
Constructor.
[in] | X | List of x coordinates for the spline points/knots |
[in] | Y | List of y coordinates for the spline points/knots |
[in] | leftBoundaryCondition | Boundary condition for the start knot |
[in] | rightBoundaryCondition | Boundary condition for the end knot |
|
inline |
Calculates the derivative of the spline.
[in] | order | Order of the derivative to calculate (<= 3) |
[in] | x | X coordinate to calculate the derivative for |
|
inline |
Interpolates or extrapolates a value on the spline.
[in] | x | X coordinate to inter-/extrapolate the value for |
|
inline |
Set the boundaries conditions. Has to be called before setPoints.
[in] | leftBoundaryCondition | Boundary condition for the start knot |
[in] | rightBoundaryCondition | Boundary condition for the end knot |
|
inline |
Set the points/knots of the spline and calculate the spline coefficients.
[in] | x | List of x coordinates of the points |
[in] | y | List of y coordinates of the points |