Classes | Namespaces | Enumerations | Functions
interp.h File Reference

One-dimensional interpolation classes and interpolation types. More...

#include <iostream>
#include <string>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/vector_proxy.hpp>
#include <o2scl/search_vec.h>
#include <o2scl/tridiag.h>
#include <o2scl/vector.h>

Go to the source code of this file.

Classes

class  o2scl::interp_base< vec_t, vec2_t >
 Base low-level interpolation class [abstract base]. More...
 
class  o2scl::interp_linear< vec_t, vec2_t >
 Linear interpolation (GSL) More...
 
class  o2scl::interp_nearest_neigh< vec_t, vec2_t >
 Nearest-neighbor interpolation. More...
 
class  o2scl::interp_cspline< vec_t, vec2_t >
 Cubic spline interpolation (GSL) More...
 
class  o2scl::interp_cspline_peri< vec_t, vec2_t >
 Cubic spline interpolation with periodic boundary conditions (GSL) More...
 
class  o2scl::interp_akima< vec_t, vec2_t >
 Akima spline interpolation (GSL) More...
 
class  o2scl::interp_akima_peri< vec_t, vec2_t >
 Akima spline interpolation with periodic boundary conditions (GSL) More...
 
class  o2scl::interp_steffen< vec_t, vec2_t >
 Steffen's monotonicity-preserving interpolation. More...
 
class  o2scl::interp_monotonic< vec_t, vec2_t >
 Monotonicity-preserving interpolation. More...
 
class  o2scl::interp< vec_t, vec2_t >
 Interpolation class for general vectors. More...
 
class  o2scl::interp_vec< vec_t, vec2_t >
 Interpolation class for pre-specified vector. More...
 
class  o2scl::interp_array< n >
 A specialization of interp for C-style double arrays. More...
 
class  o2scl::interp_array_vec< arr_t >
 A specialization of o2scl::interp_vec for C-style arrays. More...
 

Namespaces

 o2scl
 The main O2scl namespace.
 

Enumerations

enum  {
  o2scl::itp_linear =1, o2scl::itp_cspline =2, o2scl::itp_cspline_peri =3, o2scl::itp_akima =4,
  o2scl::itp_akima_peri =5, o2scl::itp_monotonic =6, o2scl::itp_steffen =7, o2scl::itp_nearest_neigh =8
}
 Interpolation types. More...
 

Functions

template<class vec_t , class vec2_t >
size_t o2scl::vector_level_count (double level, size_t n, vec_t &x, vec2_t &y)
 Count level crossings. More...
 
template<class vec_t , class vec2_t >
void o2scl::vector_find_level (double level, size_t n, vec_t &x, vec2_t &y, std::vector< double > &locs)
 Perform inverse linear interpolation. More...
 
template<class ovec_t , class vec2_t >
void o2scl::vector_deriv_interp (size_t n, ovec_t &v, vec2_t &dv, size_t interp_type=itp_linear)
 Compute derivative at all points from an interpolation object.
 
template<class ovec_t , class vec2_t >
void o2scl::vector_deriv2_interp (size_t n, ovec_t &v, vec2_t &dv, size_t interp_type=itp_linear)
 Compute second derivative at all points from an interpolation object.
 
template<class vec_t , class vec2_t , class vec3_t >
void o2scl::vector_deriv_xy_interp (size_t n, vec_t &vx, vec2_t &vy, vec3_t &dv, size_t interp_type=itp_linear)
 Compute derivative at all points from an interpolation object.
 
template<class vec_t , class vec2_t , class vec3_t >
void o2scl::vector_deriv2_xy_interp (size_t n, vec_t &vx, vec2_t &vy, vec3_t &dv, size_t interp_type=itp_linear)
 Compute second derivative at all points from an interpolation object.
 
template<class ovec_t >
double o2scl::vector_integ_interp (size_t n, ovec_t &v, size_t interp_type)
 Integral of a vector from interpolation object.
 
template<class vec_t , class vec2_t >
double o2scl::vector_integ_xy_interp (size_t n, const vec_t &x, const vec2_t &y, size_t interp_type=itp_linear)
 Compute the integral over y(x) using interpolation. More...
 
template<class vec_t , class vec2_t , class vec3_t >
void o2scl::vector_integ_xy_interp (size_t n, const vec_t &x, const vec2_t &y, vec3_t &iy, size_t interp_type=itp_linear)
 Compute integral over y(x) and store result in a vector using interpolation.
 
template<class ovec_t >
double o2scl::vector_integ_ul_interp (size_t n, double x2, ovec_t &v, size_t interp_type)
 Compute the integral of a vector using interpolation up to a specified upper limit.
 
template<class vec_t , class vec2_t >
double o2scl::vector_integ_ul_xy_interp (size_t n, const vec_t &x, const vec2_t &y, double x2, size_t interp_type=itp_linear)
 Compute the integral over y(x) using interpolation up to a specified upper limit.
 
template<class vec_t , class vec2_t >
int o2scl::vector_invert_enclosed_sum (double sum, size_t n, vec_t &x, vec2_t &y, double &lev, int boundaries=0, int verbose=0, bool err_on_fail=true)
 Compute the endpoints which enclose the regions whose integral is equal to sum. More...
 
template<class vec_t , class vec2_t >
int o2scl::vector_region_int (size_t n, vec_t &x, vec2_t &y, double intl, std::vector< double > &locs, int boundaries=0, int verbose=0, bool err_on_fail=true)
 Find the region enclosing an integral.
 
template<class vec_t , class vec2_t >
int o2scl::vector_region_fracint (size_t n, vec_t &x, vec2_t &y, double frac, std::vector< double > &locs, int boundaries=0, int verbose=0, bool err_on_fail=true)
 Find the region enclosing a partial integral.
 
template<class vec_t , class vec2_t >
int o2scl::vector_bound_fracint (size_t n, vec_t &x, vec2_t &y, double frac, double &low, double &high, int boundaries=0, int verbose=0, bool err_on_fail=true)
 Find the boundaries of the region enclosing a integral. More...
 
template<class vec_t , class vec2_t >
int o2scl::vector_bound_int (size_t n, vec_t &x, vec2_t &y, double frac, double &low, double &high, int boundaries=0, int verbose=0, bool err_on_fail=true)
 Find the boundaries of the region enclosing a integral. More...
 
template<class vec_t , class vec2_t , class vec3_t , class vec4_t >
void o2scl::rebin_xy (const vec_t &x, const vec2_t &y, vec3_t &new_x, vec4_t &new_y, size_t n_pts, size_t interp_type)
 From an (x,y) pair, create a new (x,y) pair using interpolation where the new x vector is uniformly spaced.
 
template<class vec_t , class vec2_t , class vec3_t , class vec4_t >
int o2scl::rebin_xy (const vec_t &x, const vec2_t &y, vec3_t &new_x, vec4_t &new_y, size_t n_pts, size_t interp_type1, size_t interp_type2, double acc=1.0e-4)
 From an (x,y) pair, create a new (x,y) pair using interpolation where the new x vector is uniformly spaced and test accuracy.
 
template<class vec_t , class vec2_t >
double o2scl::linear_or_log_chi2 (const vec_t &x, const vec2_t &y)
 Rebin, rescale, sort, and match to $ y=x $. More...
 
template<class vec_t , class vec2_t >
void o2scl::linear_or_log (vec_t &x, vec2_t &y, bool &log_x, bool &log_y)
 Attempt to determine if data represented by (x,y) would be better plotted on a semi-log or log-log plot. More...
 
template<class vec_t >
void o2scl::linear_or_log (vec_t &y, bool &log_y)
 Attempt to determine if data stored in y would be better plotted on a semi-log or log-log plot. More...
 

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).