decompose_matrixT_decompose_matrixDecomposeMatrixDecomposeMatrixdecompose_matrix (算子)

名称

decompose_matrixT_decompose_matrixDecomposeMatrixDecomposeMatrixdecompose_matrix — 分解矩阵。

签名

decompose_matrix( : : MatrixID, MatrixType : Matrix1ID, Matrix2ID)

Herror T_decompose_matrix(const Htuple MatrixID, const Htuple MatrixType, Htuple* Matrix1ID, Htuple* Matrix2ID)

void DecomposeMatrix(const HTuple& MatrixID, const HTuple& MatrixType, HTuple* Matrix1ID, HTuple* Matrix2ID)

HMatrix HMatrix::DecomposeMatrix(const HString& MatrixType, HMatrix* Matrix2ID) const

HMatrix HMatrix::DecomposeMatrix(const char* MatrixType, HMatrix* Matrix2ID) const

HMatrix HMatrix::DecomposeMatrix(const wchar_t* MatrixType, HMatrix* Matrix2ID) const   ( Windows only)

static void HOperatorSet.DecomposeMatrix(HTuple matrixID, HTuple matrixType, out HTuple matrix1ID, out HTuple matrix2ID)

HMatrix HMatrix.DecomposeMatrix(string matrixType, out HMatrix matrix2ID)

def decompose_matrix(matrix_id: HHandle, matrix_type: str) -> Tuple[HHandle, HHandle]

描述

算子 decompose_matrixdecompose_matrixDecomposeMatrixDecomposeMatrixDecomposeMatrixdecompose_matrix decomposes the square input Matrix given by the matrix handle MatrixIDMatrixIDMatrixIDMatrixIDmatrixIDmatrix_id. The results are stored in two generated matrices Matrix1 and Matrix2. The operator returns the matrix handles Matrix1IDMatrix1IDMatrix1IDMatrix1IDmatrix1IDmatrix_1id and Matrix2IDMatrix2IDMatrix2IDMatrix2IDmatrix2IDmatrix_2id. Access to the elements of the matrices is possible e.g., with the operator get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrixget_full_matrix

The type of the input Matrix can be selected via the parameter MatrixTypeMatrixTypeMatrixTypeMatrixTypematrixTypematrix_type. The following values are supported: 'general'"general""general""general""general""general" for general, 'symmetric'"symmetric""symmetric""symmetric""symmetric""symmetric" for symmetric, 'positive_definite'"positive_definite""positive_definite""positive_definite""positive_definite""positive_definite" for symmetric positive definite, and 'tridiagonal'"tridiagonal""tridiagonal""tridiagonal""tridiagonal""tridiagonal" for tridiagonal matrices.

The decomposition MatrixTypeMatrixTypeMatrixTypeMatrixTypematrixTypematrix_type = 'general'"general""general""general""general""general" or 'tridiagonal'"tridiagonal""tridiagonal""tridiagonal""tridiagonal""tridiagonal" is a LU factorization (Lower/Upper) with the form 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 MatrixTypeMatrixTypeMatrixTypeMatrixTypematrixTypematrix_type = 'symmetric'"symmetric""symmetric""symmetric""symmetric""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 and diagonal blocks.

Example for a factorization of a symmetric matrix:

For MatrixTypeMatrixTypeMatrixTypeMatrixTypematrixTypematrix_type = 'positive_definite'"positive_definite""positive_definite""positive_definite""positive_definite""positive_definite" a Cholesky factorization is computed with the form 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 MatrixTypeMatrixTypeMatrixTypeMatrixTypematrixTypematrix_type = 'symmetric'"symmetric""symmetric""symmetric""symmetric""symmetric" or 'positive_definite'"positive_definite""positive_definite""positive_definite""positive_definite""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 MatrixTypeMatrixTypeMatrixTypeMatrixTypematrixTypematrix_type = 'tridiagonal'"tridiagonal""tridiagonal""tridiagonal""tridiagonal""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.

执行信息

参数

MatrixIDMatrixIDMatrixIDMatrixIDmatrixIDmatrix_id (输入控制)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

输入矩阵的矩阵句柄。

MatrixTypeMatrixTypeMatrixTypeMatrixTypematrixTypematrix_type (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Type of the input matrix.

默认值: 'general' "general" "general" "general" "general" "general"

值列表: 'general'"general""general""general""general""general", 'positive_definite'"positive_definite""positive_definite""positive_definite""positive_definite""positive_definite", 'symmetric'"symmetric""symmetric""symmetric""symmetric""symmetric", 'tridiagonal'"tridiagonal""tridiagonal""tridiagonal""tridiagonal""tridiagonal"

Matrix1IDMatrix1IDMatrix1IDMatrix1IDmatrix1IDmatrix_1id (输出控制)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix handle with the output matrix 1.

Matrix2IDMatrix2IDMatrix2IDMatrix2IDmatrix2IDmatrix_2id (输出控制)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix handle with the output matrix 2.

结果

如果参数有效,算子 decompose_matrixdecompose_matrixDecomposeMatrixDecomposeMatrixDecomposeMatrixdecompose_matrix 返回值 2 ( H_MSG_TRUE )。如有必要,则抛出异常。

可能的前趋

create_matrixcreate_matrixCreateMatrixCreateMatrixCreateMatrixcreate_matrix

可能的后继

get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrixget_full_matrix, get_value_matrixget_value_matrixGetValueMatrixGetValueMatrixGetValueMatrixget_value_matrix

替代

orthogonal_decompose_matrixorthogonal_decompose_matrixOrthogonalDecomposeMatrixOrthogonalDecomposeMatrixOrthogonalDecomposeMatrixorthogonal_decompose_matrix, solve_matrixsolve_matrixSolveMatrixSolveMatrixSolveMatrixsolve_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.

模块

基础