by **sven** » Tue Nov 29, 2011 1:14 pm

If you suspect that your matrix may be rank deficient then you should use one of the routines

S/DGELSD

S/DGELSS

S/DGELSY

The first two use the singular value decomposition (SVD) and the third uses the complete orthogonal decomposition.

The SVD is the most reliable for rank detection, but the complete orthogonal decomposition is likely to be faster.

S/DGELS is only intended for full rank problems.

See the LAPACK Users' Guide, Section 2.3.2 Linear Least Squares (LLS) Problems, for further information:

http://www.netlib.org/lapack/lug/node27.html

Sven Hammarling.