geqp3, a FORTRAN77 code which contains the portion of the LAPACK library that carries out the QR factorization, with column pivoting, of an M by N rectangular matrix, with N <= M.
The factorization can be written as
A = Q * R0 * P' = Q * (R) * P', (0)where
The rank of A can be estimated by the rank of R, which, in turn, can be estimated by taking a tolerance T, and comparing the consecutive diagonal elements of R to T * R(1,1). If K is the last diagonal element which is at least T * R(1,1) in magnitude, we estimate the rank as K.
Thereafter, a least squares soluation of the linear system A*X=B can be determined by:
X = P * ( inv ( R(1:k,1:k) ) * ( Q' * B )(1:k,1:k) ) ( 0 )
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
geqp3 is available in a FORTRAN77 version and a FORTRAN90 version.
band_qr, a FORTRAN77 library which computes the QR factorization of a banded matrix, and can solve related linear systems, by Alfredo Remon, Enrique Quintana-Orti, Gregorio Quintana-Orti.
LAPACK_EXAMPLES, a FORTRAN77 program which demonstrates the use of the LAPACK linear algebra library.
LINPACK, a FORTRAN77 library which solves linear systems for a variety of matrix storage schemes, real or complex arithmetic, and single or double precision. It includes a routine for computing the singular value decomposition (SVD) of a rectangular matrix. The original version of this library is by Jack Dongarra, Jim Bunch, Cleve Moler, Pete Stewart.
QR_SOLVE, a FORTRAN77 library which computes the least squares solution of a linear system A*x=b.