#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[].
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.
ln
to zero.Definition at line 1389 of file interp.h.
Public Member Functions | |
o2scl_interp_vec (base_interp_mgr< 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. | |
Protected Attributes | |
alloc_t | ao |
Memory allocator for objects of type alloc_vec_t . | |
base_interp< vec_t > * | itp |
Base interpolation object. | |
base_interp_mgr< vec_t > * | bim |
The interpolation manager. | |
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. | |
Private Member Functions | |
o2scl_interp_vec (const o2scl_interp_vec< vec_t, alloc_vec_t, alloc_t > &) | |
o2scl_interp_vec< vec_t, alloc_vec_t, alloc_t > & | operator= (const o2scl_interp_vec< vec_t, alloc_vec_t, alloc_t > &) |
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