The singular value decomposition of an m x n Matrix A (where m >= n) is a decomposition
A = U * D * V.t()where U is m x n with U.t() * U equalling the identity, D is an n x n DiagonalMatrix and V is an n x n orthogonal matrix (type Matrix in Newmat).
Singular value decompositions are useful for understanding the structure of ill-conditioned matrices, solving least squares problems, and for finding the eigenvalues of A.t() * A.
To calculate the singular value decomposition of A (with m >= n) use one of
SVD(A, D, U, V); // U = A is OK SVD(A, D); SVD(A, D, U); // U = A is OK SVD(A, D, U, false); // U (can = A) for workspace only SVD(A, D, U, V, false); // U (can = A) for workspace onlywhere A, U and V are of type Matrix and D is a DiagonalMatrix. The values of A are not changed unless A is also inserted as the third argument.