This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]