a cache for matrix inversion