create cache invert matrix