# The NumPy Fortran-ordering quiz

Charles R Harris charlesr.harris at gmail.com
Wed Oct 18 15:51:12 CDT 2006

Travis,

On 10/18/06, Travis Oliphant <oliphant.travis at ieee.org> wrote:
>
> Tim Hochberg wrote:
> > One thing that may be confusing the issue is that, as I understand it,
> > FORTRAN and CONTIGUOUS together represent three states which I'll call
> > FORTRAN_ORDER, C_ORDER and DISCONTIGUOUS.
>
> Yep,  that's what they mean.  CONTIGUOUS is the name Numeric gave it and
> it meant C-order contiguous.  We have kept the same meaning.  All we've
> done is selected out from the class of arrays that Numeric called
> DISTCONTIGUOUS, arrays that are FORTRAN-order (and so still
> single-segment), but discontiguous in the sense that Numeric had.
>
> > I periodically wonder if it
> > would be valuable to have a way to query the order directly: the result
> > would be "C", "F" or None, just like the order keyword that is passed
> > in.
> You an do it with the flags
>
> a.flags.contiguous
> a.flags.fortran
>
> Discontiguous is when both of these are false.  Note that for a.ndim <
> 2, both a.flags.contiguous and a.flags.fortran are true if one of them
> is true.
>
> This is all explained in the first chapters of my book.  You have to
> understand CONTIGUOUS == C-order contiguous and FORTRAN == Fortran-order
> contiguous.

Could we make a few changes ;)

For printing the flags I would suggest using C-Contiguous and F-Contiguous
so folks don't have to read the book. And at the c level define alternates,
i.e, #define c-contiguous contiguous or whatever. That way backward
compatibility would be maintained but more descriptive names would be
available.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20061018/94ddf58e/attachment.html
-------------- next part --------------
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
-------------- next part --------------
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion