Completes the cachematrix functions.