Name
svd_matrixsvd_matrixSvdMatrixsvd_matrixSvdMatrixSvdMatrix — Compute the singular value decomposition of a matrix.
Herror svd_matrix(const Hlong MatrixID, const char* SVDType, const char* ComputeSingularVectors, Hlong* MatrixUID, Hlong* MatrixSID, Hlong* MatrixVID)
Herror T_svd_matrix(const Htuple MatrixID, const Htuple SVDType, const Htuple ComputeSingularVectors, Htuple* MatrixUID, Htuple* MatrixSID, Htuple* MatrixVID)
void SvdMatrix(const HTuple& MatrixID, const HTuple& SVDType, const HTuple& ComputeSingularVectors, HTuple* MatrixUID, HTuple* MatrixSID, HTuple* MatrixVID)
HMatrix HMatrix::SvdMatrix(const HString& SVDType, const HString& ComputeSingularVectors, HMatrix* MatrixSID, HMatrix* MatrixVID) const
HMatrix HMatrix::SvdMatrix(const char* SVDType, const char* ComputeSingularVectors, HMatrix* MatrixSID, HMatrix* MatrixVID) const
The operator svd_matrixsvd_matrixSvdMatrixsvd_matrixSvdMatrixSvdMatrix computes a full or reduced singular
value decomposition (SVD) of the MatrixMatrixMatrixMatrixMatrixmatrix defined by the
matrix handle MatrixIDMatrixIDMatrixIDMatrixIDMatrixIDmatrixID. The operator returns the matrix
handle MatrixSIDMatrixSIDMatrixSIDMatrixSIDMatrixSIDmatrixSID of the matrix MatrixSMatrixSMatrixSMatrixSMatrixSmatrixS with
singular values in descending order.
Optionally, the matrices MatrixUMatrixUMatrixUMatrixUMatrixUmatrixU with the left and
MatrixVMatrixVMatrixVMatrixVMatrixVmatrixV with the right singular vectors are computed and
the matrix handles MatrixUIDMatrixUIDMatrixUIDMatrixUIDMatrixUIDmatrixUID and MatrixVIDMatrixVIDMatrixVIDMatrixVIDMatrixVIDmatrixVID are
returned. Access to the elements of the matrices is possible e.g.
with the operator get_full_matrixget_full_matrixGetFullMatrixget_full_matrixGetFullMatrixGetFullMatrix. The SVD is written
For SVDTypeSVDTypeSVDTypeSVDTypeSVDTypeSVDType = 'full'"full""full""full""full""full", a full SVD is computed.
Example:
For SVDTypeSVDTypeSVDTypeSVDTypeSVDTypeSVDType = 'reduced'"reduced""reduced""reduced""reduced""reduced", a reduced SVD is
computed.
Example:
For ComputeSingularVectorsComputeSingularVectorsComputeSingularVectorsComputeSingularVectorsComputeSingularVectorscomputeSingularVectors = 'left'"left""left""left""left""left", the matrix
MatrixUMatrixUMatrixUMatrixUMatrixUmatrixU with the left singular vectors is computed. For
ComputeSingularVectorsComputeSingularVectorsComputeSingularVectorsComputeSingularVectorsComputeSingularVectorscomputeSingularVectors = 'right'"right""right""right""right""right", the matrix
MatrixVMatrixVMatrixVMatrixVMatrixVmatrixV with the right singular vectors is computed. For
ComputeSingularVectorsComputeSingularVectorsComputeSingularVectorsComputeSingularVectorsComputeSingularVectorscomputeSingularVectors = 'both'"both""both""both""both""both", the matrices
MatrixUMatrixUMatrixUMatrixUMatrixUmatrixU and MatrixVMatrixVMatrixVMatrixVMatrixVmatrixV with the left and right
singular vectors are computed.
For ComputeSingularVectorsComputeSingularVectorsComputeSingularVectorsComputeSingularVectorsComputeSingularVectorscomputeSingularVectors = 'none'"none""none""none""none""none", no matrices
with the singular vectors are computed. The matrix
MatrixSMatrixSMatrixSMatrixSMatrixSmatrixS is a matrix with n rows and one column, where
the number n = min(number of rows of the input MatrixMatrixMatrixMatrixMatrixmatrix,
number of columns of the input MatrixMatrixMatrixMatrixMatrixmatrix).
Example:
It should be noted that in the examples there are differences in the
meaning of the values of the output matrices: If a value is shown as
an integer number, e.g., 0 or 1, the value of this element is per
definition this certain value. If the number is shown as a floating
point number, e.g., 0.0 or 1.0, the value is computed by the
operator.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Matrix handle of the input matrix.
Type of computation.
Default value:
'full'
"full"
"full"
"full"
"full"
"full"
List of values: 'full'"full""full""full""full""full", 'reduced'"reduced""reduced""reduced""reduced""reduced"
Computation of singular values.
Default value:
'both'
"both"
"both"
"both"
"both"
"both"
List of values: 'both'"both""both""both""both""both", 'left'"left""left""left""left""left", 'none'"none""none""none""none""none", 'right'"right""right""right""right""right"
Matrix handle with the left singular vectors.
Matrix handle with singular values.
Matrix handle with the right singular vectors.
If the parameters are valid, the operator svd_matrixsvd_matrixSvdMatrixsvd_matrixSvdMatrixSvdMatrix returns
the value 2 (H_MSG_TRUE). If necessary, an exception is raised.
create_matrixcreate_matrixCreateMatrixcreate_matrixCreateMatrixCreateMatrix
get_full_matrixget_full_matrixGetFullMatrixget_full_matrixGetFullMatrixGetFullMatrix,
get_value_matrixget_value_matrixGetValueMatrixget_value_matrixGetValueMatrixGetValueMatrix
David Poole: “Linear Algebra: A Modern Introduction”; Thomson;
Belmont; 2006.
Gene H. Golub, Charles F. van Loan: “Matrix Computations”; The
Johns Hopkins University Press; Baltimore and London; 1996.
Foundation