Simple Svd Questions


creech
06-07-2004, 05:50 PM
Hello

I have a few basic questions:

1.) the SVD routine in NR has three parameters for input, but do I need to supply three inputs? Can I simply supply the original matrix a[][].

2.)assuming that I have gotten SVD to work properly, how do I retrieve the solution vector(if it isn't the true solution vector please let me know).

3.)when I am initializing my matrices I can't use a statement like
NRMat a(5,6);
a = {{1,.......},{3,.......}};

I have even tried doing something like this:
double thing[5][6] = {{.....},{.....}};
NRMat a(thing,6);
neither of the above methods work :mad:


what different methods are available to initialize matrices?

Thank you in advance for any help. Also, if you can think of any relevant information to tell me given my apparent "knowledge" it would be appreciated as well.
Thank you,
Mark

Clarence
07-14-2004, 10:50 AM
Mark

Yes, you need all 3 arguments. The first is the matrix for which
you want the singular value decomposition and on output will be the
matrix U, the second is the output vector and the third is the matrix
V. Hence, w is the solution vector.

I am not sure what you are driving at when you ask how to initialize
the input matrix. If you look in the Numerical Recipes Example Book
you will see the driver for svdcmp which reads in values for the
input matrix and then calls svdcmp. Prehaps that will give you some
ideas.

Hope this helps

Clarence

creech
07-21-2004, 02:31 PM
Clarence, thank you for taking the time to respond.