
/* determines whether to optimize for linear ranges  */
#define LINEAR_OPT 1

static int find (const size_t n, const double range[], 
                 const double x, size_t * i);

static int
find2d (const size_t nx, const double xrange[],
        const size_t ny, const double yrange[],
        const double x, const double y,
        size_t * i, size_t * j);


