实现gibbs sampling的code 方法一: double x = rand() * 1.0 / (1.0 + RAND_MAX); while (true) { x -= topicScores[newTopic]; if (x < 0) break; newTopic++; }