Implemented an inplace and a newly allocated version of the matrix invert.