Implementation for caching the inverse of a matrix assignment (Programm assignment #2)