By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,159 Members | 888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,159 IT Pros & Developers. It's quick & easy.

Where to get a C program for Singular Value Decomposition (SVD)

P: n/a
Hi,

I'm wondering where I may get the C source code for a
linear-algebraic technique known as the singular value decomposition
(SVD).

I found the code (a function called svdcmp) from Numerical Recipes
in C (by Press, Teukolskyk, Vetterling, and Flannery). However, it
always yields a wrong n-by-n V matrix after decomposing the original
m-by-n matrix A. I am beginning to suspect that the svdcmp provided in
that book is itself errorneous.

Does anyone have experience using this svdcmp? Have you had the same
problem? If so, how did you resolve it, and is there an alternative
website where I may download the C code for the SVD algorithm?

Thanks for your reply.

-Ed

Nov 6 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ey**@ece.cornell.edu wrote:
I'm wondering where I may get the C source code for a
linear-algebraic technique known as the singular value decomposition
(SVD).
LAPACK is pretty reliable. You can get the C version from Netlib.
Netlib probably has other implementations, too.

On the question of the accuracy of the Numerical Recipes algorithm you
would be better off asking somewhere like sci.math.num-analysis.

-thomas

Nov 6 '06 #2

P: n/a
On 5 Nov 2006 17:35:14 -0800, in comp.lang.c , "ey**@ece.cornell.edu"
<ey**@ece.cornell.eduwrote:
>Hi,

I'm wondering where I may get the C source code for a
linear-algebraic technique known as the singular value decomposition
(SVD).
Either www.google.com or by writing it yourself.

I'm afraid this isn't comp.sources.wanted. The normal method is thus
to ask in comp.programming for hints about the algorithm, then ask in
CLC for help debugging your C implementaiton of the algo.
I found the code (a function called svdcmp) from Numerical Recipes
in C (by Press, Teukolskyk, Vetterling, and Flannery). However, it
always yields a wrong n-by-n V matrix after decomposing the original
m-by-n matrix A. I am beginning to suspect that the svdcmp provided in
that book is itself errorneous.
I doubt that. The C code in NRIC is however seriously weird, since it
was translated badly from Fortran. You're quite probably calling it
wrong....
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Nov 6 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.