smart_interp Class Template Reference

#include <smart_interp.h>


Detailed Description

template<class vec_t = ovector_view, class rvec_t = ovector_const_reverse, class svec_t = ovector_const_subvector, class srvec_t = ovector_const_subvector_reverse>
class smart_interp< vec_t, rvec_t, svec_t, srvec_t >

Smart interpolation class.

This class can semi-intelligently handle arrays which are not-well formed outside the interpolation region. In particular, if an initial interpolation or derivative calculation fails, the arrays are searched for the largest neighborhood around the point x for which an interpolation or differentiation will likely produce a finite result.

Definition at line 46 of file smart_interp.h.


Public Member Functions

 smart_interp (base_interp< vec_t > &it1, base_interp< rvec_t > &it2, base_interp< svec_t > &it3, base_interp< srvec_t > &it4)
 smart_interp ()
virtual ~smart_interp ()
virtual double interp (const double x0, size_t n, const vec_t &x, const vec_t &y)
 Give the value of the function $ y(x=x_0) $ .
virtual double deriv (const double x0, size_t n, const vec_t &x, const vec_t &y)
 Give the value of the derivative $ y^{prime}(x=x_0) $ .
virtual double deriv2 (const double x0, size_t n, const vec_t &x, const vec_t &y)
 Give the value of the second derivative $ y^{prime \prime}(x=x_0) $ .
virtual double integ (const double a, const double b, size_t n, const vec_t &x, const vec_t &y)
 Give the value of the integral $ \int_a^{b}y(x)~dx $ .

Data Fields

Default interpolation objects
cspline_interp< vec_t > cit1
cspline_interp< rvec_t > cit2
cspline_interp< svec_t > cit3
cspline_interp< srvec_t > cit4

Protected Member Functions

size_t local_lookup (size_t n, const vec_t &x, double x0)
 A lookup function for generic vectors.
int find_subset (const double a, const double b, size_t sz, const vec_t &x, const vec_t &y, size_t &nsz, bool &increasing)
 Try to find the largest monotonic and finite region around the desired location.

Protected Attributes

Storage internally created subvectors
const svec_t * sx
const svec_t * sy
const srvec_t * srx
const srvec_t * sry
Pointers to interpolation objects
base_interp< vec_t > * rit1
base_interp< rvec_t > * rit2
base_interp< svec_t > * rit3
base_interp< srvec_t > * rit4

Member Function Documentation

int find_subset ( const double  a,
const double  b,
size_t  sz,
const vec_t &  x,
const vec_t &  y,
size_t &  nsz,
bool &  increasing 
) [inline, protected]

Try to find the largest monotonic and finite region around the desired location.

Todo:
After row and row2 are set, check to make sure the entire inside region is monotonic before expanding

Definition at line 563 of file smart_interp.h.


The documentation for this class was generated from the following file:
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.