Inverse matrix cache function