[SciPy-user] Rank-Revealing QR factorization of dense matrices in scipy

Robert Kern rkern at ucsd.edu
Tue Oct 12 09:57:20 CDT 2004

Nils Wagner wrote:
> Robert Kern wrote:
>> Nils Wagner wrote:
>>> Hi all,
>>> Has someone written a function for Rank-Revealing QR factorization of 
>>> dense matrices in scipy ?
>> No. The relevant LAPACK function set is xGEQP3, I believe. 
>> Contributions are welcome.
> BTW, a good source is
> C. H. Bischof, G. Quintana-Orti
> Algorithm 782: Codes for Rank-Revealing QR Factorizations of Dense
> Matrices
> ACM Transactions on Mathematical software, Vol.24 No. 2 pp. 254-257

The LAPACK functions are unencumbered by TOMS's non-commercial-use-only 
license. I'm fairly sure, though, that xGEQP3 is a  version of the 
TOMS782 code.


> It would be nice to have a built-in function (e.g. rank(A)) for this 
> purpose.

Indeed. If you write one that's sufficiently robust, documented, and 
unit tested, I'll check it in. Until then, the svdvals solution should 
work just fine for you.

> Maybe linalg.orth can be used in this context.

No, that computes the full SVD, which is overkill.

Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter

More information about the SciPy-user mailing list