Class interp_vec (o2scl)¶
-
template<class vec_t = boost::numeric::ublas::vector<double>, class vec2_t = vec_t, class fp_t = double>
class interp_vec : public o2scl::interp_base<boost::numeric::ublas::vector<double>, boost::numeric::ublas::vector<double>, double>¶ Interpolation class for pre-specified vector.
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.
Todo
Future: In class interp_vec, make a version which copies vectors rather than storing pointers might be better and then has copy constructors.
Set methods
-
inline void set_type(size_t interp_type = itp_cspline)¶
Set the interpolation type.
Interpolation methods
-
inline virtual fp_t deriv(const fp_t x0) const¶
Give the value of the derivative \( y^{\prime}(x=x_0) \) .
Other methods
-
inline void clear()¶
Clear the base interpolation object and covariance function (if necessary)
-
inline virtual const char *type() const¶
Return the type, “interp_vec”.
-
interp_vec(const interp_vec<vec_t, vec2_t, fp_t> &it)¶
-
interp_vec<vec_t, vec2_t, fp_t> &operator=(const interp_vec<vec_t, vec2_t, fp_t> &it)¶
Public Functions
-
inline interp_vec(size_t interp_type = itp_cspline)¶
Create an interpolation object with interpolation type
interp_type
.
-
inline interp_vec(size_t n, const vec_t &x, const vec2_t &y, size_t interp_type = itp_cspline)¶
Create an interpolation object with interpolation type
interp_type
based on the firstn
entries of vectorsx
andy
.
-
inline virtual ~interp_vec()¶
Free the memory associated with the interpolation object.
Protected Attributes
-
interp_base<vec_t, vec2_t, fp_t> *itp¶
Base interpolation object.
-
size_t itype¶
Interpolation type.
-
covar_funct *cf¶
Covariance function for Gaussian process interpolation.
-
inline void set_type(size_t interp_type = itp_cspline)¶