Added cached-inverse function for cachematrix structure.