Function vector_level_count (o2scl)¶
- 
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.
This function counts the number of times the function \( y(x) = \mathrm{level} \) where the function is defined by the vectors
xandy.The value returned is exactly the same as the size of the
locsvector computed by vector_find_level().This function will call the error handler if
nis less than two.If one of the entries in
yis either larger or smaller than its neighbors (i.e. if the function \( y(x) \) has an extremum), and if the value oflevelis exactly equal to the extremum, then this is counted as 1 level crossing. The same applies if either the first or last entry inyis exactly equal tolevel. Finite-precision errors may affect the result of this function whenlevelis nearly equal to one of the value in the vectory.