matrix inverse caching