This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
problems with gsl_linalg_SV_decomp
- From: David Clifford <clifford at galton dot uchicago dot edu>
- To: gsl-discuss at sources dot redhat dot com
- Date: Wed, 24 Apr 2002 15:32:35 -0500 (CDT)
- Subject: problems with gsl_linalg_SV_decomp
to whom it may concern,
I am using gsl for some matrix computations and the singular value
decomposition algorithm hangs when you give it a singular matrix. I have
tried it out using the matrix
> mat
[,1] [,2] [,3]
[1,] 2 2 0
[2,] 0 0 0
[3,] 0 0 3
expecting to get
> svd(mat)
$s:
[1] 3.000000 2.828427 0.000000
$v:
[,1] [,2] [,3]
[1,] 0 -0.7071068 -0.7071068
[2,] 0 -0.7071068 0.7071068
[3,] 1 0.0000000 0.0000000
$u:
[,1] [,2] [,3]
[1,] 0 -1 0
[2,] 0 0 1
[3,] 1 0 0
the above example was taken from S. When the program is asked to get the
SVD it just sits there doing nothing, my code works perfectly when the
matrix is invertible, any suggestions on how to proceed?
David Clifford