Function vector_find_level (o2scl)

O2scl : Function List

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 and y, finding all points in x which have the property \( \mathrm{level} = y(x) \). All points for which this relation holds are put into the vector locs. The previous information contained in vector locs 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/or y[n-1] is equal to level, then x[0] and/or x[n-1] are added to locs, respectively.