Implement functions for solving the inverse of a matrix and caching the calculated value.