Public Member Functions | Protected Attributes | Private Member Functions | List of all members
o2scl::interp_vec< vec_t, vec2_t > Class Template Reference

Interpolation class for pre-specified vector. More...

#include <interp.h>

Inheritance diagram for o2scl::interp_vec< vec_t, vec2_t >:
o2scl::interp_base< vec_t, vec2_t >

Public Member Functions

 interp_vec ()
 Blank interpolator.
 
 interp_vec (size_t n, const vec_t &x, const vec2_t &y, size_t interp_type=itp_cspline)
 Create with base interpolation object it.
 
void set (size_t n, const vec_t &x, const vec2_t &y)
 Set a new vector to interpolate.
 
void set (size_t n, const vec_t &x, const vec2_t &y, size_t interp_type)
 Set a new vector to interpolate.
 
void clear ()
 Manually clear the pointer to the user-specified vector.
 
virtual double eval (const double x0) const
 Give the value of the function $ y(x=x_0) $ .
 
virtual double operator() (double x0) const
 Give the value of the function $ y(x=x_0) $ .
 
virtual double deriv (const double x0) const
 Give the value of the derivative $ y^{\prime}(x=x_0) $ .
 
virtual double deriv2 (const double x0) const
 Give the value of the second derivative $ y^{\prime \prime}(x=x_0) $ .
 
virtual double integ (const double x1, const double x2) const
 Give the value of the integral $ \int_a^{b}y(x)~dx $ .
 
virtual const char * type () const
 Return the type, "interp_vec".
 

Protected Attributes

interp_base< vec_t, vec2_t > * itp
 Base interpolation object.
 
size_t itype
 Interpolation type.
 
- Protected Attributes inherited from o2scl::interp_base< vec_t, vec2_t >
search_vec< const vec_t > svx
 To perform binary searches. More...
 
const vec_t * px
 Independent vector.
 
const vec2_t * py
 Dependent vector.
 
size_t sz
 Vector size.
 

Private Member Functions

 interp_vec (const interp_vec< vec_t, vec2_t > &it)
 
interp_vec< vec_t, vec2_t > & operator= (const interp_vec< vec_t, vec2_t > &it)
 

Additional Inherited Members

- Public Attributes inherited from o2scl::interp_base< vec_t, vec2_t >
size_t min_size
 The minimum size of the vectors to interpolate between. More...
 
- Protected Member Functions inherited from o2scl::interp_base< vec_t, vec2_t >
double integ_eval (double ai, double bi, double ci, double di, double xi, double a, double b) const
 An internal function to assist in computing the integral for both the cspline and Akima types.
 

Detailed Description

template<class vec_t = boost::numeric::ublas::vector<double>, class vec2_t = vec_t>
class o2scl::interp_vec< vec_t, vec2_t >

See also the Interpolation section of the O2scl User's guide.

This interpolation class is intended to be sufficiently general to handle any vector type. Interpolation of ublas vector like objects is performed with the default template parameters.

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.

Idea for Future:
Make version which copies vectors rather than storing pointers might be better and then has copy constructors.

Definition at line 1685 of file interp.h.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).