def testInverseChoicePy(self): n = 100 a = numpy.array(numpy.random.randint(0, n, 50), numpy.int32) a = numpy.unique(a) numRuns = 1000 for i in range(numRuns): j = inverseChoicePy(a, n) self.assertTrue(j not in a) self.assertTrue(j in numpy.arange(n))
def run(): numRuns = 2000000 for i in range(numRuns): inverseChoicePy(v, n)