473,624 Members | 2,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
2 9292
ey**@ece.cornel l.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
On 5 Nov 2006 17:35:14 -0800, in comp.lang.c , "ey**@ece.corne ll.edu"
<ey**@ece.corne ll.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.wa nted. The normal method is thus
to ask in comp.programmin g 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1916
by: Oracle3001 | last post by:
I've written the following program for what we discussed and I get a Exception in thread "main" javax.vecmath.MismatchedSizeException: GMatrix.SVD: d imension mismatch with V matrix at javax.vecmath.GMatrix.SVD(GMatrix.java:1521) at SVDTest.main(SVDTest.java:41) Can't see why myself? Any ideas?
1
1723
by: anmar | last post by:
I'm trying to figure out how to select all the records in one table which have multiple specified records in a second table. Here's a simplified version of my problem. I have two tables, resources and goals. resources table: ID TITLE
4
6089
by: smritibhagat | last post by:
Hi! I have been trying to figure this out, and need help... How do I compute an orthogonal complement of a matrix using SVD? Is there a python lib function or code that does this? Thanks!
0
2498
by: metaperl | last post by:
A Comparison of Python Class Objects and Init Files for Program Configuration ============================================================================= Terrence Brannon bauhaus@metaperl.com http://www.livingcosmos.org/Members/sundevil/python/articles/a-comparison-of-python-class-objects-and-init-files-for-program-configuration/view
20
5210
by: Frank-O | last post by:
Hi , Recently I have been commited to the task of "translating" some complex statistical algorithms from Matlab to C++. The goal is to be three times as fast as matlab ( the latest) . I've used various techniques ( loop unrolling, loop jamming...) and tried some matrix libraries : newmat (slow for large matrix) , STL (fast but ..not usefull) , hand coding (brain consuming...), and recently Meschach...
3
1084
by: mano | last post by:
Hello.... Can anybody give me some idea ... How to write programs on (...(In C++)) Gauss elimination LU Decomposition finding Inverse Thanks
4
3674
by: debiasri | last post by:
Hello, I searching the code for singular value decomposition for using it in AMMI model analysis. Kindly somebody help me.
1
2266
by: vinay3744 | last post by:
Hi I am currently working on figuring out a code for performing a singular value decomposition for String arrays. Can some one help me get started on this. I have already done a declaration for the array of dimension 5000X3000. Now i need to perform the function on the array. Thanks a lot in advance. Vinay3744
37
2589
by: Phlip | last post by:
1230987za wrote: Kanze is a classically-trained "unit tester". In some circles "unit" is a QA concept - specifically, if a test fails, you only need to inspect one unit. So "units" are "things which are clearly delimited and accessible to inspection". That should map onto C++ classes - specifically due to overlapping requirements. C++ classes _should_ be "things which are clearly delimited and accessible to inspection". Yet...
0
8240
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8625
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8336
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7168
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2610
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1487
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.