cache functions for invertible matrices