Use a cache to calculate the inverse of e matrix