![]() |
Object-oriented Scientific Computing Library: Version 0.910
|
Base low-level interpolation class [abstract base]. More...
#include <interp.h>
For any pair of vectors x
and y
into which you would like to interpolate, you need to call allocate() and init() first, and then the interpolation functions, and then free(). If the next pair of vectors has the same size, then you need only to call init() before the next call to an interpolation function (you don't need to reallocate). If the x
and y
vectors do not change, then you may call the interpolation functions in succession.
These interpolation class work so long as the vector x
is either monotonically increasing or monotonically decreasing. All of the descendants give identical results to the GSL interpolation routines when the vector is monotonically increasing.
Public Member Functions | |
virtual int | allocate (size_t size) |
Allocate memory, assuming x and y have size size . | |
virtual int | free () |
Free allocated memory. | |
virtual int | init (const vec_t &x, const vec_t &y, size_t size) |
Initialize interpolation routine. | |
virtual int | interp (const vec_t &x, const vec_t &y, size_t size, double x0, double &y0)=0 |
Give the value of the function ![]() | |
virtual int | deriv (const vec_t &x, const vec_t &y, size_t size, double x0, double &dydx)=0 |
Give the value of the derivative ![]() | |
virtual int | deriv2 (const vec_t &x, const vec_t &y, size_t size, double x0, double &d2ydx2)=0 |
Give the value of the second derivative ![]() | |
virtual int | integ (const vec_t &x, const vec_t &y, size_t size, double a, double b, double &result)=0 |
Give the value of the integral ![]() | |
virtual const char * | type () |
Return the type, "base_interp" . | |
Data Fields | |
size_t | min_size |
The minimum size of the vectors to interpolate between. | |
Protected Member Functions | |
double | integ_eval (double ai, double bi, double ci, double di, double xi, double a, double b) |
An internal function to assist in computing the integral for both the cspline and Akima types. | |
Protected Attributes | |
search_vec< vec_t > * | sv |
To perform binary searches. | |
size_t | n_sv |
The size of the allocated search_vec object. | |
bool | mem_alloc |
True if memory has been allocated. | |
Private Member Functions | |
base_interp (const base_interp< vec_t > &) | |
base_interp< vec_t > & | operator= (const base_interp< vec_t > &) |
size_t base_interp< vec_t >::min_size |
Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).