[pypy-commit] pypy numpy-multidim: leave a comment

fijal noreply at buildbot.pypy.org
Thu Nov 24 15:52:13 CET 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numpy-multidim
Changeset: r49732:dc3ff57935ac
Date: 2011-11-24 16:51 +0200
http://bitbucket.org/pypy/pypy/changeset/dc3ff57935ac/

Log:	leave a comment

diff --git a/pypy/module/micronumpy/interp_numarray.py b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -137,6 +137,15 @@
 
 # Iterators for arrays
 # --------------------
+# all those iterators with the exception of BroadcastIterator iterate over the
+# entire array in C order (the last index changes the fastest). This will
+# yield all elements. Views iterate over indices and look towards strides and
+# backstrides to find the correct position. Notably the offset between
+# x[..., i + 1] and x[..., i] will be strides[-1]. Offset between
+# x[..., k + 1, 0] and x[..., k, i_max] will be backstrides[-2] etc.
+
+# BroadcastIterator works like that, but for indexes that don't change source
+# in the original array, strides[i] == backstrides[i] == 0
 
 class BaseIterator(object):
     def next(self, shapelen):


More information about the pypy-commit mailing list