decompose_matrix
— Decompose a matrix.
decompose_matrix( : : MatrixID, MatrixType : Matrix1ID, Matrix2ID)
The operator decompose_matrix
decomposes the square input
Matrix
given by the matrix handle MatrixID
. The
results are stored in two generated matrices Matrix1
and
Matrix2
. The operator returns the matrix handles
Matrix1ID
and Matrix2ID
. Access to the elements
of the matrices is possible e.g., with the operator
get_full_matrix
.
The type of the input Matrix
can be selected via the
parameter MatrixType
. The following values are supported:
'general' for general, 'symmetric' for symmetric,
'positive_definite' for symmetric positive definite, and
'tridiagonal' for tridiagonal matrices.
The decomposition MatrixType
= 'general' or
'tridiagonal' is a LU factorization (Lower/Upper) with the
form
\texttt{Matrix} = \texttt{Matrix1} * \texttt{Matrix2}
The output Matrix1
is a lower triangular matrix with unit
diagonal elements and interchanged rows. The output
Matrix2
is an upper triangular matrix.
Example for a factorization of a general matrix:
Example for a factorization of a tridiagonal matrix:
For MatrixType
= 'symmetric' the factorization is
a UDU^T decomposition (Upper/Diagonal/Upper) with the form
where the output Matrix1
is an upper triangular matrix
with interchanged columns. The output matrix Matrix2
is
a symmetric block diagonal matrix with 1 x 1 and
2 x 2 diagonal blocks.
Example for a factorization of a symmetric matrix:
For MatrixType
= 'positive_definite' a Cholesky
factorization is computed with the form
\texttt{Matrix} = \texttt{Matrix1} * \texttt{Matrix2}
where the output Matrix1
is a lower triangular matrix and
the output matrix Matrix2
is an upper triangular matrix.
Furthermore, the Matrix2
is the transpose of the matrix
Matrix1
.
Example for a factorization of a positive definite matrix:
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.
For MatrixType
= 'symmetric' or
'positive_definite' , the upper triangular part of the input
Matrix
must contain the relevant information of the matrix.
The strictly lower triangular part of the matrix is not referenced.
For MatrixType
= 'tridiagonal' , only the main
diagonal, the superdiagonal, and the subdiagonal of the input
Matrix
are used. The other parts of the matrix are not
referenced. If the referenced part of the input Matrix
is
not of the specified type, an exception is raised.
MatrixID
(input_control) matrix →
(handle)
Matrix handle of the input matrix.
MatrixType
(input_control) string →
(string)
Type of the input matrix.
Default value: 'general'
List of values: 'general' , 'positive_definite' , 'symmetric' , 'tridiagonal'
Matrix1ID
(output_control) matrix →
(handle)
Matrix handle with the output matrix 1.
Matrix2ID
(output_control) matrix →
(handle)
Matrix handle with the output matrix 2.
If the parameters are valid, the operator decompose_matrix
returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.
get_full_matrix
,
get_value_matrix
orthogonal_decompose_matrix
,
solve_matrix
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