ERC CISST - cisst software

nmrSVDSolver Class Reference
[Numerical Methods]

#include <nmrSVDSolver.h>

Collaboration diagram for nmrSVDSolver:

Collaboration graph
[legend]
List of all members.

Detailed Description

Algorithm SVD: Singular Value Decomposition

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

$ A = U * \Sigma * V^{T} $

where $ \Sigma $ is a $ M \times N $ matrix which is zero except for its min(m,n) diagonal elements, U is a $ M \times M $ orthogonal matrix, and V is a $ N \times N $ orthogonal matrix. The diagonal elements of $ \Sigma $ are the singular values of A; they are real and non-negative, and are returned in descending order. The first $ \mbox{min}(m,n) $ columns of U and V are the left and right singular vectors of A.

Note that the routine returns $ V^{T} $, not $ V $.

The data members of this class are:

Note:
The input matrices of this class can use either column major or row major storage order. To select the storage order, use either VCT_COL_MAJOR or VCT_ROW_MAJOR (default) whenever you declare a matrix.

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.

Deprecated:
This class has been replaced by nmrSVD, nmrSVDDynamicData and nmrSVDFixedSizeData.

Definition at line 88 of file nmrSVDSolver.h.

Public Member Functions

Allocate memory to solve this problem.
This methods provide a convenient way to extract the required sizes from the input containers. The next call to the Solve() method will check that the parameters match the dimension.

Protected Attributes


Constructor & Destructor Documentation

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.

Parameters:
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().


Member Function Documentation

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.

Parameters:
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().

template<class _matrixOwnerType>
void nmrSVDSolver::Solve ( vctDynamicMatrixBase< _matrixOwnerType, CISSTNETLIB_DOUBLE > &  A  )  throw (std::runtime_error) [inline]

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

$ A = U * \Sigma * V^{T} $

Note:
This method requires a compact matrix with the same size and storage order used to Allocate. An std::runtime_error exception will be thrown if these conditions are not met.

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().

template<vct::size_type _rows, vct::size_type _cols, bool _storageOrder>
void nmrSVDSolver::Solve ( vctFixedSizeMatrix< CISSTNETLIB_DOUBLE, _rows, _cols, _storageOrder > &  A  )  [inline]

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

$ A = U * \Sigma * V^{T} $

Note:
This method requires a compact matrix with the same size and storage order used to Allocate. An std::runtime_error exception will be thrown if these conditions are not met.

Definition at line 279 of file nmrSVDSolver.h.

References Solve().


The documentation for this class was generated from the following file:
erc-cisst-devel<at>lists.johnshopkins.edu