Added matrix inversion cache functions