[SciPy-User] RZ Factorization

Sturla Molden sturla.molden at gmail.com
Thu Sep 4 09:15:15 EDT 2014


Pauli Virtanen <pav at iki.fi> wrote:

> In this case, both adding the relevant f2py wrappers, and a high-level
> rz() function to scipy.linalg seems quite justified. 

What about LQ? The justification is to solve least squares problems when
the input is p x n instead of n x p, or then the input it n x p in C order.
LAPACK's least squares driver *GELS, also not wrapped in SciPy, chooses
intelligently between QR or LQ depending on the data. (Unfortunately the
SVD based solver *GELSS cannot do this optimization.) It seems to be more
common to use C order matrices instead of Fortran order matrices today, and
then LQ becomes the 'natural' method to use for least-squares.

I would also like to change the triangular matrix solver to use level-3
BLAS *TRSM instead of LAPACK *TRTRS. *TRSM has the advantage that is can
solve AX=B and XA=B, but *TRTRS can only solve AX=B unless we compute the
inverse of A explicitely. It often happens that the triangular matrix is on
the right-hand side. And *TRTRS is just a shallow wrapper for *TRSM anyway.

> In general, I think
> there's no reason to not wrap the whole of LAPACK this way even if there
> are no corresponding high-level functions.

I would really appreciate this, though it would be a major effort. But we
could do it incrementally, whenever the need raises. 

Sturla




More information about the SciPy-User mailing list