Cubic Spline class.
More...
|
class | BandMatrix |
| Sparse matrix whose non-zero entries are confined to a diagonal band, comprising the main diagonal and zero or more diagonals on either side. More...
|
|
struct | BoundaryCondition |
| Boundary conditions for the spline end-points. More...
|
|
|
size_t | findClosestIdx (Scalar x) const |
| Finds the closest index so that vals_x[idx] <= x (return 0 if x < vals_x[0])
|
|
template<typename Scalar>
class NAV::CubicSpline< Scalar >
Cubic Spline class.
Definition at line 34 of file CubicSpline.hpp.
◆ CubicSpline() [1/2]
template<typename Scalar>
◆ CubicSpline() [2/2]
template<typename Scalar>
Constructor.
- Parameters
-
[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 |
Definition at line 59 of file CubicSpline.hpp.
◆ derivative()
template<typename Scalar>
Calculates the derivative of the spline.
- Parameters
-
[in] | order | Order of the derivative to calculate (<= 3) |
[in] | x | X coordinate to calculate the derivative for |
- Returns
- The derivative of y up to the given order
Definition at line 205 of file CubicSpline.hpp.
◆ findClosestIdx()
template<typename Scalar>
Finds the closest index so that vals_x[idx] <= x (return 0 if x < vals_x[0])
- Parameters
-
[in] | x | X coordinate to search the closest knot to |
- Returns
- Index of a knot closest to the x coordinate given
Definition at line 265 of file CubicSpline.hpp.
◆ operator()()
template<typename Scalar>
Interpolates or extrapolates a value on the spline.
- Parameters
-
[in] | x | X coordinate to inter-/extrapolate the value for |
- Returns
- The y coordinate
Definition at line 182 of file CubicSpline.hpp.
◆ setBoundaries()
template<typename Scalar>
Set the boundaries conditions. Has to be called before setPoints.
- Parameters
-
[in] | leftBoundaryCondition | Boundary condition for the start knot |
[in] | rightBoundaryCondition | Boundary condition for the end knot |
Definition at line 70 of file CubicSpline.hpp.
◆ setPoints()
template<typename Scalar>
void NAV::CubicSpline< Scalar >::setPoints |
( |
const std::vector< Scalar > & | x, |
|
|
const std::vector< Scalar > & | y ) |
|
inline |
Set the points/knots of the spline and calculate the spline coefficients.
- Parameters
-
[in] | x | List of x coordinates of the points |
[in] | y | List of y coordinates of the points |
Definition at line 79 of file CubicSpline.hpp.
◆ size()
template<typename Scalar>
◆ boundaryConditionLeft
template<typename Scalar>
◆ boundaryConditionRight
template<typename Scalar>
◆ coef_b
template<typename Scalar>
◆ coef_c
template<typename Scalar>
◆ coef_c0
template<typename Scalar>
Spline coefficient c0 for left extrapolation.
Definition at line 257 of file CubicSpline.hpp.
◆ coef_d
template<typename Scalar>
◆ vals_x
template<typename Scalar>
◆ vals_y
template<typename Scalar>
The documentation for this class was generated from the following file: