do_svd - Calculates the (reduced) SVD
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
const Matrix *a_mp,
Given a matrix A, this routine computes A = U*D*VT, where D is diagonal,
and contains the singular values of A. The reduced SVD is computed, so,
letting m be the number of rows in A, n be the number of columns in A, and
letting r=min(m,n), then the dimensions of U are mxr, the dimensions of D are
rxn, and the dimensions of VT are nxn. (D is actually returned as a
vector of length r, and if D is needed as a matrix, the caller will have to
put the vector into a zero matrix of dimension rxn).
The matrices U and VT are put into *u_mpp and *vt_mpp, respectively,
which are created or resized as needed. The diagonal matrix of singular
values is put into the vector pointed to by *d_vpp, which is also created
or resized as needed. Also, an estimate of the rank of A is put into
*rank_ptr. This is the number of singular values of A such that the ratio of
the first singular value to the singular values is less than the maximum
allowed condition number. The maximum allowed condition number is normally
exposed to the user through the option "max-matrix-condition-number". (The
condition number of matrix is the raio of the largest (first) singular value
to the smallest (last) singular value). If you are not interested in one or
more of U, D, VT, or rank, then the corresponding pointer argument may be set
The method used to compute the svd is also user settable. The default method
is to use the LAPACK routine, if it is available. If the LAPACK library is
not available, then code from numerical recipes in C is used, provided that
making those routines available in code exported to the world.
NO_ERROR on success, and ERROR on failure, with an appropriate error
message being set.
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.