Calculate and cache inverse of matrix

Calculate and cache inverse of matrix