Next: 2D Histogram Statistics, Previous: Updating and accessing 2D histogram elements, Up: Histograms
The following functions are used by the access and update routines to locate the bin which corresponds to a given (x,y) coordinate.
This function finds and sets the indices i and j to the to the bin which covers the coordinates (x,y). The bin is located using a binary search. The search includes an optimization for histograms with uniform ranges, and will return the correct bin immediately in this case. If (x,y) is found then the function sets the indices (i,j) and returns
GSL_SUCCESS
. If (x,y) lies outside the valid range of the histogram then the function returnsGSL_EDOM
and the error handler is invoked.