R programs to make cached matrix object and compute inverse if required