Implement cache of inverse matrix