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

E

eyh5

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
 
T

Thomas Lumley

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
 
M

Mark McIntyre

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top