This is a wrapper function around the chol function.
The goal is to factor a square, symmetric, positive (semi-)definite matrix into the product of a lower triangular matrix, a diagonal matrix, and the transpose of the lower triangular matrix.
The value returned is a lower triangular matrix with the elements of D on the diagonal.