def test_rcg3(self): # random numbers for large array users = 10 subcarriers = 50 subcarriermap = np.around(8*np.random.rand(subcarriers, users)) # rounding makes it readable target = np.repeat(np.array([subcarriers/users]), users) outMap, initial = rcg.rcg(subcarriermap, target) self.assertTrue((np.bincount(np.int32(outMap)) == target).all())
def test_rcg3(self): # random numbers for large array users = 10 subcarriers = 50 subcarriermap = np.around( 8 * np.random.rand(subcarriers, users)) # rounding makes it readable target = np.repeat(np.array([subcarriers / users]), users) outMap, initial = rcg.rcg(subcarriermap, target) self.assertTrue((np.bincount(np.int32(outMap)) == target).all())
def test_rcg2(self): # example from Kivanc thesis outMap, initial = rcg.rcg(self.costmap2, self.target2) self.assertTrue((outMap == self.result2).all())
def test_rcg1(self): # run the example from the Kivanc paper outMap, initial = rcg.rcg(self.costmap1, self.target1) self.assertTrue((outMap == self.result1).all())