Caching an inverted matrix