The NumPy Fortran-ordering quiz

Travis Oliphant oliphant.travis at ieee.org
Wed Oct 18 13:33:49 CDT 2006


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.


-Travis




-------------------------------------------------------------------------
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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the Numpy-discussion mailing list