From: George N. <gn...@go...> - 2006-10-18 22:21:21
|
On 18/10/06, Charles R Harris <cha...@gm...> wrote: > > > On 10/18/06, George Nurser <gn...@go...> wrote: > > > > None of the LaPack stuff seems to use the Fortran stuff, they just > > > > transpose and copy. > > > > You've got me worried here. I have assumed that when you start with a > > c-contiguous array, a, with say, a.shape = (m,n), if you use the > > transpose as an argument to a fortran routine which requires an mxn > > size array, then no copying is required. > > > > This seems to work for me -- the transpose *does* have fortran order. > > Nope. The result is an (n,m) array in fortran order, not an (m,n) array in > fortran order. Presumably that's because it's a view of the original array. >> > Also, in f2py, if I use -DF2PY_REPORT_ON_ARRAY_COPY=1 I receive no > > alert of any copy. > > f2py takes care of the ordering, which is one reason why it is so useful. Yes, when I first used it, I assumed that the fortran routine had to use an nxm array. But f2py is clever enough to make the above work. George. |