Class interp_base (o2scl)¶
-
template<class
vec_t
, classvec2_t
= vec_t>
classo2scl
::
interp_base
¶ Base low-level interpolation class [abstract base].
See also the Interpolation section of the O2scl User’s guide.
To interpolate a set vectors
x
andy
, call set() and then the interpolation functions eval(), deriv(), deriv2() and integ(). If thex
andy
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.Public Functions
-
interp_base
()¶
-
~interp_base
()¶
-
double
eval
(double x0) const = 0¶ Give the value of the function \( y(x=x_0) \)
-
double
operator()
(double x0) const¶ Give the value of the function \( y(x=x_0) \) .
-
double
deriv
(double x0) const = 0¶ Give the value of the derivative \( y^{\prime}(x=x_0) \) .
-
double
deriv2
(double x0) const = 0¶ Give the value of the second derivative \( y^{\prime \prime}(x=x_0) \) .
-
double
integ
(double a, double b) const = 0¶ Give the value of the integral \( \int_a^{b}y(x)~dx \) .
-
const char *
type
() const = 0¶ Return the type.
Public Members
-
size_t
min_size
¶ The minimum size of the vectors to interpolate between.
This variable must be set in the constructor of the children for access by the class user.
Protected 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.
This pointer is set to zero in the constructor and should be non-zero only if it has been allocated with
new
.
-
size_t
sz
¶ Vector size.
Private Functions
-
interp_base
(const interp_base<vec_t, vec2_t>&)¶
-
interp_base<vec_t, vec2_t> &
operator=
(const interp_base<vec_t, vec2_t>&)¶
-