[Numpy-discussion] C vs. Fortran order -- misleading documentation?
Charles R Harris
Tue Jun 8 06:48:21 CDT 2010
On Mon, Jun 7, 2010 at 5:52 AM, Pavel Bazant <MaxPlanck@seznam.cz> wrote:
> Correct me if I am wrong, but the paragraph
> Note to those used to IDL or Fortran memory order as it relates to
> indexing. Numpy uses C-order indexing. That means that the last index
> usually (see xxx for exceptions) represents the most rapidly changing memory
> location, unlike Fortran or IDL, where the first index represents the most
> rapidly changing location in memory. This difference represents a great
> potential for confusion.
> is quite misleading, as C-order means that the last index changes rapidly,
> not the
> memory location.
Any index can change rapidly, depending on whether is in an inner loop or
not. The important distinction between C and Fortran order is how indices
translate to memory locations. The documentation seems correct to me,
although it might make more sense to say the last index addresses a
contiguous range of memory. Of course, with modern processors, actual
physical memory can be mapped all over the place.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion