U D U⊤UDU⊤LAPACK/Eigen 中的分解例程?
计算科学
线性代数
矩阵
拉帕克
本征
2021-12-03 15:04:43
1个回答
如果输入矩阵是列主要的且对称条目存储在上三角部分中,则 Eigen 的 LDLT 类实际上执行 U^TDU 分解:
MatrixXd A;
// fill at least the upper triangular part of A
LDLT<MatrixXd,Upper> udu(A); // Only the upper part of A is read to form U
udu.matrixU(); // returns an expression of the triangular matrix U (column major)
udu.matrixL(); // returns an expression of the triangular matrix U^T (row major)
udu.vectorD(); // expression of the diagonal coefficients of the matrix D as a vector
udu.vectorD().asDiagonal(); // an expression of the diagonal matrix D
其它你可能感兴趣的问题