def _rotation_ints(self): """ Returns a nested list with the interger representation for each object returned from _rotations() """ return [[utils.setint(pcs) for pcs in rotation] \ for rotation in self._rotations()]
def testEach_set(self): self.pcset.mod(12) each_set = list(self.pcset.each_set()) self.assertEqual(each_set[0:6], [[], [0], [1], [0, 1], [2], [0, 2]]) self.assertEqual(each_set[-1], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) self.assertEqual(each_set, list(PCSet.each_set_in_mod(12))) for index, each in enumerate(each_set): self.assertEqual(utils.setint(each), index) self.pcset.mod(4) each_set = list(self.pcset.each_set()) self.assertEqual(each_set[0:3], [[], [0], [1]]) self.assertEqual(each_set[-1], [0, 1, 2, 3])
def setint(self): """ Returns the integer representation for the unique PC's in a given object """ return utils.setint(self._unique_pcs)
def pcint(self): """ Returns the integer representation of a given object in prime form. """ return utils.setint(self.prime)
def make_rotation_ints(self): """Helper for making setints from rotations""" result = [] for rotation in self.pcset._rotations(): result.append([utils.setint(pcs) for pcs in rotation]) return result
def testForteInt(self): for each in self.sets: self.assertEqual(each.pcint, utils.setint(utils.from_forte(each.forte)))
def testPCInt(self): for each in self.sets: self.assertEqual(utils.setint(each.prime), each.pcint)