24 #include "StMessMgr.h"
27 int Locate(
const int npt,
const float* x,
const float xx)
36 int rising = (x[npt-1] > x[0]) ? (1) : (0) ;
38 if ( (rising && (xx > x[jup] || xx < x[jlow])) ||
39 (!rising && (xx < x[jup] || xx > x[jlow])) ) {
40 LOG_WARN <<
"Locate(): xx is out of range!" << endm;
45 jmid = (jlow + jup)/2;
47 if ( (rising && (xx > x[jmid])) ||
48 (!rising && (xx < x[jmid])) ) {