Implement special matrix object that supports cached matrix inversion