[PYTHON MATRIX-SIG] linear algebra

Jim Hugunin hugunin@mit.edu
Mon, 19 Aug 1996 12:50:14 -0400

Konrad HINSEN wrote:
> > All of the current interface routines (from LinAlg.py) do the following:
> >
> > return transpose(lapackfunction(transpose(input_matrix)))
> >
> > Should these two transpositions be there?  This is obviously related to
> > the different index order between NumPy and FORTRAN.  Still, I've always
> > personally considered it a superficial difference that is best ignored.
> >
> > If I remember by Linear Algebra correctly
> > transpose(inverse(transpose(m))) == inverse(m).
> True for inversion, but for little else, except in the special case of
> symmetric matrices.
> Personally I think it is important to work with the "right" index
> order that everyone is used to. Python users should not have to know
> anything about implementation details.
> Besides, if I understand everything correctly, transposition should
> cost almost nothing, right?

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.

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.


MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org