The NumPy Fortran-ordering quiz

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


On 10/18/06, Travis Oliphant <oliphant.travis at> 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
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
-------------- 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
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
-------------- next part --------------
Numpy-discussion mailing list
Numpy-discussion at

More information about the Numpy-discussion mailing list