added code for solving linear systems with LDL and cholesky