#include <interpolation.h>
Represent a cubic spline interpolation.
Definition at line 252 of file interpolation.h.
Public Member Functions | |
InterpolateDataSpline (const std::vector< double > &x, const std::vector< double > &y) | |
Interpolate function f given discrete samples f(x_i) = y_i. More... | |
~InterpolateDataSpline () | |
Destructor. More... | |
double | operator() (double x) const |
Calculate spline interpolation at x. More... | |
Private Attributes | |
double | first_x_ |
First x value. More... | |
double | last_x_ |
Last x value. More... | |
double | first_y_ |
First y value. More... | |
double | last_y_ |
Last y value. More... | |
gsl_interp_accel * | acc_ |
GSL iterator for interpolation lookups. More... | |
gsl_spline * | spline_ |
GSL spline. More... | |
smash::InterpolateDataSpline::InterpolateDataSpline | ( | const std::vector< double > & | x, |
const std::vector< double > & | y | ||
) |
Interpolate function f given discrete samples f(x_i) = y_i.
x | x-values. |
y | y-values. |
Cubic spline interpolation is used. Values outside the given samples will use the outmost sample as a constant extrapolation.
Definition at line 14 of file interpolation.cc.
smash::InterpolateDataSpline::~InterpolateDataSpline | ( | ) |
Destructor.
Definition at line 40 of file interpolation.cc.
double smash::InterpolateDataSpline::operator() | ( | double | x | ) | const |
Calculate spline interpolation at x.
x | Interpolation argument. |
Definition at line 45 of file interpolation.cc.
|
private |
First x value.
Definition at line 281 of file interpolation.h.
|
private |
Last x value.
Definition at line 283 of file interpolation.h.
|
private |
First y value.
Definition at line 285 of file interpolation.h.
|
private |
Last y value.
Definition at line 287 of file interpolation.h.
|
private |
GSL iterator for interpolation lookups.
Definition at line 289 of file interpolation.h.
|
private |
GSL spline.
Definition at line 291 of file interpolation.h.