Interpolation class for pre-specified vector. More...
#include <interp.h>
See also the Interpolation section of the O2scl User's guide.
This interpolation class is intended to be sufficiently general to handle any vector type. Interpolation of ublas vector like objects is performed with the default template parameters.
This class does not double check the vector to ensure that all of the intervals for the abcissa are all increasing or all decreasing.
The type of interpolation to be performed can be specified using the set_type() function. The default is cubic splines with natural boundary conditions.
Public Member Functions | |
interp_vec () | |
Blank interpolator. | |
interp_vec (size_t n, const vec_t &x, const vec2_t &y, size_t interp_type=itp_cspline) | |
Create an interpolation object with interpolation type itp_cspline based on the first n entries of vectors x and y . | |
void | set (size_t n, const vec_t &x, const vec2_t &y) |
Modify the interpolation object to operate on the first n entries of vectors x and y . | |
void | set (size_t n, const vec_t &x, const vec2_t &y, size_t interp_type) |
Set a new vector to interpolate. | |
void | clear () |
Manually clear the pointer to the user-specified vector. | |
virtual double | eval (const double x0) const |
Give the value of the function ![]() | |
virtual double | operator() (double x0) const |
Give the value of the function ![]() | |
virtual double | deriv (const double x0) const |
Give the value of the derivative ![]() | |
virtual double | deriv2 (const double x0) const |
Give the value of the second derivative ![]() | |
virtual double | integ (const double x1, const double x2) const |
Give the value of the integral ![]() | |
virtual const char * | type () const |
Return the type, "interp_vec". | |
![]() | |
virtual void | set (size_t size, const boost::numeric::ublas::vector< double > &x, const boost::numeric::ublas::vector< double > &y)=0 |
Initialize interpolation routine. | |
virtual const char * | type () const=0 |
Return the type. | |
Protected Attributes | |
interp_base< vec_t, vec2_t > * | itp |
Base interpolation object. | |
size_t | itype |
Interpolation type. | |
![]() | |
search_vec< const boost::numeric::ublas::vector< double > > | svx |
To perform binary searches. More... | |
const boost::numeric::ublas::vector< double > * | px |
Independent vector. | |
const boost::numeric::ublas::vector< double > * | py |
Dependent vector. | |
size_t | sz |
Vector size. | |
Private Member Functions | |
interp_vec (const interp_vec< vec_t, vec2_t > &it) | |
interp_vec< vec_t, vec2_t > & | operator= (const interp_vec< vec_t, vec2_t > &it) |
Additional Inherited Members | |
![]() | |
size_t | min_size |
The minimum size of the vectors to interpolate between. More... | |
![]() | |
double | integ_eval (double ai, double bi, double ci, double di, double xi, double a, double b) const |
An internal function to assist in computing the integral for both the cspline and Akima types. | |
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).