Given a positive semidefinite matrix $A$, this method factorizes it in the form $P' A P = L D L'$, where $P$ is a permutation matrix, $L$ is nonsingular, $D$ is diagonal. If $A$ is a real matrix, this factorization is obtained from its eigenvalue decomposition. For rational matrices we use the LDL decomposition [GolubvanLoan'89]. The method returns null if $A$ is not positive semidefinite.



References: Matrix Computations, Gene Golub and Charles van Loan. Johns Hopkins series in the Mathematical Science (1989), 2 ed., pp. 133148.
The object PSDdecomposition is a function closure.