|
SpECTRE
v2026.06.30
|
A cubic B-spline interpolant of uniformly spaced samples. More...
#include <UniformCardinalBSpline.hpp>
Public Member Functions | |
| UniformCardinalBSpline (std::vector< double > values, double start_time, double time_step) | |
| Construct from uniformly spaced samples. | |
| double | operator() (double time) const |
| Evaluate the interpolant at time, clamped to the bounds() | |
| const std::vector< double > & | values () const |
| The sampled function values. | |
| double | start_time () const |
| The time of the first sample. | |
| double | time_step () const |
| The spacing between samples. | |
| std::array< double, 2 > | bounds () const |
| The first and last sample time. | |
| void | pup (PUP::er &p) |
A cubic B-spline interpolant of uniformly spaced samples.
Interpolates samples \(f_i = f(t_0 + i \Delta t)\), \(i = 0, \ldots, N-1\), with a cubic B-spline. The interpolation error decreases as \(\mathcal{O}(\Delta t^4)\) for smooth data. This class wraps boost::math::interpolators::cardinal_cubic_b_spline and adds:
Here is an example how to use this class:
| intrp::UniformCardinalBSpline::UniformCardinalBSpline | ( | std::vector< double > | values, |
| double | start_time, | ||
| double | time_step ) |
Construct from uniformly spaced samples.
| values | The sampled function values \(f(t_0 + i \Delta t)\). At least 5 samples are required. |
| start_time | The time \(t_0\) of the first sample. |
| time_step | The (positive) spacing \(\Delta t\) between samples. |