Short Answer: LAPACK's dsytf2
(for symmetric full) and dsptrf
(for symmetric packed, which is the same layout that Bierman uses in its Kalman filter subroutines) actually computes $UDU'$ decomposition as it is used in estimation community.
Longer Version:
Cholesky decomposition routines of LAPACK (such as dpotrf
) compute only $LL'$ and $U'U$ (not $UU'$). It is interesting to note until version 3.6 of LAPACK, the documentation of LAPACK wrongfully stated that when the UPLO='U'
, the Cholesky decomposition returns $UU'$ decomposition. But, that wrong statement was fixed after 3.6. Currently (as of 3.12), LAPACK Cholesky decomposition routines can only return $U'U$ or $LL'$ decomposition based on UPLO
argument (same as matlab's chol function).
On the other hand, $LDL$ decomposition routines of LAPACK actually compute $UDU'$ when the UPLO
is set to 'U'
in the arguments. This fact is also explicitly stated in these functions' documentation.
However, one should also note that LAPACK LDL routines execute much more complicated algorithms as the LDL routines are designed for indefinite matrices. In estimation algorithms, we generally set the row/col to zero when the pivot is zero and continue to decompose the rest of the matrix as it is known that the input (the covariance matrix) is not indefinite. However, LDL routines of LAPACK, perform row/col rooks in such cases. Therefore, one may need to use syconv
routine to convert permutated $LDL'$/$UDU'$ matrices into unpermutated forms.
DSIFA
doesn't do a genuine diagonal factorization, as the $\mathbf D$ factor it returns is in fact block-diagonal, at least if the input matrix is symmetric-indefinite (Bunch-Parlett). $\endgroup$