#include <interp.h>
This interpolation class is intended to be sufficiently general to handle any vector type. Interpolation of ovector like objects is performed with the default template parameters, and array_interp_vec is provided for simple interpolation on C-style arrays.
The class automatically handles decreasing arrays by copying the old array to a reversed version. For several interpolations on the same data, copying the initial array can be faster than overloading operator[].
The type of interpolation to be performed can be specified using the set_type() function. The default is cubic splines with natural boundary conditions.
It is important that different instances of o2scl_interp_vec and o2scl_interp not be given the same interpolation objects, as they will clash.
ln
to zero. Definition at line 1238 of file interp.h.
Public Member Functions | |
o2scl_interp_vec (base_interp< vec_t > &it, size_t n, const vec_t &x, const vec_t &y) | |
Create with base interpolation object it . | |
virtual double | interp (const double x0) |
Give the value of the function ![]() | |
virtual double | deriv (const double x0) |
Give the value of the derivative ![]() | |
virtual double | deriv2 (const double x0) |
Give the value of the second derivative ![]() | |
virtual double | integ (const double x1, const double x2) |
Give the value of the integral ![]() | |
int | set_type (base_interp< vec_t > &it) |
Set base interpolation object. | |
Data Fields | |
cspline_interp< vec_t > | def_itp |
Default base interpolation object (cubic spline with natural boundary conditions). | |
Protected Attributes | |
alloc_t | ao |
Memory allocator for objects of type alloc_vec_t . | |
base_interp< vec_t > * | itp |
Pointer to base interpolation object. | |
bool | inc |
True if the original array was increasing. | |
const vec_t * | lx |
Pointer to the user-specified x vector. | |
const vec_t * | ly |
Pointer to the user-specified x vector. | |
alloc_vec_t | lrx |
Reversed version of x. | |
alloc_vec_t | lry |
Reversed version of y. | |
size_t | ln |
Size of user-specified vectors. |
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page