From 7a6239e51c844b2822ec30c2602bae7aff85689b Mon Sep 17 00:00:00 2001 From: Mark Wiebe Date: Fri, 27 Jan 2012 23:52:36 -0600 Subject: STY: Add comment and rename monotonic_ functino to be more descriptive --- numpy/lib/src/_compiled_base.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'numpy/lib/src') diff --git a/numpy/lib/src/_compiled_base.c b/numpy/lib/src/_compiled_base.c index f35fa3c75..e4513d512 100644 --- a/numpy/lib/src/_compiled_base.c +++ b/numpy/lib/src/_compiled_base.c @@ -33,8 +33,13 @@ decr_slot_(double x, double * bins, npy_intp lbins) return 0; } +/** + * Returns -1 if the array is monotonic decreasing, + * +1 if the array is monotonic increasing, + * and 0 if the array is not monotonic. + */ static int -monotonic_(double * a, int lena) +check_array_monotonic(double * a, int lena) { int i; @@ -265,7 +270,7 @@ arr_digitize(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds) } } else { - m = monotonic_ (dbins, lbins); + m = check_array_monotonic(dbins, lbins); if ( m == -1 ) { for ( i = 0; i < lx; i ++ ) { iret [i] = decr_slot_ ((double)dx[i], dbins, lbins); -- cgit v1.2.1