U D U⊤UDU⊤LAPACK/Eigen 中的分解例程?

计算科学 线性代数 矩阵 拉帕克 本征
2021-12-03 15:04:43

我想计算一个真正的对称正定矩阵的分解。A=UDU

LINPACK 似乎有它DSIFA,但我在 LAPACK 中找不到等效的例程。它似乎也没有在 Eigen 中实现。

还有哪些其他包和例程支持这种分解?


背景:

在我的领域中,“现实世界”中最常见的卡尔曼滤波器是通过UDU实现的,这在有关该主题的 本书籍 中得到了证明。 我知道有一个等效的形式,但我试图在我的领域坚持惯例。LDL

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