Caching the computed inverse of a square matrix