Stateful 1D interpolation object using GSL.
Constructed from data vectors x and y (interpreted as samples of y(x)). Once constructed, evaluates the interpolated function at arbitrary points via interp() or operator().
Does not extrapolate: returns 0.0 for x outside [x.front(), x.back()].
Copy construction and copy assignment are deleted.
- Note
- x and y are copied into GSL internal storage during construction; the input vectors do not need to outlive the
Interp object.
|
| | Interp (const std::vector< double > &x, const std::vector< double > &y, Method method=Method::cspline) |
| | Construct interpolation object from data points.
|
| |
| | Interp (const Interpolator::Interp &)=delete |
| | Copy construction deleted.
|
| |
| Interp & | operator= (const Interpolator::Interp &)=delete |
| | Copy assignment deleted.
|
| |
| double | interp (double x) const |
| | Returns interpolated y(x). Returns 0.0 if x is outside [x0, xmax].
|
| |
| std::vector< double > | interp (const std::vector< double > &x) const |
| | Returns interpolated y(x) for each point in x. Returns 0.0 outside range.
|
| |
| double | operator() (double x) const |
| | Returns interpolated y(x). Returns 0.0 if x is outside [x0, xmax].
|
| |
| std::vector< double > | operator() (const std::vector< double > &x) const |
| | Returns interpolated y(x) for each point in x. Returns 0.0 outside range.
|
| |