Implements matrix inverse caching functions