cache for matrix inverse