Completed cachematrix functions