Scythe-1.0.3
SVD scythe::svd ( const Matrix<> &  A,
int  nu = -1,
int  nv = -1 
) [inline]

Calculates the singular value decomposition of a matrix, optionally computing the left and right singular vectors.

This function returns the singular value decomposition (SVD) of a $m \times n$ matrix A, optionally computing the left and right singular vectors. It returns the singular values and vectors in a SVD object.

Note:
This function requires BLAS/LAPACK functionality and is only available on machines that provide these libraries. Make sure you enable the SCYTHE_LAPACK preprocessor flag if you wish to use this function. Furthermore, note that this function takes and returns only column-major concrete matrices. Future versions of Scythe will provide a native C++ implementation of this function with support for general matrix templates.
Parameters:
AThe matrix to decompose.
nuThe number of left singular vectors to compute and return. Values less than zero are equivalent to min( $m$, $n$).
nvThe number of right singular vectors to compute and return. Values less than zero are equivalent to min( $m$, $n$).
Exceptions:
scythe_null_error(Level 1)
scythe_convergence_error(Level 1)
scythe_lapack_internal_error(Level 1)
See also:
SVD
eigen(const Matrix<>& A, bool vectors)

References scythe::Matrix_base< ORDER, STYLE >::cols(), scythe::Matrix< T_type, ORDER, STYLE >::getArray(), scythe::Matrix_base< ORDER, STYLE >::isNull(), min(), scythe::Matrix_base< ORDER, STYLE >::rows(), and SCYTHE_CHECK_10.