decompose_matrix T_decompose_matrix DecomposeMatrix DecomposeMatrix decompose_matrix 分解矩阵(算子)
名称
decompose_matrix T_decompose_matrix DecomposeMatrix DecomposeMatrix decompose_matrix — 分解一个矩阵。
签名
描述
算子 decompose_matrix decompose_matrix DecomposeMatrix DecomposeMatrix DecomposeMatrix decompose_matrix 将由矩阵句柄
Matrix given by the matrix handle MatrixID MatrixID MatrixID MatrixID matrixID matrix_id 指定的输入方阵进行分解。结果存储在两个生成的矩阵 Matrix1 和
Matrix2 中。该算子返回矩阵句柄
Matrix1ID Matrix1ID Matrix1ID Matrix1ID matrix1ID matrix_1id 和 Matrix2ID Matrix2ID Matrix2ID Matrix2ID matrix2ID matrix_2id 。可以通过
get_full_matrix get_full_matrix GetFullMatrix GetFullMatrix GetFullMatrix get_full_matrix 等算子访问这些矩阵的元素。
可以通过参数 MatrixType MatrixType MatrixType MatrixType matrixType matrix_type 选择输入Matrix 的类型。支持以下值:
'general' "general" "general" "general" "general" "general" 表示一般矩阵,'symmetric' "symmetric" "symmetric" "symmetric" "symmetric" "symmetric" 表示对称矩阵,'positive_definite' "positive_definite" "positive_definite" "positive_definite" "positive_definite" "positive_definite" 表示对称正定矩阵,'tridiagonal' "tridiagonal" "tridiagonal" "tridiagonal" "tridiagonal" "tridiagonal" 表示三对角矩阵。
当 MatrixType MatrixType MatrixType MatrixType matrixType matrix_type = 'general' "general" "general" "general" "general" "general" 或
'tridiagonal' "tridiagonal" "tridiagonal" "tridiagonal" "tridiagonal" "tridiagonal" 时,该分解为一种 LU 因式分解(下三角/上三角),形式为
输出矩阵 Matrix1 是一个下三角矩阵,其对角线元素为 1,且行已交换。输出矩阵 Matrix2 是一个上三角矩阵。
一般矩阵的因式分解示例:
三对角矩阵的因式分解示例:
当 MatrixType MatrixType MatrixType MatrixType matrixType matrix_type = 'symmetric' "symmetric" "symmetric" "symmetric" "symmetric" "symmetric" 时,该因式分解为 UDU^T 分解(上三角/对角/上三角),形式为
其中,输出矩阵 Matrix1 是一个列序互换的上三角矩阵。输出矩阵 Matrix2 是一个由
和
对角块组成的对称块对角矩阵。
对称矩阵的因式分解示例:
当 MatrixType MatrixType MatrixType MatrixType matrixType matrix_type = 'positive_definite' "positive_definite" "positive_definite" "positive_definite" "positive_definite" "positive_definite" 时,将计算以下形式的科莱斯基因式分解(Cholesky factorization):
其中,输出矩阵 Matrix1 是一个下三角矩阵,输出矩阵 Matrix2是一个上三角矩阵。此外,Matrix2 是矩阵 Matrix1 的转置。
正定矩阵的因式分解示例:
需注意示例中输出矩阵值的含义存在差异:若值显示为整数(如 0 或 1 ),则该元素值即为该特定数值;若数值显示为浮点数(如 0.0 或 1.0 ),则该值由算子计算得出。
注意
当 MatrixType MatrixType MatrixType MatrixType matrixType matrix_type = 'symmetric' "symmetric" "symmetric" "symmetric" "symmetric" "symmetric" 或
'positive_definite' "positive_definite" "positive_definite" "positive_definite" "positive_definite" "positive_definite" 时,输入
Matrix 的上三角部分必须包含该矩阵的相关信息。矩阵的严格下三角部分不会被引用。对于 MatrixType MatrixType MatrixType MatrixType matrixType matrix_type = 'tridiagonal' "tridiagonal" "tridiagonal" "tridiagonal" "tridiagonal" "tridiagonal" ,仅使用输入
Matrix 的主对角线、超对角线和次对角线。矩阵的其他部分不予引用。如果输入 Matrix 的被引用部分不符合指定类型,则会引发异常。
执行信息
多线程类型:可重入(与非独占算子并行运行)。
多线程作用域:全局(可从任何线程调用)。
未采用并行化处理。
参数
MatrixID MatrixID MatrixID MatrixID matrixID matrix_id (输入控制) matrix → HMatrix , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
输入矩阵的矩阵句柄。
MatrixType MatrixType MatrixType MatrixType matrixType matrix_type (输入控制) string → HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
输入矩阵的类型。
默认值:
'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"
Matrix1ID Matrix1ID Matrix1ID Matrix1ID matrix1ID matrix_1id (输出控制) matrix → HMatrix , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
带有输出矩阵 1 的矩阵句柄。
Matrix2ID Matrix2ID Matrix2ID Matrix2ID matrix2ID matrix_2id (输出控制) matrix → HMatrix , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
带有输出矩阵 2 的矩阵句柄。
结果
如果参数有效,算子 decompose_matrix decompose_matrix DecomposeMatrix DecomposeMatrix DecomposeMatrix decompose_matrix 返回值 2 (H_MSG_TRUE )。如有必要,则抛出异常。
可能的前趋
create_matrix create_matrix CreateMatrix CreateMatrix CreateMatrix create_matrix
可能的后继
get_full_matrix get_full_matrix GetFullMatrix GetFullMatrix GetFullMatrix get_full_matrix ,
get_value_matrix get_value_matrix GetValueMatrix GetValueMatrix GetValueMatrix get_value_matrix
替代
orthogonal_decompose_matrix orthogonal_decompose_matrix OrthogonalDecomposeMatrix OrthogonalDecomposeMatrix OrthogonalDecomposeMatrix orthogonal_decompose_matrix ,
solve_matrix solve_matrix SolveMatrix SolveMatrix SolveMatrix 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.
模块
基础