[MATRIX-SIG] LinearAlgebra

Konrad Hinsen hinsen@ibs.ibs.fr
Fri, 20 Feb 1998 19:30:22 +0100


> how did you achieve this optimization of singular_value_decomposition? To
> me, the simplest way seems to be to change the two first arguments passed
> on to the dgesvd/zgesvd routines of lapack_lite from "A" ('compute all
> columns') to "S" ('compute only min(n,m) columns'). If that is the

Right. The array allocations have to be changed as well, and the
array dimensions passed to the LAPACK routine, but that's it.

> approach you have chosen, why not turn this into keyword arguments with a
> default value like this:
> 
> def singular_value_decomposition(a,left='S',right='S')

No problem, but that could again break old code. Or the defaults are
'A', and then hardly anyone will profit.

In practice I'd use logical variables for the optional arguments to
prevent people from passing nonsense, but that's of course a minor
detail.

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                          | E-Mail: hinsen@ibs.ibs.fr
Laboratoire de Dynamique Moleculaire   | Tel.: +33-4.76.88.99.28
Institut de Biologie Structurale       | Fax:  +33-4.76.88.54.94
41, av. des Martyrs                    | Deutsch/Esperanto/English/
38027 Grenoble Cedex 1, France         | Nederlands/Francais
-------------------------------------------------------------------------------

_______________
MATRIX-SIG  - SIG on Matrix Math for Python

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