Пример #1
0
    def test_comb_zeros(self):
        assert_(comb_jit(2, 3) == 0)
        assert_(comb_jit(-1, 3) == 0)
        assert_(comb_jit(2, -1) == 0)

        assert_(comb_jit(self.MAX_INTP, 2) == 0)

        N = np.intp(self.MAX_INTP**0.5 * 2**0.5) + 1
        assert_(comb_jit(N, 2) == 0)
Пример #2
0
    def test_comb_zeros(self):
        eq_(comb_jit(2, 3), 0)
        eq_(comb_jit(-1, 3), 0)
        eq_(comb_jit(2, -1), 0)

        eq_(comb_jit(self.MAX_INTP, 2), 0)

        N = np.int(self.MAX_INTP**0.5 * 2**0.5) + 1
        eq_(comb_jit(N, 2), 0)
Пример #3
0
 def test_max_intp(self):
     assert_(comb_jit(self.MAX_INTP, 0) == 1)
     assert_(comb_jit(self.MAX_INTP, 1) == self.MAX_INTP)
Пример #4
0
 def test_comb(self):
     N, k = 10, 3
     N_choose_k = 120
     assert_(comb_jit(N, k) == N_choose_k)
Пример #5
0
 def test_max_intp(self):
     eq_(comb_jit(self.MAX_INTP, 0), 1)
     eq_(comb_jit(self.MAX_INTP, 1), self.MAX_INTP)
Пример #6
0
 def test_comb(self):
     N, k = 10, 3
     N_choose_k = 120
     eq_(comb_jit(N, k), N_choose_k)