Class interp_cspline (o2scl)

O2scl : Class List

template<class vec_t, class vec2_t = vec_t, class fp_t = double>
class interp_cspline : public o2scl::interp_base<vec_t, vec_t, double>

Cubic spline interpolation (GSL)

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

By default, this class uses natural boundary conditions, where the second derivative vanishes at each end point. Extrapolation effectively assumes that the second derivative is linear outside of the endpoints.

Subclassed by o2scl::interp_cspline_peri< vec_t, vec2_t, fp_t >

Storage for cubic spline interpolation

ubvector c
ubvector g
ubvector diag
ubvector offdiag
o2scl_linalg::ubvector_4_mem<fp_t> p4m

Memory for the tridiagonalization.

inline void coeff_calc(const ubvector &c_array, fp_t dy, fp_t dx, size_t index, fp_t &b, fp_t &c2, fp_t &d) const

Compute coefficients for cubic spline interpolation.

inline interp_cspline()

Create a base interpolation object with natural or periodic boundary conditions.

inline virtual ~interp_cspline()
inline virtual void set(size_t size, const vec_t &xa, const vec2_t &ya)

Initialize interpolation routine.

inline virtual fp_t eval(fp_t x0) const

Give the value of the function \( y(x=x_0) \) .

inline virtual fp_t deriv(fp_t x0) const

Give the value of the derivative \( y^{\prime}(x=x_0) \) .

inline virtual fp_t deriv2(fp_t x0) const

Give the value of the second derivative \( y^{\prime \prime}(x=x_0) \) .

inline virtual fp_t integ(fp_t a, fp_t b) const

Give the value of the integral \( \int_a^{b}y(x)~dx \) .

inline virtual const char *type() const

Return the type, "interp_cspline".

interp_cspline(const interp_cspline<vec_t, vec2_t, fp_t>&)
interp_cspline<vec_t, vec2_t, fp_t> &operator=(const interp_cspline<vec_t, vec2_t, fp_t>&)

Public Types

typedef boost::numeric::ublas::vector<fp_t> ubvector
typedef boost::numeric::ublas::vector_slice<ubvector> ubvector_slice
typedef boost::numeric::ublas::vector_range<ubvector> ubvector_range
typedef boost::numeric::ublas::slice slice
typedef boost::numeric::ublas::range range