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

Base low-level interpolation class [abstract base]. More...

#include <interp.h>

Inheritance diagram for o2scl::interp_base< vec_t, vec2_t >:
o2scl::interp_akima< vec_t, vec2_t > o2scl::interp_cspline< vec_t, vec2_t > o2scl::interp_linear< vec_t, vec2_t > o2scl::interp_monotonic< vec_t, vec2_t > o2scl::interp_steffen< vec_t, vec2_t > o2scl::interp_vec< vec_t, vec2_t > o2scl::interp_akima_peri< vec_t, vec2_t > o2scl::interp_cspline_peri< vec_t, vec2_t >

Public Member Functions

virtual void set (size_t size, const vec_t &x, const vec2_t &y)=0
 Initialize interpolation routine.
 
virtual double eval (double x0) const =0
 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 (double x0) const =0
 Give the value of the derivative $ y^{\prime}(x=x_0) $ .
 
virtual double deriv2 (double x0) const =0
 Give the value of the second derivative $ y^{\prime \prime}(x=x_0) $ .
 
virtual double integ (double a, double b) const =0
 Give the value of the integral $ \int_a^{b}y(x)~dx $ .
 
virtual const char * type () const =0
 Return the type.
 

Public Attributes

size_t min_size
 The minimum size of the vectors to interpolate between. More...
 

Protected Member Functions

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.
 

Protected Attributes

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_base (const interp_base< vec_t, vec2_t > &)
 
interp_base< vec_t, vec2_t > & operator= (const interp_base< vec_t, vec2_t > &)
 

Detailed Description

template<class vec_t, class vec2_t = vec_t>
class o2scl::interp_base< vec_t, vec2_t >

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

To interpolate a set vectors x and y, call set() and then the interpolation functions eval(), deriv(), deriv2() and integ(). If the x and y vectors do not change, then you may call the interpolation functions multiple times in succession. These classes do not copy the user-specified vectors but store pointers to them. Thus, if the vector is changed without a new call to interp_base::set(), the behavior of the interpolation functions is undefined.

Definition at line 104 of file interp.h.

Member Data Documentation

◆ min_size

template<class vec_t, class vec2_t = vec_t>
size_t o2scl::interp_base< vec_t, vec2_t >::min_size

This variable must be set in the constructor of the children for access by the class user.

Definition at line 162 of file interp.h.

◆ svx

template<class vec_t, class vec2_t = vec_t>
search_vec<const vec_t> o2scl::interp_base< vec_t, vec2_t >::svx
protected

This pointer is set to zero in the constructor and should be non-zero only if it has been allocated with new.

Definition at line 119 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).