Class interp (o2scl)

O2scl : Class List

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

Interpolation class for general vectors.

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

Interpolation of ublas vector like objects is performed with the default template parameters, and interp_array 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.

Public Functions

inline interp(size_t interp_type = itp_cspline)

Create with base interpolation object it.

inline virtual ~interp()
inline virtual double eval(const double x0, size_t n, const vec_t &x, const vec2_t &y)

Give the value of the function, \( y(x=x_0) \) , as specified as the first n elements of vectors x and y.

inline virtual double deriv(const double x0, size_t n, const vec_t &x, const vec2_t &y)

Give the value of the derivative, \( y^{\prime}(x=x_0) \) , where \( y(x) \) is specified in the first n elements of vectors x and y.

inline virtual double deriv2(const double x0, size_t n, const vec_t &x, const vec2_t &y)

Give the value of the second derivative, \( y^{\prime\prime}(x=x_0) \) , where \( y(x) \) is specified in the first n elements of vectors x and y.

inline virtual double integ(const double x1, const double x2, size_t n, const vec_t &x, const vec2_t &y)

Give the value of the integral \( \int_a^{b}y(x)~dx \) , where \( y(x) \) is specified in the first n elements of vectors x and y.

inline void set_type(size_t interp_type)

Set base interpolation type.

Protected Attributes

interp_base<vec_t, vec2_t> *itp

Pointer to base interpolation object.

Private Functions

interp(const interp<vec_t, vec2_t>&)
interp<vec_t, vec2_t> &operator=(const interp<vec_t, vec2_t>&)