BinarySearch

The BinarySearch routines return the index to an array (x) of the element immediately before the input test value (y). They assume that the array is in ascending order. The version with multiple test values also assumes that the test values are in ascending order. If the y value is less than the minimum of the x array then -1 is returned while if the y value is greater than the maximum of the x array then -2 is returned.

  int BinarySearch(const RealArray& x, const Real& y)
  IntegerVector BinarySearch(const RealArray& x, const RealArray& y)

If y is less than the first values of x then -1 is returned. If y is greater than the last value of x then -2 is returned.




HEASARC Home | Observatories | Archive | Calibration | Software | Tools | Students/Teachers/Public

Last modified: Wednesday, 23-Mar-2022 17:16:50 EDT

HEASARC Home | Observatories | Archive | Calibration | Software | Tools | Students/Teachers/Public

Last modified: 23-Mar-2022