Created matrix inversion cache functions.