Cached calculation for inverse matrix