Orbiter 2022
Combinatorial Objects
action_on_subgroups.cpp
Go to the documentation of this file.
1// action_on_subgroups.cpp
2//
3// Anton Betten
4// April 29, 2017
5
7#include "group_actions.h"
8
9using namespace std;
10
11
12namespace orbiter {
13namespace layer3_group_actions {
14namespace induced_actions {
15
16
18{
19 null();
20}
21
23{
24 free();
25}
26
28{
29 A = NULL;
30 S = NULL;
31 Subgroups = NULL;
32 sets = NULL;
33 image_set = NULL;
34 perm = NULL;
35 perm_inv = NULL;
36 Elt1 = NULL;
37}
38
40{
41 int i;
42
43 if (sets) {
44 for (i = 0; i < nb_subgroups; i++) {
45 FREE_int(sets[i]);
46 }
48 }
49 if (image_set) {
51 }
52 if (perm) {
54 }
55 if (perm_inv) {
57 }
58 if (Elt1) {
60 }
61 null();
62}
63
65 groups::sims *S, int nb_subgroups,
66 int subgroup_order, groups::subgroup **Subgroups, int verbose_level)
67{
68 int i;
69 int f_v = (verbose_level >= 1);
70 int f_vv = FALSE; //(verbose_level >= 5);
73
74 if (f_v) {
75 cout << "action_on_subgroups::init "
76 "nb_subgroups=" << nb_subgroups
77 << " subgroup_order=" << subgroup_order << endl;
78 }
84
90
91 for (i = 0; i < nb_subgroups; i++) {
92 perm[i] = i;
93 perm_inv[i] = i;
94 }
95 for (i = 0; i < nb_subgroups; i++) {
97 Int_vec_copy(Subgroups[i]->Elements, sets[i], subgroup_order);
99 if (f_vv) {
100 cout << "set " << setw(3) << i << " is ";
102 cout << endl;
103 }
104 }
107 this);
109
110 //test_sets();
111
112
113 if (f_vv) {
114 cout << "after quicksort_array_with_perm" << endl;
115#if 0
116 cout << "i : perm[i] : perm_inv[i]" << endl;
117 for (i = 0; i < nb_sets; i++) {
118 cout << i << " : " << perm[i] << " : " << perm_inv[i] << endl;
119 }
120#endif
121
122 //print_sets_sorted();
123
124 //print_sets_in_original_ordering();
125
126#if 0
127 cout << "the sets in the perm_inv ordering:" << endl;
128 for (i = 0; i < nb_sets; i++) {
129 j = perm_inv[i];
130 cout << "set " << i << " is set " << j << " : ";
131 int_vec_print(cout, sets[j], set_size);
132 cout << endl;
133 }
134#endif
135 }
136 if (f_v) {
137 cout << "action_on_subgroups::init finished" << endl;
138 }
139}
140
142 int *Elt, long int a, int verbose_level)
143{
144 int f_v = (verbose_level >= 1);
145 int f_vv = (verbose_level >= 2);
146 long int res, j, b, aa, s, t;
147 int idx;
149
150 if (f_v) {
151 cout << "action_on_subgroups::compute_image "
152 "a = " << a << endl;
153 }
154 if (a < 0 || a >= nb_subgroups) {
155 cout << "action_on_subgroups::compute_image "
156 "a = " << a << " out of range" << endl;
157 exit(1);
158 }
159 aa = perm[a];
160 if (f_v) {
161 cout << "action_on_subgroups::compute_image "
162 "perm[a] = " << aa << endl;
163 }
164 if (f_vv) {
165 cout << "the element " << endl;
166 A->print(cout, Elt);
167 cout << endl;
168 cout << "as permutation:" << endl;
169 A->print_as_permutation(cout, Elt);
170 cout << endl;
171 }
172 if (f_vv) {
173 cout << "sets[perm[a]]:" << endl;
175 cout << endl;
176 for (j = 0; j < subgroup_order; j++) {
177 cout << j << " : " << sets[aa][j] << " : " << endl;
178 A->print_point(sets[aa][j], cout);
179 cout << endl;
180 }
181 }
182
183 //r = S->element_rank_int(Elt);
184 A->element_invert(Elt, Elt1, 0);
185
186 for (j = 0; j < subgroup_order; j++) {
187 s = sets[aa][j];
189 0 /* verbose_level */);
190 //t = S->conjugate_by_rank(s, r, 0);
191 image_set[j] = t;
192 }
194
195#if 0
196 A->map_a_set_and_reorder(sets[perm[a]], image_set, set_size, Elt, 0);
197#endif
198 if (f_vv) {
199 cout << "after map_a_set_and_reorder:" << endl;
201 cout << endl;
202 for (j = 0; j < subgroup_order; j++) {
203 cout << j << " : " << image_set[j] << " : " << endl;
204 A->print_point(image_set[j], cout);
205 cout << endl;
206 }
207 }
208
209
211 this, nb_subgroups, image_set, idx, verbose_level)) {
212
213 int u;
214 cout << "action_on_subgroups::compute_image "
215 "image set not found" << endl;
216 cout << "action = " << A->label << endl;
217
218 cout << "the element " << endl;
219 A->print(cout, Elt);
220 cout << endl;
221 cout << "as permutation:" << endl;
222 A->print_as_permutation(cout, Elt);
223 cout << endl;
224
225 cout << "a=" << a << endl;
226 cout << "perm[a]=" << aa << endl;
227 cout << "sets[perm[a]]:" << endl;
229 cout << endl;
230 cout << "image_set:" << endl;
232 cout << endl;
233 for (u = 0; u < nb_subgroups; u++) {
234 cout << u << " : ";
236 cout << endl;
237 }
238 for (u = 0; u < subgroup_order; u++) {
239 s = sets[aa][u];
240 t = A->image_of(Elt, s);
241 cout << setw(3) << u << " : " << setw(3) << s
242 << " : " << setw(3) << t << endl;
243 }
244 exit(1);
245 }
246 if (f_v) {
247 cout << "action_on_subgroups::compute_image idx = " << idx << endl;
248 }
249 res = action_on_subgroups_compare(image_set, sets[idx], this);
250 if (res != 0) {
251 cout << "action_on_subgroups::compute_image "
252 "the set we found is not the right one" << endl;
253 }
254 b = perm_inv[idx];
255 if (f_v) {
256 cout << "action_on_subgroups::compute_image "
257 "b = perm_inv[idx] = " << b << endl;
258 }
259 if (b < 0 || b >= nb_subgroups) {
260 cout << "action_on_subgroups::compute_image "
261 "b=" << b << " out of range" << endl;
262 exit(1);
263 }
264 return b;
265}
266
267
268
269int action_on_subgroups_compare(void *a, void *b, void *data)
270{
272 int *A = (int *)a;
273 int *B = (int *)b;
274 int c;
276
277 c = Sorting.int_vec_compare(A, B, AOS->subgroup_order);
278 return c;
279}
280
281int action_on_subgroups_compare_inverted(void *a, void *b, void *data)
282{
284 int *A = (int *)a;
285 int *B = (int *)b;
286 int c;
288
289 c = Sorting.int_vec_compare(B, A, AOS->subgroup_order);
290 return c;
291}
292
293
294}}}
295
a collection of functions related to sorted vectors
void quicksort_array_with_perm(int len, void **v, int *perm, int(*compare_func)(void *a, void *b, void *data), void *data)
Definition: sorting.cpp:937
int vec_search(void **v, int(*compare_func)(void *a, void *b, void *data), void *data_for_compare, int len, void *a, int &idx, int verbose_level)
Definition: sorting.cpp:945
a permutation group in a fixed action.
Definition: actions.h:99
void element_invert(void *a, void *av, int verbose_level)
Definition: action_cb.cpp:322
void print_point(int a, std::ostream &ost)
Definition: action_cb.cpp:149
void map_a_set_and_reorder(long int *set, long int *image_set, int n, int *Elt, int verbose_level)
Definition: action.cpp:698
void print(std::ostream &ost, void *elt)
Definition: action_cb.cpp:131
void print_as_permutation(std::ostream &ost, void *elt)
Definition: action_cb.cpp:143
a permutation group represented via a stabilizer chain
Definition: groups.h:1273
long int conjugate_by_rank_b_bv_given(long int rk_a, int *Elt_b, int *Elt_bv, int verbose_level)
a subgroup of a group using a list of elements
Definition: groups.h:2039
void init(actions::action *A, groups::sims *S, int nb_subgroups, int subgroup_order, groups::subgroup **Subgroups, int verbose_level)
long int compute_image(int *Elt, long int a, int verbose_level)
#define FREE_int(p)
Definition: foundations.h:640
#define Int_vec_print_fully(A, B, C)
Definition: foundations.h:687
#define NEW_pint(n)
Definition: foundations.h:627
#define NEW_int(n)
Definition: foundations.h:625
#define FALSE
Definition: foundations.h:234
#define Int_vec_copy(A, B, C)
Definition: foundations.h:693
#define FREE_pint(p)
Definition: foundations.h:641
#define Int_vec_print(A, B, C)
Definition: foundations.h:685
int action_on_subgroups_compare(void *a, void *b, void *data)
int action_on_subgroups_compare_inverted(void *a, void *b, void *data)
the orbiter library for the classification of combinatorial objects