Cache the inverse of a matrix in a list