Cached the inverse of a matrix.