Cholesky decomposition and triu and tril functions