Linear Algebra and the C Language/a0mm
The function calculates the eignvalues of (A_T A) then the square root of the eignvalues.
/* ------------------------------------ */
/* ------------------------------------ */
double **svds_mR(
double **A,
double **SvdValue)
{
int rA = rsize_R(A);
int cA = csize_R(A);
double **A_T = i_mR(cA,rA);
double **A_TA = i_mR(cA,cA);
double **SvdValue_2 = i_mR(cA,C1);
transpose_mR(A,A_T);
mul_mR(A_T,A, A_TA);
eigs_mR(A_TA,SvdValue_2);
sqrt_svd_mR(SvdValue_2,SvdValue);
f_mR(A_T);
f_mR(A_TA);
f_mR(SvdValue_2);
return(SvdValue);
}
/* ------------------------------------ */
/* ------------------------------------ */