Update cachematrix.R

Corrections on identity check and tests