Implemented functions for caching the inverse of a matrix.