Operator Reference
svd_matrix (Operator)
svd_matrix
— Compute the singular value decomposition of a matrix.
Signature
Description
The operator svd_matrix
computes a full or reduced singular
value decomposition (SVD) of the Matrix
defined by the
matrix handle MatrixID
. The operator returns the matrix
handle MatrixSID
of the matrix MatrixS
with
singular values in descending order.
Optionally, the matrices MatrixU
with the left and
MatrixV
with the right singular vectors are computed and
the matrix handles MatrixUID
and MatrixVID
are
returned. Access to the elements of the matrices is possible e.g.,
with the operator get_full_matrix
. The SVD is written
For SVDType
= 'full' , a full SVD is computed.
Example:
SVDType
= 'full' ,
ComputeSingularVectors
= 'both'
For SVDType
= 'reduced' , a reduced SVD is
computed.
Example:
SVDType
= 'reduced' ,
ComputeSingularVectors
= 'both'
For ComputeSingularVectors
= 'left' , the matrix
MatrixU
with the left singular vectors is computed. For
ComputeSingularVectors
= 'right' , the matrix
MatrixV
with the right singular vectors is computed. For
ComputeSingularVectors
= 'both' , the matrices
MatrixU
and MatrixV
with the left and right
singular vectors are computed.
For ComputeSingularVectors
= 'none' , no matrices
with the singular vectors are computed. The matrix
MatrixS
is a matrix with n rows and one column, where
the number n = min(number of rows of the input Matrix
,
number of columns of the input Matrix
).
Example:
SVDType
= 'reduced' or 'full' ,
ComputeSingularVectors
= 'none'
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.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
MatrixID
(input_control) matrix →
(handle)
Matrix handle of the input matrix.
SVDType
(input_control) string →
(string)
Type of computation.
Default: 'full'
List of values: 'full' , 'reduced'
ComputeSingularVectors
(input_control) string →
(string)
Computation of singular values.
Default: 'both'
List of values: 'both' , 'left' , 'none' , 'right'
MatrixUID
(output_control) matrix →
(handle)
Matrix handle with the left singular vectors.
MatrixSID
(output_control) matrix →
(handle)
Matrix handle with singular values.
MatrixVID
(output_control) matrix →
(handle)
Matrix handle with the right singular vectors.
Result
If the parameters are valid, the operator svd_matrix
returns
the value 2 (
H_MSG_TRUE)
. If necessary, an exception is raised.
Possible Predecessors
Possible Successors
get_full_matrix
,
get_value_matrix
References
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.
Module
Foundation