Functions rebin_xy¶
-
template<class
vec_t
, classvec2_t
, classvec3_t
, classvec4_t
>
voido2scl
::
rebin_xy
(const vec_t &x, const vec2_t &y, vec3_t &x_out, vec4_t &y_out, size_t n_pts, size_t interp_type)¶ From a pair of vectors, \( (x,y) \) create a new pair of vectors, \( (x_{\mathrm{out}},y_{\mathrm{out}}) \) where \( x_{\mathrm{out}} \) is uniformly-spaced.
This function uses interpolation (method determined by interp_type) to create new vectors
x_out
andy_out
which will be resized using theresize()
method to ensure they are of sizen_pts
. This function creates an object of type o2scl::interp_vec to do the interpolation.This function is used in linear_or_log_chi2() .
- Note
The two vectors, x and y, must have the same size, as reported by their
size()
method.- Note
In order to use interpolation, the input vector
x
must be either increasing or decreasing.
-
template<class
vec_t
, classvec2_t
, classvec3_t
, classvec4_t
>
into2scl
::
rebin_xy
(const vec_t &x, const vec2_t &y, vec3_t &x_out, vec4_t &y_out, size_t n_pts, size_t interp_type1, size_t interp_type2, double acc = 1.0e-4)¶ From a pair of vectors, \( (x,y) \) create a new pair of vectors, \( (x_{\mathrm{out}},y_{\mathrm{out}}) \) where \( x_{\mathrm{out}} \) is uniformly-spaced.
This function rebins the vectors
x
andy
twice, with two different interpolation types, and then compares the accuracy of the result to the user-specified valueacc
.- Note
Experimental
- Todo:
I’m not sure what the purpose of this function was originally.