def test_base_image_member(self): cf =Permutation.read_cycle_form a = cf([[1, 2]],4) b = cf([[1,2,3,4]], 4) c = cf([[2,3]], 4) e = cf([],4) base, gens, c_gens, graphs = schreier_sims_algorithm_fixed_base([a,b],[1,2,3,4], e) self.assertEqual(base_image_member(base,[1,3,2],graphs,e), c)
def prefix_postfix_image_member(self, pre, post, allow_base_change = False): lookup = {ele:index for index, ele in enumerate(pre)} image = [] for ele in self.base: if ele in lookup: image.append(post[lookup[ele]]) else: if len(image) < len(pre): raise NotImplementedError #needs base change or new group. else: break limit = len(image) return schreier_sims_tools.base_image_member(self.base[:limit], image, self.schreier_graphs[:limit], self.identity)
def base_prefix_image_member(self, image): limit = len(image) return schreier_sims_tools.base_image_member( self.base[:limit], image, self.schreier_graphs[:limit], self.identity )
def base_image_member(self, image): return schreier_sims_tools.base_image_member(self.base, image, self.schreier_graphs, self.identity)