smart_interp_vec Class Template Reference

#include <smart_interp.h>


Detailed Description

template<class vec_t, class svec_t, class alloc_vec_t, class alloc_t>
class smart_interp_vec< vec_t, svec_t, alloc_vec_t, alloc_t >

Smart interpolation class with pre-specified vectors.

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 654 of file smart_interp.h.


Public Member Functions

 smart_interp_vec (size_t n, const vec_t &x, const vec_t &y)
 Create with base interpolation objects it and rit.
 smart_interp_vec (base_interp< vec_t > &it1, base_interp< svec_t > &it2, size_t n, const vec_t &x, const vec_t &y)
 Create with base interpolation objects it and rit.
virtual ~smart_interp_vec ()
virtual double interp (const double x0)
 Give the value of the function $ y(x=x_0) $ .
virtual double deriv (const double x0)
 Give the value of the derivative $ y^{prime}(x=x_0) $ .
virtual double deriv2 (const double x0)
 Give the value of the second derivative $ y^{prime \prime}(x=x_0) $ .
virtual double integ (const double x1, const double x2)
 Give the value of the integral $ \int_a^{b}y(x)~dx $ .

Data Fields

cspline_interp< vec_t > cit1
 Default base interpolation object.
cspline_interp< svec_t > cit2
 Default base interpolation object.

Protected Member Functions

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

Protected Attributes

svec_t * sx
 Storage for internally created subvector.
svec_t * sy
 Storage for internally created subvector.
base_interp< vec_t > * rit1
 Pointer to base interpolation object.
base_interp< svec_t > * rit2
 Pointer to base interpolation object.
alloc_t ao
 Memory allocator for objects of type alloc_vec_t.
bool inc
 True if the user-specified x vector is increasing.
const vec_t * lx
 Pointer to user-specified vector.
const vec_t * ly
 Pointer to user-specified vector.
alloc_vec_t lrx
 Reversed version of vector.
alloc_vec_t lry
 Reversed version of vector.
size_t ln
 Size of user-specifed vector.

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.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page