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
xandy, finding all points inxwhich have the property \( \mathrm{level} = y(x) \). All points for which this relation holds are put into the vectorlocs. The previous information contained in vectorlocsbefore 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
nis 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.