I found an example code that solve SVD. And It has this function :
int dsvd(float **a, int m, int n, float *w, float **v)
with description : * Input to dsvd is as follows:
a = mxn matrix to be decomposed, gets overwritten with u
m = row dimension of a
n = column dimension of a
w = returns the vector of singular values of a
v = returns the right orthogonal transformation matrix
And let's assuem I want to solve SVD with matrix (=a) is = {1,0,0,0,2, 0,0,3,0,0, 0,0,0,0,0, 0,4,0,0,0};
then what should I have to put into a, m, n, w, v????
Do I have to put values like
int a1 = 5;
int b1 = 4;
float **a = (float **)malloc(a1*sizeof(float*))
a[0] = (float*)malloc(b1*sizeof(float))
a[1] = (float*)malloc(b1*sizeof(float))
a[2] = (float*)malloc(b1*sizeof(float))
a[3] = (float*)malloc(b1*sizeof(float))
a[0][0] = 1, a[0][4] = 2 ......
?????????
Even though it is right (actually I do not think so..), I don't know what kinds of values do I have to put into *w and **v.