Orbiter 2022
Combinatorial Objects
top_level_geometry_global.cpp
Go to the documentation of this file.
1/*
2 * top_level_geometry_global.cpp
3 *
4 * Created on: May 23, 2021
5 * Author: betten
6 */
7
8
9#include "orbiter.h"
10
11using namespace std;
12
13
14namespace orbiter {
15namespace layer5_applications {
16namespace apps_geometry {
17
18
20{
21
22}
23
25{
26
27}
28
29
32 int intermediate_subset_size,
33 std::string &fname_mask, int nb, std::string &column_label,
34 std::string &fname_out,
35 int verbose_level)
36{
37 int f_v = (verbose_level >= 1);
38
39
40 if (f_v) {
41 cout << "top_level_geometry_global::set_stabilizer_projective_space" << endl;
42 }
43
45
47
49 PA->A, PA->A, PA->A->Strong_gens,
50 intermediate_subset_size,
51 fname_mask, nb, column_label,
52 fname_out,
53 verbose_level);
54
55
56 FREE_OBJECT(SubC);
57 if (f_v) {
58 cout << "top_level_geometry_global::set_stabilizer_projective_space done" << endl;
59 }
60
61}
62
63
66 groups::strong_generators *SG, std::ostream &ost, std::string &fname_base,
67 int verbose_level)
68{
69 int f_v = (verbose_level >= 1);
70
71 if (f_v) {
72 cout << "projective_space_with_action::report_decomposition_by_group" << endl;
73 }
74
75 long int order;
76
77
78 order = SG->group_order_as_lint();
79
80
81#if 0
82 ost << "The group generated by the element" << endl;
83 ost << "$$" << endl;
84 A->element_print_latex(Elt, ost);
85 ost << "$$" << endl;
86 ost << "has the following orbits:\\\\" << endl;
87
88 ost << "Orbits on points:\\\\" << endl;
89#endif
90
91 groups::schreier *Sch1;
92 groups::schreier *Sch2;
93
96
98 SG,
99 0 /* verbose_level */);
100
101
102 //ost << "Orbits on lines:\\\\" << endl;
103
106 SG,
107 0 /* verbose_level */);
108 //Sch->print_orbit_lengths_tex(ost);
109
110
111
112
113 ost << "Considering the group generated by" << endl;
114 SG->print_generators_tex(ost);
115
116 if (Sch1->nb_orbits == 1 && Sch2->nb_orbits == 1) {
117 ost << "The group is transitive on points and on lines.\\\\" << endl;
118 std::vector<int> Orb1;
119 std::vector<int> Orb2;
120 Sch1->get_orbit_in_order(Orb1, 0 /* orbit_idx */, verbose_level);
121 Sch2->get_orbit_in_order(Orb2, 0 /* orbit_idx */, verbose_level);
122
123 int *Inc;
125 string fname;
126
127 fname.assign(fname_base);
128 fname.append("_incma_transitive.csv");
129
130 PA->P->make_incidence_matrix(Orb1, Orb2, Inc, verbose_level);
131
132 Fio.int_matrix_write_csv(fname, Inc, Orb1.size(), Orb2.size());
133
134 FREE_int(Inc);
135
136 }
137
138
139
140 ost << "Orbits on points:\\\\" << endl;
141 Sch1->print_orbit_lengths_tex(ost);
142
143 ost << "Orbits on lines:\\\\" << endl;
144 Sch2->print_orbit_lengths_tex(ost);
145
146 ost << "Fixed points:\\\\" << endl;
147 Sch1->print_fixed_points_tex(ost);
148
149 ost << "Fixed lines:\\\\" << endl;
150 Sch2->print_fixed_points_tex(ost);
151
152
153 if (PA->f_has_action_on_planes) {
154 groups::schreier *Sch3;
157 SG,
158 0 /*verbose_level*/);
159 ost << "Fixed planes:\\\\" << endl;
160 Sch3->print_fixed_points_tex(ost);
161
162 FREE_OBJECT(Sch3);
163 }
164
165
166
167
168 {
171
173
174 if (f_v) {
175 cout << "projective_space_with_action::report_decomposition_by_group before AG.compute_decomposition_based_on_orbit_length" << endl;
176 }
178 Sch1, Sch2,
179 Inc, Stack, 0 /*verbose_level*/);
180 if (f_v) {
181 cout << "projective_space_with_action::report_decomposition_by_group after AG.compute_decomposition_based_on_orbit_length" << endl;
182 }
183
184
185
186 while (TRUE) {
187
188 int ht0, ht1;
189
190 ht0 = Stack->ht;
191
192 if (f_v) {
193 cout << "process_single_case before refine_column_partition_safe" << endl;
194 }
195 Inc->refine_column_partition_safe(*Stack, verbose_level - 2);
196 if (f_v) {
197 cout << "process_single_case after refine_column_partition_safe" << endl;
198 }
199 if (f_v) {
200 cout << "process_single_case before refine_row_partition_safe" << endl;
201 }
202 Inc->refine_row_partition_safe(*Stack, verbose_level - 2);
203 if (f_v) {
204 cout << "process_single_case after refine_row_partition_safe" << endl;
205 }
206 ht1 = Stack->ht;
207 if (ht1 == ht0) {
208 break;
209 }
210 }
211
212 int f_labeled = TRUE;
213
214 Inc->print_partitioned(cout, *Stack, f_labeled);
216 Stack->print_classes(cout);
217
218
219 int f_print_subscripts = FALSE;
220 ost << "Decomposition based on orbit lengths:\\\\" << endl;
221 ost << "Row scheme:\\\\" << endl;
223 ost, TRUE /* f_enter_math */,
224 f_print_subscripts, *Stack);
225 ost << "Column scheme:\\\\" << endl;
227 ost, TRUE /* f_enter_math */,
228 f_print_subscripts, *Stack);
229
230
231
232 FREE_OBJECT(Inc);
233 FREE_OBJECT(Stack);
234 }
235
236
237
238
239
240 {
243
245
246 if (f_v) {
247 cout << "projective_space_with_action::report_decomposition_by_group before AG.compute_decomposition_based_on_orbits" << endl;
248 }
250 Sch1, Sch2,
251 Inc, Stack, 0 /*verbose_level*/);
252 if (f_v) {
253 cout << "projective_space_with_action::report_decomposition_by_group after AG.compute_decomposition_based_on_orbits" << endl;
254 }
255
256
257 int f_print_subscripts = FALSE;
258 ost << "Decomposition based on orbits:\\\\" << endl;
259 ost << "Row scheme:\\\\" << endl;
261 ost, TRUE /* f_enter_math */,
262 f_print_subscripts, *Stack);
263 ost << "Column scheme:\\\\" << endl;
265 ost, TRUE /* f_enter_math */,
266 f_print_subscripts, *Stack);
267
268
269
270 FREE_OBJECT(Inc);
271 FREE_OBJECT(Stack);
272 }
273
274
275
276 FREE_OBJECT(Sch1);
277 FREE_OBJECT(Sch2);
278
279
280 if (f_v) {
281 cout << "projective_space_with_action::report_decomposition_by_group done" << endl;
282 }
283
284}
285
288 int *Elt, std::ostream &ost, std::string &fname_base,
289 int verbose_level)
290{
291 int f_v = (verbose_level >= 1);
292
293 if (f_v) {
294 cout << "top_level_geometry_global::report_decomposition_by_single_automorphism" << endl;
295 }
296
297#if 0
298 if (P->n != 3) {
299 cout << "top_level_geometry_global::report_decomposition_by_single_automorphism P->n != 3" << endl;
300 exit(1);
301 }
302#endif
303 //projective_space *P3;
304 int order;
305
306 ring_theory::longinteger_object full_group_order;
307 order = PA->A->element_order(Elt);
308
309 full_group_order.create(order, __FILE__, __LINE__);
310
311 //P3 = P;
312
313 //ost << "Fixed Objects:\\\\" << endl;
314
315
316#if 0
317 ost << "The group generated by the element" << endl;
318 ost << "$$" << endl;
319 A->element_print_latex(Elt, ost);
320 ost << "$$" << endl;
321 ost << "has the following orbits:\\\\" << endl;
322
323 ost << "Orbits on points:\\\\" << endl;
324#endif
325
326 groups::schreier *Sch1;
327 groups::schreier *Sch2;
332
335
337 Elt,
338 0 /*verbose_level*/);
339
340 //ost << "Orbits on lines:\\\\" << endl;
341
344 Elt,
345 0 /*verbose_level*/);
346 //Sch->print_orbit_lengths_tex(ost);
347
348
349 if (f_v) {
350 cout << "top_level_geometry_global::report_decomposition_by_single_automorphism "
351 "before incidence_and_stack_for_type_ij" << endl;
352 }
354 1 /* row_type */, 2 /* col_type */,
355 Inc,
356 Stack,
357 0 /*verbose_level*/);
358 if (f_v) {
359 cout << "top_level_geometry_global::report_decomposition_by_single_automorphism "
360 "after incidence_and_stack_for_type_ij" << endl;
361 }
362
363 if (f_v) {
364 cout << "top_level_geometry_global::report_decomposition_by_single_automorphism "
365 "before S1.allocate" << endl;
366 }
367 S1.allocate(PA->A->degree, 0 /* verbose_level */);
368 S2.allocate(PA->A_on_lines->degree, 0 /* verbose_level */);
369
370 if (f_v) {
371 cout << "top_level_geometry_global::report_decomposition_by_single_automorphism "
372 "before Sch1->get_orbit_partition" << endl;
373 }
374 Sch1->get_orbit_partition(S1, 0 /*verbose_level*/);
375 if (f_v) {
376 cout << "top_level_geometry_global::report_decomposition_by_single_automorphism "
377 "before Sch2->get_orbit_partition" << endl;
378 }
379 Sch2->get_orbit_partition(S2, 0 /*verbose_level*/);
380 if (f_v) {
381 cout << "top_level_geometry_global::report_decomposition_by_single_automorphism "
382 "after Sch2->get_orbit_partition" << endl;
383 }
384 int i, j, sz;
385
386 for (i = 1; i < S1.ht; i++) {
387 if (f_v) {
388 cout << "top_level_geometry_global::report_decomposition_by_single_automorphism "
389 "before Stack->split_cell (S1) i=" << i << endl;
390 }
391 Stack->split_cell(
392 S1.pointList + S1.startCell[i],
393 S1.cellSize[i], verbose_level);
394 }
395 int *set;
396 set = NEW_int(PA->A_on_lines->degree);
397 for (i = 1; i < S2.ht; i++) {
398 sz = S2.cellSize[i];
399 Int_vec_copy(S2.pointList + S2.startCell[i], set, sz);
400 for (j = 0; j < sz; j++) {
401 set[j] += PA->A->degree;
402 }
403 if (f_v) {
404 cout << "top_level_geometry_global::report_decomposition_by_single_automorphism "
405 "before Stack->split_cell (S2) i=" << i << endl;
406 }
407 Stack->split_cell(set, sz, 0 /*verbose_level*/);
408 }
409 FREE_int(set);
410
411
412 ost << "Considering the cyclic group generated by" << endl;
413 ost << "$$" << endl;
414 PA->A->element_print_latex(Elt, ost);
415 ost << "$$" << endl;
416
417 if (Sch1->nb_orbits == 1 && Sch2->nb_orbits == 1) {
418 ost << "The group is transitive on points and on lines.\\\\" << endl;
419 std::vector<int> Orb1;
420 std::vector<int> Orb2;
421 Sch1->get_orbit_in_order(Orb1, 0 /* orbit_idx */, verbose_level);
422 Sch2->get_orbit_in_order(Orb2, 0 /* orbit_idx */, verbose_level);
423
424 int *Inc;
426 string fname;
427
428 fname.assign(fname_base);
429 fname.append("_incma_cyclic.csv");
430
431 PA->P->make_incidence_matrix(Orb1, Orb2, Inc, verbose_level);
432
433 Fio.int_matrix_write_csv(fname, Inc, Orb1.size(), Orb2.size());
434
435 FREE_int(Inc);
436
437 int p;
438 for (p = 2; p < Orb1.size(); p++) {
439
440 if ((Orb1.size() % p) == 0) {
441
442 cout << "considering subgroup of index " << p << endl;
443
444 int *v, *w;
445 std::vector<int> Orb1_subgroup;
446 std::vector<int> Orb2_subgroup;
448
449 v = NEW_int(Orb1.size());
450 w = NEW_int(Orb1.size());
451 for (i = 0; i < Orb1.size(); i++) {
452 v[i] = Orb1[i];
453 }
454 Combi.int_vec_splice(v, w, Orb1.size(), p);
455 for (i = 0; i < Orb1.size(); i++) {
456 Orb1_subgroup.push_back(w[i]);
457
458 }
459
460 for (i = 0; i < Orb1.size(); i++) {
461 v[i] = Orb2[i];
462 }
463 Combi.int_vec_splice(v, w, Orb1.size(), p);
464 for (i = 0; i < Orb1.size(); i++) {
465 Orb2_subgroup.push_back(w[i]);
466
467 }
468 FREE_int(v);
469 FREE_int(w);
470
471 fname.assign(fname_base);
472 fname.append("_incma_subgroup");
473 char str[1000];
474
475 sprintf(str, "_index_%d.csv", p);
476 fname.append(str);
477
478 PA->P->make_incidence_matrix(Orb1_subgroup, Orb2_subgroup, Inc, verbose_level);
479
480 Fio.int_matrix_write_csv(fname, Inc, Orb1.size(), Orb2.size());
481 FREE_int(Inc);
482 }
483 }
484
485 }
486
487
488
489 ost << "Orbits on points:\\\\" << endl;
490 Sch1->print_orbit_lengths_tex(ost);
491
492 ost << "Orbits on lines:\\\\" << endl;
493 Sch2->print_orbit_lengths_tex(ost);
494
495 ost << "Fixed points:\\\\" << endl;
496 Sch1->print_fixed_points_tex(ost);
497
498 ost << "Fixed lines:\\\\" << endl;
499 Sch2->print_fixed_points_tex(ost);
500
501
502 if (PA->f_has_action_on_planes) {
503 groups::schreier *Sch3;
506 Elt,
507 0 /*verbose_level*/);
508 ost << "Fixed planes:\\\\" << endl;
509 Sch3->print_fixed_points_tex(ost);
510
511 FREE_OBJECT(Sch3);
512 }
513
514
515 int f_print_subscripts = FALSE;
516 ost << "Row scheme:\\\\" << endl;
518 ost, TRUE /* f_enter_math */,
519 f_print_subscripts, *Stack);
520 ost << "Column scheme:\\\\" << endl;
522 ost, TRUE /* f_enter_math */,
523 f_print_subscripts, *Stack);
524
525
526
527 FREE_OBJECT(Sch1);
528 FREE_OBJECT(Sch2);
529 FREE_OBJECT(Inc);
530 FREE_OBJECT(Stack);
531
532 if (f_v) {
533 cout << "top_level_geometry_global::report_decomposition_by_single_automorphism done" << endl;
534 }
535}
536
537
538}}}
539
540
541
data structure for set partitions following Jeffrey Leon
interface for various incidence geometries
Definition: geometry.h:1099
void get_and_print_row_tactical_decomposition_scheme_tex(std::ostream &ost, int f_enter_math, int f_print_subscripts, data_structures::partitionstack &PStack)
int refine_row_partition_safe(data_structures::partitionstack &PStack, int verbose_level)
void get_and_print_decomposition_schemes(data_structures::partitionstack &PStack)
int refine_column_partition_safe(data_structures::partitionstack &PStack, int verbose_level)
void get_and_print_column_tactical_decomposition_scheme_tex(std::ostream &ost, int f_enter_math, int f_print_subscripts, data_structures::partitionstack &PStack)
void print_partitioned(std::ostream &ost, data_structures::partitionstack &P, int f_labeled)
void make_incidence_matrix(int &m, int &n, int *&Inc, int verbose_level)
void incidence_and_stack_for_type_ij(int row_type, int col_type, incidence_structure *&Inc, data_structures::partitionstack *&Stack, int verbose_level)
void int_matrix_write_csv(std::string &fname, int *M, int m, int n)
Definition: file_io.cpp:1300
a class to represent arbitrary precision integers
Definition: ring_theory.h:366
void create(long int i, const char *file, int line)
global functions related to group actions
Definition: actions.h:1015
void compute_decomposition_based_on_orbits(geometry::projective_space *P, groups::schreier *Sch1, groups::schreier *Sch2, geometry::incidence_structure *&Inc, data_structures::partitionstack *&Stack, int verbose_level)
void compute_decomposition_based_on_orbit_length(geometry::projective_space *P, groups::schreier *Sch1, groups::schreier *Sch2, geometry::incidence_structure *&Inc, data_structures::partitionstack *&Stack, int verbose_level)
void element_print_latex(void *elt, std::ostream &ost)
Definition: action_cb.cpp:364
groups::strong_generators * Strong_gens
Definition: actions.h:130
void all_point_orbits_from_single_generator(groups::schreier &Schreier, int *Elt, int verbose_level)
Definition: action.cpp:1268
void all_point_orbits_from_generators(groups::schreier &Schreier, groups::strong_generators *SG, int verbose_level)
Definition: action.cpp:1254
Schreier trees for orbits of groups on points.
Definition: groups.h:839
void get_orbit_in_order(std::vector< int > &Orb, int orbit_idx, int verbose_level)
Definition: schreier.cpp:2134
void get_orbit_partition(data_structures::partitionstack &S, int verbose_level)
Definition: schreier.cpp:2112
a strong generating set for a permutation group with respect to a fixed action
Definition: groups.h:1703
void set_stabilizer_in_any_space(actions::action *A, actions::action *A2, groups::strong_generators *Strong_gens, int intermediate_subset_size, std::string &fname_mask, int nb, std::string &column_label, std::string &fname_out, int verbose_level)
void set_stabilizer_projective_space(projective_geometry::projective_space_with_action *PA, int intermediate_subset_size, std::string &fname_mask, int nb, std::string &column_label, std::string &fname_out, int verbose_level)
void report_decomposition_by_single_automorphism(projective_geometry::projective_space_with_action *PA, int *Elt, std::ostream &ost, std::string &fname_base, int verbose_level)
void report_decomposition_by_group(projective_geometry::projective_space_with_action *PA, groups::strong_generators *SG, std::ostream &ost, std::string &fname_base, int verbose_level)
projective space PG(n,q) with automorphism group PGGL(n+1,q)
#define FREE_int(p)
Definition: foundations.h:640
#define NEW_OBJECT(type)
Definition: foundations.h:638
#define FREE_OBJECT(p)
Definition: foundations.h:651
#define NEW_int(n)
Definition: foundations.h:625
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
#define Int_vec_copy(A, B, C)
Definition: foundations.h:693
the orbiter library for the classification of combinatorial objects