Re: How to get the rank of a matrix?

Gunter Winkler <[email protected]> Fri, 22 Sep 2006 11:04:27 +0200
Newsgroups gmane.comp.lib.mtl.devel
Message-ID <[email protected]>
On Wednesday 20 September 2006 09:18, vencent yen wrote:
>  I am the beginner of the MTL.
>  Is there any way to get the rank of a matrix?

AFAIK there is no rank() function available.

Numerical computation of the rank is a difficult problem, because rounding 
errors have a big influence on the rank.

In general one does a PLU or better PQR decomposition of the matrix (with row 
permutation) and the row number where the decomposition aborts is the rank+1. 
If you want a reliable (and numerically stable) result you have to compute a 
singular value decomposition of your matrix and count the nonzero singular 
values. All these operations are provided by LAPACK or similar numerical 
packages.

mfg
Gunter

PS: For small matrices you can easily implement the Gaussian elimination 
scheme.
_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/