Re: TheMatrixTemplateLibrary - 2 questions
Kessler Manuel <[email protected]>
| Newsgroups | gmane.comp.lib.mtl.devel |
|---|---|
| Message-ID | <Pine.GSO.4.21.0211120929560.21736-100000@wamx87.mathematik.uni-wuerzburg.de> |
On Tue, 12 Nov 2002, Gunter Winkler wrote:
> On Friday, 8. November 2002 23:05, you wrote:
> > Hello, I have 2 questions about MTL:
> >
> > 2) Is there a function that computes the rank of a
> > matrix?
>
> There is the LU-Decomposition. If it aborts early, the column (row)
> number (minus 1) gives you the rank of the matrix. You could probably
> change the code provided by O. König to return the rank if LU fails.
>
> mfg
> Gunter
That is not necessarily true. The failure may be much earlier than the
true rank, unless you do full pivoting. Think about a NxN matrix
consisting of all zeroes in the first column (and row), and a unity
submatrix in the rest. This has definitely rank N-1, but LU fails in the
very first step.
Furthermore, rank computation by decomposition is a badly conditioned
process. Rounding errors can changing the rank considerably, in
either direction. Better use SVD (singular value decomposition) and decide
yourself whether a singular value is close enough to zero to be considered
as a rank defect. That decision is highly dependant on what you need the
rank for.
Ciao,
Manuel
______________________________________________________________________
Dr. Manuel Kessler, Dipl.-Phys.
Institut fuer Aerodynamik und Gasdynamik
Universitaet Stuttgart
Pfaffenwaldring 21 ( ( ( ( ___________.^.___________ ) ) ) )
70550 Stuttgart / Germany _\I/_
/\_|_/\
Phone: +49 711 685 3435 \_(_)_/
Fax: +49 711 685 3438 ./ \.
E-Mail: [email protected]
WWW: http://www.iag.uni-stuttgart.de/people/manuel.kessler
______________________________________________________________________
_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/