cachematrix.R as per rprog-006 pa2