Short Answer: LAPACK's dsytf2 dsytf2
(for symmetric full) and dsptrf dsptrf
(for symmetric packed, which is the same layout that Bierman uses in its Kalman filter subroutines) actually computes UDU' decompostion$UDU'$ decomposition as it is used in estimation community.
Longer Version:
Cholesky decomposition routines of lapackLAPACK (such as dpotrfdpotrf
) computescompute only LL'$LL'$ and U'U $U'U$ (not UU'$UU'$). It is interesting to note until version 3.6 of lapackLAPACK, the documentation of lapackLAPACK wrongfully stated that when the UPLO='U'UPLO='U'
, the Cholesky decomposition returns UU'$UU'$ decomposition. But, that wrong statement was fixed after 3.6. Currently (as of 3.12), lapack'sLAPACK Cholesky decomposition routines can only return U'U$U'U$ or LL'$LL'$ decomposition based on UPLOUPLO
argument (same as matlab's chol function).
On the other hand, LDL$LDL$ decomposition routines of lapackLAPACK actually computes UDU'compute $UDU'$ when the UPLOUPLO
is set to 'U''U'
in the arguments. This fact is also explicitly stated in these functionsfunctions' documentation.
However, one should also note that lapackLAPACK LDL routines executesexecute 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 lapackLAPACK, performsperform row/col rooks in such cases. Therefore, one may need to use syconvsyconv
routine to convert permutated LDL'$LDL'$/UDU'$UDU'$ matrices into unpermutated forms.