Computing the maximum-entropy extension of discrete probability distributions