#include <nmrSVDSolver.h>
Collaboration diagram for nmrSVDSolver:

This computes the singular value decomposition (SVD) of a real
matrix A, optionally computing the left and/or right singular vectors. The SVD is written:

where
is a
matrix which is zero except for its min(m,n) diagonal elements, U is a
orthogonal matrix, and V is a
orthogonal matrix. The diagonal elements of
are the singular values of A; they are real and non-negative, and are returned in descending order. The first
columns of U and V are the left and right singular vectors of A.
Note that the routine returns
, not
.
The data members of this class are:
.
.
.
.
.
.
orthogonal matrix U.
orthogonal matrix
.
matrix A. On exit, the content of A is altered.
The input matrix must be compact (see vctDynamicMatrix::IsCompact() or vctFixedSizeMatrix::IsCompact()).
This code relies on the ERC CISST cnetlib library. Since cnetlib is optional, make sure that CISST_HAS_CNETLIB has been turned ON during the configuration with CMake.
Definition at line 88 of file nmrSVDSolver.h.
| nmrSVDSolver::nmrSVDSolver | ( | void | ) | [inline] |
Default constructor. This constructor doesn't allocate any memory. If you use this constructor, you will need to use one of the Allocate() methods before you can use the Solve method.
Definition at line 114 of file nmrSVDSolver.h.
References Allocate(), M, N, and StorageOrder.
| nmrSVDSolver::nmrSVDSolver | ( | CISSTNETLIB_INTEGER | m, | |
| CISSTNETLIB_INTEGER | n, | |||
| bool | storageOrder | |||
| ) | [inline] |
Constructor with memory allocation. This constructor allocates the memory based on M and N. It relies on the method Allocate(). The next call to the Solve() method will check that the parameters match the dimension.
| m | Number of rows of A | |
| n | Number of columns of A | |
| storageOrder | Storage order used for the input matrix. This order will be used for the output as well. |
Definition at line 128 of file nmrSVDSolver.h.
References Allocate().
| void nmrSVDSolver::Allocate | ( | CISSTNETLIB_INTEGER | m, | |
| CISSTNETLIB_INTEGER | n, | |||
| bool | storageOrder | |||
| ) | [inline] |
This method allocates the memory based on M and N. The next call to the Solve() method will check that the parameters match the dimension.
| m | Number of rows of A | |
| n | Number of columns of A | |
| storageOrder | Storage order used for all the matrices |
Definition at line 169 of file nmrSVDSolver.h.
References Jobu, Jobvt, Lda, Ldu, Ldvt, Lwork, M, N, S, vctDynamicMatrix< _elementType >::SetSize(), StorageOrder, U, VCT_COL_MAJOR, Vt, and Work.
Referenced by nmrPInverseSolver::Allocate(), Allocate(), and nmrSVDSolver().
| void nmrSVDSolver::Solve | ( | vctDynamicMatrixBase< _matrixOwnerType, CISSTNETLIB_DOUBLE > & | A | ) | throw (std::runtime_error) [inline] |
This computes the singular value decomposition (SVD) of a real
matrix A, optionally computing the left and/or right singular vectors. The SVD is written:

Definition at line 233 of file nmrSVDSolver.h.
References cmnThrow(), Info, Jobu, Jobvt, Lda, Ldu, Ldvt, Lwork, M, N, vctDynamicMatrixBase< _matrixOwnerType, _elementType >::Pointer(), S, StorageOrder, U, Vt, and Work.
Referenced by nmrPInverseSolver::Solve(), and Solve().
| void nmrSVDSolver::Solve | ( | vctFixedSizeMatrix< CISSTNETLIB_DOUBLE, _rows, _cols, _storageOrder > & | A | ) | [inline] |
This computes the singular value decomposition (SVD) of a real
matrix A, optionally computing the left and/or right singular vectors. The SVD is written:

Definition at line 279 of file nmrSVDSolver.h.
References Solve().