def test_log_fact(self):
        a = math.log(math.factorial(5))
        b = util.log_fact(5)
        a = math.floor(a*1000)/1000
        b = math.floor(b*1000)/1000

        self.assertEquals(a, b)
Exemple #2
0
 def make_score(n_ijk_list, n_ij, r_i):
     return util.log_fact(r_i - 1) - util.log_fact(n_ij + r_i - 1) + sum(map(util.log_fact, n_ijk_list))