Function vector_find_level (o2scl)¶
-
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.
This function performs inverse linear interpolation of the data defined by
x
andy
, finding all points inx
which have the property \( \mathrm{level} = y(x) \). All points for which this relation holds are put into the vectorlocs
. The previous information contained in vectorlocs
before the function call is destroyed.This is the 1-dimensional analog of finding contour levels as the contour class does for 2 dimensions.
This function will call the error handler if
n
is less than two.This function is inclusive of the endpoints, so that if either
y[0]
and/ory[n-1]
is equal to level, thenx[0]
and/orx[n-1]
are added tolocs
, respectively.