Update cachematrix.R

committed by Xiaojian Chen