Update cachematrix.R

cachematrix updated with implementation