From: Charles R H. <cha...@gm...> - 2006-10-18 20:51:14
|
Travis, On 10/18/06, Travis Oliphant <oli...@ie...> 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 |