implement matrix inverse caching methods