summaryrefslogtreecommitdiff
path: root/numpy/lib/src
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2012-01-27 23:52:36 -0600
committerMark Wiebe <mwwiebe@gmail.com>2012-01-27 23:52:36 -0600
commit7a6239e51c844b2822ec30c2602bae7aff85689b (patch)
treee948274dd1657fc26b2ebad2e29f7802e759f9ab /numpy/lib/src
parent3a86a97eb728a12c562578ea6e1f99c5f9b45620 (diff)
downloadnumpy-7a6239e51c844b2822ec30c2602bae7aff85689b.tar.gz
STY: Add comment and rename monotonic_ functino to be more descriptive
Diffstat (limited to 'numpy/lib/src')
-rw-r--r--numpy/lib/src/_compiled_base.c9
1 files changed, 7 insertions, 2 deletions
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);