SplineFitter provides routines for performing cubic spline interpolation.
More...
#include <SplineFitter.h>
|
static void | createNaturalSpline (const std::vector< double > &x, const std::vector< double > &y, std::vector< double > &deriv) |
| Fit a natural cubic spline to a set of data points. More...
|
|
static void | createPeriodicSpline (const std::vector< double > &x, const std::vector< double > &y, std::vector< double > &deriv) |
| Fit a periodic cubic spline to a set of data points. More...
|
|
static double | evaluateSpline (const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &deriv, double t) |
| Evaluate a spline generated by one of the other methods in this class. More...
|
|
static double | evaluateSplineDerivative (const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &deriv, double t) |
| Evaluate the derivative of a spline generated by one of the other methods in this class. More...
|
|
SplineFitter provides routines for performing cubic spline interpolation.
static void createNaturalSpline |
( |
const std::vector< double > & |
x, |
|
|
const std::vector< double > & |
y, |
|
|
std::vector< double > & |
deriv |
|
) |
| |
|
static |
Fit a natural cubic spline to a set of data points.
The resulting spline interpolates all the data points, has a continuous second derivative everywhere, and has a second derivative of 0 at its end points.
- Parameters
-
x | the values of the independent variable at the data points to interpolate. They must be strictly increasing: x[i] > x[i-1]. |
y | the values of the dependent variable at the data points to interpolate |
deriv | on exit, this contains the second derivative of the spline at each of the data points |
static void createPeriodicSpline |
( |
const std::vector< double > & |
x, |
|
|
const std::vector< double > & |
y, |
|
|
std::vector< double > & |
deriv |
|
) |
| |
|
static |
Fit a periodic cubic spline to a set of data points.
The resulting spline interpolates all the data points, has a continuous second derivative everywhere, and has identical second derivatives at the end points.
- Parameters
-
x | the values of the independent variable at the data points to interpolate. They must be strictly increasing: x[i] > x[i-1]. |
y | the values of the dependent variable at the data points to interpolate. The first and last entries must be identical. |
deriv | on exit, this contains the second derivative of the spline at each of the data points |
static double evaluateSpline |
( |
const std::vector< double > & |
x, |
|
|
const std::vector< double > & |
y, |
|
|
const std::vector< double > & |
deriv, |
|
|
double |
t |
|
) |
| |
|
static |
Evaluate a spline generated by one of the other methods in this class.
- Parameters
-
x | the values of the independent variable at the data points to interpolate |
y | the values of the dependent variable at the data points to interpolate |
deriv | the vector of second derivatives that was calculated by one of the other methods |
t | the value of the independent variable at which to evaluate the spline |
- Returns
- the value of the spline at the specified point
static double evaluateSplineDerivative |
( |
const std::vector< double > & |
x, |
|
|
const std::vector< double > & |
y, |
|
|
const std::vector< double > & |
deriv, |
|
|
double |
t |
|
) |
| |
|
static |
Evaluate the derivative of a spline generated by one of the other methods in this class.
- Parameters
-
x | the values of the independent variable at the data points to interpolate |
y | the values of the dependent variable at the data points to interpolate |
deriv | the vector of second derivatives that was calculated by one of the other methods |
t | the value of the independent variable at which to evaluate the spline |
- Returns
- the value of the spline's derivative at the specified point
The documentation for this class was generated from the following file: