Write function to get inverse matrix from cached data