From: Charles R H. <cha...@gm...> - 2006-10-18 19:10:18
|
On 10/18/06, Tim Hochberg <tim...@ie...> wrote: > > Charles R Harris wrote: > > > > > > On 10/18/06, *Tim Hochberg* <tim...@ie... > > <mailto:tim...@ie...>> wrote: > > > > Charles R Harris wrote: > > > > [SNIP] > > > > > > I'm not talking about the keyword in the ravel call, I'm talking > > about > > > the flag in a. The question is: do we *need* a fortran flag. I am > > > argueing not, because the only need is for fortran contiguous > > arrays > > > to pass to fortran function, or translation from fortran > contiguous > > > arrays to numpy arrays. What I am saying is that things are > > > unnecessarily complicated. None of the LaPack stuff seems to use > > the > > > Fortran stuff, they just transpose and copy. I don't even think > > I want > > > to change that, because it is *clear* what is going on. > > Interfacing to > > > fortran is all about memory layout, nothing more or less. > > > > > > > Chuck, > > > > There are two things here. One is the order keyword and one is the > > FORTRAN flag. The latter is mainly an optimization for use at the > > C-level so that one doesn't have to check whether a given array is > in > > contiguous FORTRAN order by examining the strides, in the same way > > that > > the CONTIGUOUS flag allows you to skip examining the strides when > you > > need a contiguous C-order matrix. > > > > > > That sounds like the two flags should be named f-contiguous and > > c-contiguous. Then they would be orthogonal and one could have all > > four combinations. Is that the case now? Perhaps I am misunderstanding > > the meaning of the flags. > That is the case now. The flag names simply mirror their values in C. > Why they have those names in something of a historical accident I > believe. Take a look at this: OK, that is good. I no longer have any objection to the flags, I just wish the names were more descriptive of what they mean. In fact, it looks like the following sort of construction will be useful in the linalg module. In [17]:a = array([[1,2],[3,4]], dtype=int) In [18]:b = array(a, dtype=double, order='f') In [19]:b.flags Out[19]: CONTIGUOUS : False FORTRAN : True OWNDATA : True WRITEABLE : True ALIGNED : True UPDATEIFCOPY : False I've been a pain in the a** because I really want to know what is going on down in the boiler room. Chuck |