def test_std_next(self, x, y): y_0 = y[0] y_1 = y[1] z = StdGen.std_next(x) z_0 = z[0] z_1 = z[1] self.assertEqual(y_0, z_0) self.assertEqual((y_1.a, y_1.b), (z_1.a, z_1.b))
def _sample(i, seed, samples): if 0 == i: return samples else: samples = [Gen.eval(size, seed, gn)] + samples return _sample( i - 1, StdGen.std_split(seed)[1], samples )
def test_div_mod(self, n, d, o, e): x = StdGen.div_mod(n, d) self.assertEqual((o, e), x)
def test_std_split(self, x, y, z): a = StdGen.ilog_base(x, y) self.assertEqual(z, a)
def test_mk_StdGen(self, x, a, b): x = StdGen.mk_StdGen(x) self.assertEqual((a, b), (x.a, x.b))