libmoost
|
Generate a spline interpolation of X and Y data points using the GNU Scientific Library. More...
#include <spline_interpolation.hpp>
Public Member Functions | |
spline_interpolation (std::vector< double > const &x, std::vector< double > const &y) | |
create a spline interpolation object | |
bool | operator() (double const x, double &y, double const z=0) const |
Given a value of X return Y (or Z if X is out of range) | |
double | operator() (double const x) const |
Given a value of X return Y (or throw if out of range) | |
Private Types | |
typedef moost::utils::scope_exit::type < gsl_interp * > ::call_free_function_with_val | interp_t |
typedef moost::utils::scope_exit::type < gsl_interp_accel * > ::call_free_function_with_val | accel_t |
Private Member Functions | |
void | validate_construction () const |
Private Attributes | |
interp_t | interp_ |
accel_t | accel_ |
std::vector< double > const & | x_ |
std::vector< double > const & | y_ |
Generate a spline interpolation of X and Y data points using the GNU Scientific Library.
http://www.gnu.org/software/gsl/manual/html_node/Interpolation.html
Definition at line 60 of file spline_interpolation.hpp.
typedef moost::utils::scope_exit::type< gsl_interp_accel *>::call_free_function_with_val moost::algorithm::spline_interpolation::accel_t [private] |
Definition at line 67 of file spline_interpolation.hpp.
typedef moost::utils::scope_exit::type< gsl_interp *>::call_free_function_with_val moost::algorithm::spline_interpolation::interp_t [private] |
Definition at line 64 of file spline_interpolation.hpp.
moost::algorithm::spline_interpolation::spline_interpolation | ( | std::vector< double > const & | x, |
std::vector< double > const & | y | ||
) | [inline] |
create a spline interpolation object
x | : A vector of X data points |
y | : A vector of Y data points |
Given a vector of X/Y data points, this class will interpolate a value of Y for any value of X providing the value of X is given within the range of X_begin to X_end.
Definition at line 85 of file spline_interpolation.hpp.
bool moost::algorithm::spline_interpolation::operator() | ( | double const | x, |
double & | y, | ||
double const | z = 0 |
||
) | const [inline] |
Given a value of X return Y (or Z if X is out of range)
x | An X data point |
y | An interpolated Y data point |
z | Used as the default if X is out of range |
Definition at line 113 of file spline_interpolation.hpp.
double moost::algorithm::spline_interpolation::operator() | ( | double const | x | ) | const [inline] |
Given a value of X return Y (or throw if out of range)
x | An X data point |
Definition at line 137 of file spline_interpolation.hpp.
void moost::algorithm::spline_interpolation::validate_construction | ( | ) | const [inline, private] |
Definition at line 151 of file spline_interpolation.hpp.
Definition at line 171 of file spline_interpolation.hpp.
Definition at line 170 of file spline_interpolation.hpp.
std::vector<double> const& moost::algorithm::spline_interpolation::x_ [private] |
Definition at line 172 of file spline_interpolation.hpp.
std::vector<double> const& moost::algorithm::spline_interpolation::y_ [private] |
Definition at line 173 of file spline_interpolation.hpp.