summaryrefslogtreecommitdiff
path: root/numpy/lib/src
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2011-02-09 21:13:54 -0800
committerCharles Harris <charlesr.harris@gmail.com>2011-02-10 15:46:51 -0700
commitf30000bd09a4886f6d5dd9e1cb0ab437dc6c3f2f (patch)
tree3f76fea5b9454546bcf0afa1e2b7f21b04ba0ed1 /numpy/lib/src
parentbdf25de6bf7327460cfd7a7f6fbab41eb0655f18 (diff)
downloadnumpy-f30000bd09a4886f6d5dd9e1cb0ab437dc6c3f2f.tar.gz
STY: index_tricks: Improve comments and documentation strings
Diffstat (limited to 'numpy/lib/src')
-rw-r--r--numpy/lib/src/_compiled_base.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/numpy/lib/src/_compiled_base.c b/numpy/lib/src/_compiled_base.c
index a7a736254..bca2426e6 100644
--- a/numpy/lib/src/_compiled_base.c
+++ b/numpy/lib/src/_compiled_base.c
@@ -565,6 +565,14 @@ fail:
return NULL;
}
+/*
+ * Converts a Python sequence into 'count' PyArrayObjects
+ *
+ * seq - Input Python object, usually a tuple but any sequence works.
+ * op - Where the arrays are placed.
+ * count - How many arrays there should be (errors if it doesn't match).
+ * paramname - The name of the parameter that produced 'seq'.
+ */
static int sequence_to_arrays(PyObject *seq,
PyArrayObject **op, int count,
char *paramname)
@@ -604,6 +612,7 @@ static int sequence_to_arrays(PyObject *seq,
return 0;
}
+/* Inner loop for unravel_index */
static int
ravel_coords_loop(int ravel_ndim, npy_intp *ravel_dims,
npy_intp *ravel_strides,
@@ -665,6 +674,7 @@ ravel_coords_loop(int ravel_ndim, npy_intp *ravel_dims,
return NPY_SUCCEED;
}
+/* ravel_coords implementation - see add_newdocs.py */
static PyObject *
arr_ravel_coords(PyObject *self, PyObject *args, PyObject *kwds)
{
@@ -802,6 +812,7 @@ fail:
return NULL;
}
+/* C-order inner loop for unravel_index */
static int
unravel_index_loop_corder(int unravel_ndim, npy_intp *unravel_dims,
npy_intp unravel_size, npy_intp count,
@@ -829,6 +840,7 @@ unravel_index_loop_corder(int unravel_ndim, npy_intp *unravel_dims,
return NPY_SUCCEED;
}
+/* Fortran-order inner loop for unravel_index */
static int
unravel_index_loop_forder(int unravel_ndim, npy_intp *unravel_dims,
npy_intp unravel_size, npy_intp count,
@@ -855,6 +867,7 @@ unravel_index_loop_forder(int unravel_ndim, npy_intp *unravel_dims,
return NPY_SUCCEED;
}
+/* unravel_index implementation - see add_newdocs.py */
static PyObject *
arr_unravel_index(PyObject *self, PyObject *args, PyObject *kwds)
{