Cache inverse matrix implementation.