[PYTHON MATRIX-SIG] linear algebra
Konrad HINSEN
hinsenk@ere.umontreal.ca
Mon, 19 Aug 1996 13:18:05 -0400
> Transposition costs almost nothing. Transposition followed by a copy is
> O(n). These FORTRAN routines expect contiguous arrays, which requires
> the transposed array to be copied before calling them. Therefore this
> is a non-trivial amount of computation.
Fortran routines rarely require contiguous arrays, and LAPACK routines
definitely don't. It's just a matter of correct interfacing, but
this would have to be done at the C level, since on the Python level
the necessary data about the memory layout is no longer available.
The current low-level LAPACK interface expects Fortran-layout
arrays, but one could as well have one that handles the "transposition"
itself, although that would be a more difficult task. So maybe we
should leave everything as it is for now and improve the interface
later.
> I agree that python users should not have to know anything about
> implementation details. I'm just wondering why the transposed order is
> more natural than the native one.
No more natural, but conventional.
Konrad.
-------------------------------------------------------------------------------
Konrad Hinsen | E-Mail: hinsenk@ere.umontreal.ca
Departement de chimie | Tel.: +1-514-343-6111 ext. 3953
Universite de Montreal | Fax: +1-514-343-7586
C.P. 6128, succ. Centre-Ville | Deutsch/Esperanto/English/Nederlands/
Montreal (QC) H3C 3J7 | Francais (phase experimentale)
-------------------------------------------------------------------------------
=================
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================