cache the inverse matrix of a given matrix