Determinant calculation using Doolittle's algorithm for LU factorisation.