o2scl_interp Class Template Reference

Interpolation class. More...

#include <interp.h>

Inheritance diagram for o2scl_interp:

array_interp

Detailed Description

template<class vec_t = ovector_const_view, class rvec_t = ovector_const_reverse>
class o2scl_interp< vec_t, rvec_t >

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 is provided for simple interpolation on C-style arrays.

The type of interpolation to be performed can be specified using the set_type() function or in the constructor. The default is cubic splines with natural boundary conditions.

The class automatically handles decreasing arrays by converting from an object of type vec_t to an object of type rvec_t.

While vec_t may be any vector type which allows indexing via [], rvec_t must be a vector type which allows indexing and has a constructor with one of the two forms

      rvec_t::rvec_t(vec_t &v);
      rvec_t::rvec_t(vec_t v);
      
so that o2scl_interp can automatically "reverse" a vector if necessary.

Definition at line 1113 of file interp.h.


Public Member Functions

 o2scl_interp (base_interp_mgr< vec_t > &it, base_interp_mgr< rvec_t > &rit)
 Create with base interpolation objects it and rit.
 o2scl_interp ()
 Create an interpolator using the default cubic spline interpolation.
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 x1, const double x2, size_t n, const vec_t &x, const vec_t &y)
 Give the value of the integral $ \int_a^{b}y(x)~dx $ .
int set_type (base_interp_mgr< vec_t > &it, base_interp_mgr< rvec_t > &rit)
 Set base interpolation object.

Data Fields

def_interp_mgr< vec_t,
cspline_interp
dim1
 Default base interpolation object (cubic spline with natural boundary conditions).
def_interp_mgr< rvec_t,
cspline_interp
dim2
 Default base interpolation object for reversed vectors (cubic spline with natural boundary conditions).

Protected Attributes

base_interp< vec_t > * itp
 Pointer to base interpolation object.
base_interp< rvec_t > * ritp
 Pointer to base interpolation object for reversed vectors.
base_interp_mgr< vec_t > * bim1
 Pointer to base interpolation manager.
base_interp_mgr< rvec_t > * bim2
 Pointer to base interpolation manager for reversed vectors.

Private Member Functions

 o2scl_interp (const o2scl_interp< vec_t, rvec_t > &)
o2scl_interp< vec_t, rvec_t > & operator= (const o2scl_interp< vec_t, rvec_t > &)

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