test for if matrix is invertible using LU