Orbiter 2022
Combinatorial Objects
action_io.cpp
Go to the documentation of this file.
1/*
2 * action_io.cpp
3 *
4 * Created on: Mar 30, 2019
5 * Author: betten
6 */
7
8
9
10
12#include "group_actions.h"
13
14using namespace std;
15
16
17namespace orbiter {
18namespace layer3_group_actions {
19namespace actions {
20
21
22void action::report(ostream &ost, int f_sims, groups::sims *S,
23 int f_strong_gens, groups::strong_generators *SG,
25 int verbose_level)
26{
27 int f_v = (verbose_level >= 1);
28
29 if (f_v) {
30 cout << "action::report" << endl;
31 }
32
33 ost << "\\section*{The Action}" << endl;
34
35 ost << "Group action $" << label_tex
36 << "$ of degree " << degree << "\\\\" << endl;
37
38 if (degree < 100) {
39 ost << "We act on the following set:\\\\" << endl;
41 }
42
43 if (is_matrix_group()) {
44 ost << "The group is a matrix group.\\\\" << endl;
47
48 M = get_matrix_group();
49 F = M->GFq;
50
51
52 {
54
56
57 P->projective_space_init(M->n - 1, F, TRUE, verbose_level);
58
59 ost << "The base action is on projective space ${\\rm PG}(" << M->n - 1 << ", " << F->q << ")$\\\\" << endl;
60
61 P->report_summary(ost);
62
63
64
65 FREE_OBJECT(P);
66 }
67
68 ost << "\\subsection*{The finite field ${\\mathbb F}_{" << F->q << "}$}" << endl;
69
70 F->cheat_sheet(ost, verbose_level);
71
72 ost << endl << "\\bigskip" << endl << endl;
73
74
75 }
76
77 if (type_G == wreath_product_t) {
79
81 if (f_v) {
82 cout << "action::report before W->report" << endl;
83 }
84 W->report(ost, verbose_level);
85 if (f_v) {
86 cout << "action::report after W->report" << endl;
87 }
88 }
89
90 ost << "\\subsection*{Base and Stabilizer Chain}" << endl;
91
92 if (f_sims) {
93 if (f_v) {
94 cout << "action::report printing group order" << endl;
95 }
97
98 S->group_order(go);
99 ost << "Group order " << go << "\\\\" << endl;
100 ost << "tl=$";
101 //int_vec_print(ost, S->orbit_len, base_len());
102 for (int t = 0; t < S->A->base_len(); t++) {
103 ost << S->get_orbit_length(t);
104 if (t < S->A->base_len()) {
105 ost << ", ";
106 }
107 }
108 ost << "$\\\\" << endl;
109 if (f_v) {
110 cout << "action::report printing group order done" << endl;
111 }
112 }
113
114 if (Stabilizer_chain) {
115 if (base_len()) {
116 ost << "Base: $";
118 ost << "$\\\\" << endl;
119 }
120 if (f_strong_gens) {
121 ost << "{\\small\\arraycolsep=2pt" << endl;
122 SG->print_generators_tex(ost);
123 ost << "}" << endl;
124 }
125 else {
126 ost << "Does not have strong generators.\\\\" << endl;
127 }
128 }
129 if (f_sims) {
130 if (f_v) {
131 cout << "action::report before S->report" << endl;
132 }
133 S->report(ost, label, LG_Draw_options, 0 /*verbose_level - 2*/);
134 if (f_v) {
135 cout << "action::report after S->report" << endl;
136 }
137 }
138 if (Stabilizer_chain) {
139 if (f_strong_gens) {
140
141 ost << "GAP export: \\\\" << endl;
142 ost << "\\begin{verbatim}" << endl;
143 SG->print_generators_gap(ost);
144 ost << "\\end{verbatim}" << endl;
145
146
147 ost << "Magma export: \\\\" << endl;
148 ost << "\\begin{verbatim}" << endl;
149 SG->export_magma(this, ost, verbose_level);
150 ost << "\\end{verbatim}" << endl;
151
152 ost << "Compact form: \\\\" << endl;
153 ost << "\\begin{verbatim}" << endl;
155 ost << "\\end{verbatim}" << endl;
156
157}
158 }
159 if (f_v) {
160 cout << "action::report done" << endl;
161 }
162}
163
166 int verbose_level)
167{
168 int f_v = (verbose_level >= 1);
169
170 if (f_v) {
171 cout << "action::report_what_we_act_on" << endl;
172 }
173 if (is_matrix_group()) {
174
177
178 M = get_matrix_group();
179 F = M->GFq;
180
181 {
183
185
186 P->projective_space_init(M->n - 1, F, TRUE, verbose_level);
187
188 ost << "\\section*{The Group Acts on Projective Space ${\\rm PG}(" << M->n - 1 << ", " << F->q << ")$}" << endl;
189
190 P->report(ost, O, verbose_level);
191
192
193
194 FREE_OBJECT(P);
195 }
196
197 }
198 if (f_v) {
199 cout << "action::report_what_we_act_on done" << endl;
200 }
201}
202
204 std::string &prefix,
205 int level, int orbit_at_level, int level_of_candidates_file,
206 void (*early_test_func_callback)(long int *S, int len,
207 long int *candidates, int nb_candidates,
208 long int *good_candidates, int &nb_good_candidates,
209 void *data, int verbose_level),
210 void *early_test_func_callback_data,
211 long int *&starter,
212 int &starter_sz,
213 groups::sims *&Stab,
214 groups::strong_generators *&Strong_gens,
215 long int *&candidates,
216 int &nb_candidates,
217 int &nb_cases,
218 int verbose_level)
219// A needs to be the base action
220{
221 int f_v = (verbose_level >= 1);
222 int f_vv = (verbose_level >= 2);
223 long int *candidates1;
224 int nb_candidates1;
225 int h; //, i;
226
227 if (f_v) {
228 cout << "action::read_orbit_rep_and_candidates_from_files_and_process" << endl;
229 }
230
231 if (f_v) {
232 cout << "action::read_orbit_rep_and_candidates_from_files_and_process before read_orbit_rep_and_candidates_from_files" << endl;
233 }
235 level, orbit_at_level, level_of_candidates_file,
236 starter,
237 starter_sz,
238 Stab,
240 candidates1,
241 nb_candidates1,
242 nb_cases,
243 verbose_level);
244 if (f_v) {
245 cout << "action::read_orbit_rep_and_candidates_from_files_and_process after read_orbit_rep_and_candidates_from_files" << endl;
246 }
247
248 for (h = level_of_candidates_file; h < level; h++) {
249
250 long int *candidates2;
251 int nb_candidates2;
252
253 if (f_vv) {
254 cout << "action::read_orbit_rep_and_candidates_from_files_and_process "
255 "testing candidates at level " << h
256 << " number of candidates = " << nb_candidates1 << endl;
257 }
258 candidates2 = NEW_lint(nb_candidates1);
259
260 (*early_test_func_callback)(starter, h + 1,
261 candidates1, nb_candidates1,
262 candidates2, nb_candidates2,
263 early_test_func_callback_data, verbose_level - 1);
264
265 if (f_vv) {
266 cout << "action::read_orbit_rep_and_candidates_from_files_and_process "
267 "number of candidates at level " << h + 1
268 << " reduced from " << nb_candidates1 << " to "
269 << nb_candidates2 << " by "
270 << nb_candidates1 - nb_candidates2 << endl;
271 }
272
273 Lint_vec_copy(candidates2, candidates1, nb_candidates2);
274 nb_candidates1 = nb_candidates2;
275
276 FREE_lint(candidates2);
277 }
278
279 candidates = candidates1;
280 nb_candidates = nb_candidates1;
281
282 if (f_v) {
283 cout << "action::read_orbit_rep_and_candidates_from_files_and_process "
284 "done" << endl;
285 }
286}
287
289 std::string &prefix,
290 int level, int orbit_at_level, int level_of_candidates_file,
291 long int *&starter,
292 int &starter_sz,
293 groups::sims *&Stab,
294 groups::strong_generators *&Strong_gens,
295 long int *&candidates,
296 int &nb_candidates,
297 int &nb_cases,
298 int verbose_level)
299// A needs to be the base action
300{
301 int f_v = (verbose_level >= 1);
302 int orbit_at_candidate_level = -1;
304
305
306 if (f_v) {
307 cout << "action::read_orbit_rep_and_candidates_from_files prefix=" << prefix << endl;
308 }
309
310 {
311 candidates = NULL;
312 //longinteger_object stab_go;
313
314 string fname1;
315 char str[1000];
316 sprintf(str, "_lvl_%d", level);
317 fname1.assign(prefix);
318 fname1.append(str);
319
320 if (f_v) {
321 cout << "action::read_orbit_rep_and_candidates_from_files before read_set_and_stabilizer fname1=" << fname1 << endl;
322 }
324 orbit_at_level, starter, starter_sz, Stab,
326 nb_cases,
327 verbose_level);
328 if (f_v) {
329 cout << "action::read_orbit_rep_and_candidates_from_files after read_set_and_stabilizer" << endl;
330 }
331
332
333
334 //Stab->group_order(stab_go);
335
336 if (f_v) {
337 cout << "action::read_orbit_rep_and_candidates_from_files "
338 "Read starter " << orbit_at_level << " / "
339 << nb_cases << " : ";
340 Lint_vec_print(cout, starter, starter_sz);
341 cout << endl;
342 //cout << "read_orbit_rep_and_candidates_from_files "
343 //"Group order=" << stab_go << endl;
344 }
345
346 if (level == level_of_candidates_file) {
347 orbit_at_candidate_level = orbit_at_level;
348 }
349 else {
350 // level_of_candidates_file < level
351 // Now, we need to find out the orbit representative
352 // at level_of_candidates_file
353 // that matches with the prefix of starter
354 // so that we can retrieve it's set of candidates.
355 // Once we have the candidates for the prefix, we run it through the
356 // test function to find the candidate set of starter as a subset
357 // of this set.
358
359 orbit_at_candidate_level = Fio.find_orbit_index_in_data_file(prefix,
360 level_of_candidates_file, starter,
361 verbose_level);
362 }
363 if (f_v) {
364 cout << "action::read_orbit_rep_and_candidates_from_files "
365 "Found starter, orbit_at_candidate_level="
366 << orbit_at_candidate_level << endl;
367 }
368
369
370 // read the set of candidates from the binary file:
371
372 if (f_v) {
373 cout << "action::read_orbit_rep_and_candidates_from_files "
374 "before generator_read_candidates_of_orbit" << endl;
375 }
376 string fname2;
377 fname2.assign(prefix);
378 sprintf(str, "_lvl_%d_candidates.bin", level_of_candidates_file);
379 fname2.append(str);
380
381
382 if (f_v) {
383 cout << "action::read_orbit_rep_and_candidates_from_files "
384 "before Fio.poset_classification_read_candidates_of_orbit" << endl;
385 }
387 fname2, orbit_at_candidate_level,
388 candidates, nb_candidates, verbose_level - 1);
389
390 if (f_v) {
391 cout << "action::read_orbit_rep_and_candidates_from_files "
392 "after Fio.poset_classification_read_candidates_of_orbit" << endl;
393 }
394
395
396 if (candidates == NULL) {
397 cout << "action::read_orbit_rep_and_candidates_from_files "
398 "could not read the candidates" << endl;
399 exit(1);
400 }
401 if (f_v) {
402 cout << "action::read_orbit_rep_and_candidates_from_files "
403 "Found " << nb_candidates << " candidates at level "
404 << level_of_candidates_file << endl;
405 }
406 }
407 if (f_v) {
408 cout << "action::read_orbit_rep_and_candidates_from_files done" << endl;
409 }
410}
411
412
413void action::read_representatives(std::string &fname,
414 int *&Reps, int &nb_reps, int &size, int verbose_level)
415{
416 int f_casenumbers = FALSE;
417 int nb_cases;
418 int *Set_sizes;
419 long int **Sets;
420 char **Ago_ascii;
421 char **Aut_ascii;
422 int *Casenumbers;
423 int i, j;
425
426 cout << "action::read_file_and_print_representatives "
427 "reading file " << fname << endl;
428
430 f_casenumbers,
431 nb_cases,
432 Set_sizes, Sets, Ago_ascii, Aut_ascii,
433 Casenumbers,
434 0/*verbose_level*/);
435 nb_reps = nb_cases;
436 size = Set_sizes[0];
437 Reps = NEW_int(nb_cases * size);
438 for (i = 0; i < nb_cases; i++) {
439 for (j = 0; j < size; j++) {
440 Reps[i * size + j] = Sets[i][j];
441 }
442 }
443 Fio.free_data_fancy(nb_cases,
444 Set_sizes, Sets,
445 Ago_ascii, Aut_ascii,
446 Casenumbers);
447}
448
450 std::string &fname, int *&Reps,
451 char **&Aut_ascii, int &nb_reps, int &size, int verbose_level)
452{
453 int f_casenumbers = FALSE;
454 int nb_cases;
455 int *Set_sizes;
456 long int **Sets;
457 char **Ago_ascii;
458 //char **Aut_ascii;
459 int *Casenumbers;
460 int i, j;
462
463
464 cout << "action::read_file_and_print_representatives "
465 "reading file " << fname << endl;
466
468 f_casenumbers,
469 nb_cases,
470 Set_sizes, Sets, Ago_ascii, Aut_ascii,
471 Casenumbers,
472 0/*verbose_level*/);
473 nb_reps = nb_cases;
474 size = Set_sizes[0];
475 Reps = NEW_int(nb_cases * size);
476 for (i = 0; i < nb_cases; i++) {
477 for (j = 0; j < size; j++) {
478 Reps[i * size + j] = Sets[i][j];
479 }
480 }
481 Fio.free_data_fancy(nb_cases,
482 Set_sizes, Sets,
483 Ago_ascii, NULL /*Aut_ascii*/,
484 Casenumbers);
485}
486
488 std::string &fname, int f_print_stabilizer_generators, int verbose_level)
489{
490 int f_v = (verbose_level >= 1);
491 int f_casenumbers = FALSE;
492 int nb_cases;
493 int *Set_sizes;
494 long int **Sets;
495 char **Ago_ascii;
496 char **Aut_ascii;
497 int *Casenumbers;
498 int i;
500
501 if (f_v) {
502 cout << "action::read_file_and_print_representatives "
503 "reading file "
504 << fname << endl;
505 }
506
508 f_casenumbers,
509 nb_cases,
510 Set_sizes, Sets, Ago_ascii, Aut_ascii,
511 Casenumbers,
512 0/*verbose_level*/);
513 for (i = 0; i < nb_cases; i++) {
514 cout << "Orbit " << i << " representative ";
515 Lint_vec_print(cout, Sets[i], Set_sizes[i]);
516 cout << endl;
517
520 int *tl;
521
523 G->init(this, verbose_level - 2);
524 G->init_ascii_coding_to_sims(Aut_ascii[i], verbose_level - 2);
525
526
528
529 G->S->group_order(go);
530
532 tl = NEW_int(base_len());
533 G->S->extract_strong_generators_in_order(*gens, tl,
534 0 /* verbose_level */);
535 cout << "Stabilizer has order " << go << " tl=";
536 Int_vec_print(cout, tl, base_len());
537 cout << endl;
538
539 if (f_print_stabilizer_generators) {
540 cout << "The stabilizer is generated by:" << endl;
541 gens->print(cout);
542 }
543
544 FREE_OBJECT(G);
545 FREE_OBJECT(gens);
546 FREE_int(tl);
547
548 }
549 Fio.free_data_fancy(nb_cases,
550 Set_sizes, Sets,
551 Ago_ascii, Aut_ascii,
552 Casenumbers);
553
554}
555
556void action::read_set_and_stabilizer(std::string &fname,
557 int no, long int *&set, int &set_sz, groups::sims *&stab,
558 groups::strong_generators *&Strong_gens,
559 int &nb_cases,
560 int verbose_level)
561{
562 int f_v = (verbose_level >= 1);
563 int f_vv = (verbose_level >= 2);
564 int f_casenumbers = FALSE;
565 //int nb_cases;
566 int *Set_sizes;
567 long int **Sets;
568 char **Ago_ascii;
569 char **Aut_ascii;
570 int *Casenumbers;
572 int i;
574
575
576 if (f_v) {
577 cout << "action::read_set_and_stabilizer "
578 "reading file " << fname
579 << " no=" << no << endl;
580 }
581
583 f_casenumbers,
584 nb_cases,
585 Set_sizes, Sets, Ago_ascii, Aut_ascii,
586 Casenumbers,
587 verbose_level - 1);
588
589 if (f_vv) {
590 cout << "action::read_set_and_stabilizer "
591 "after read_and_parse_data_file_fancy" << endl;
592 cout << "Aut_ascii[no]=" << Aut_ascii[no] << endl;
593 cout << "Set_sizes[no]=" << Set_sizes[no] << endl;
594 }
595
596 set_sz = Set_sizes[no];
597 set = NEW_lint(set_sz);
598 for (i = 0; i < set_sz; i ++) {
599 set[i] = Sets[no][i];
600 }
601
602
604 G->init(this, verbose_level - 2);
605 if (f_vv) {
606 cout << "action::read_set_and_stabilizer "
607 "before G->init_ascii_coding_to_sims" << endl;
608 }
609 G->init_ascii_coding_to_sims(Aut_ascii[no], verbose_level - 2);
610 if (f_vv) {
611 cout << "action::read_set_and_stabilizer "
612 "after G->init_ascii_coding_to_sims" << endl;
613 }
614
615 stab = G->S;
616 G->S = NULL;
617 G->f_has_sims = FALSE;
618
620
621 stab->group_order(go);
622
623
625 Strong_gens->init_from_sims(stab, 0);
627
628 if (f_vv) {
629 cout << "action::read_set_and_stabilizer "
630 "Group order=" << go << endl;
631 }
632
633 FREE_OBJECT(G);
634 if (f_vv) {
635 cout << "action::read_set_and_stabilizer "
636 "after FREE_OBJECT G" << endl;
637 }
638 Fio.free_data_fancy(nb_cases,
639 Set_sizes, Sets,
640 Ago_ascii, Aut_ascii,
641 Casenumbers);
642 if (f_v) {
643 cout << "action::read_set_and_stabilizer done" << endl;
644 }
645
646}
647
648
651 ostream &ost)
652{
653 int i, j, a, len;
654
655 len = gens->len;
656 for (j = 0; j < len; j++) {
657 ost << " & \\alpha_{" << j << "}";
658 }
659 ost << "\\\\" << endl;
660 for (i = 0; i < degree; i++) {
661 ost << setw(3) << i;
662 for (j = 0; j < len; j++) {
663 a = element_image_of(i,
664 gens->ith(j), 0 /* verbose_level */);
665 ost << " & " << setw(3) << a;
666 }
667 ost << "\\\\" << endl;
668 }
669}
670
672{
673 action_global AG;
674
676 if (f_has_subaction) {
677 ost << "->";
679 }
680 //else {
681 //ost << "no subaction";
682 //}
683
684}
685
686
688{
689 cout << "ACTION " << label << " degree=" << degree << " of type ";
691 cout << endl;
692 cout << "low_level_point_size=" << low_level_point_size;
693 cout << ", f_has_sims=" << f_has_sims;
694 cout << ", f_has_strong_generators=" << f_has_strong_generators;
695 cout << endl;
696
697 if (f_is_linear) {
698 cout << "linear of dimension " << dimension << endl;
699 }
700 else {
701 cout << "the action is not linear" << endl;
702 }
703
704 if (Stabilizer_chain) {
705 if (base_len()) {
706 cout << "base: ";
707 Lint_vec_print(cout, get_base(), base_len());
708 cout << endl;
709 }
710 }
711 else {
712 cout << "The action does not have a stabilizer chain" << endl;
713 }
714 if (f_has_sims) {
715 cout << "has sims" << endl;
717
718 Sims->group_order(go);
719 cout << "Order " << go << " = ";
720 //int_vec_print(cout, Sims->orbit_len, base_len());
721 for (int t = 0; t < base_len(); t++) {
722 cout << Sims->get_orbit_length(t);
723 if (t < base_len() - 1) {
724 cout << " * ";
725 }
726 }
727 //cout << endl;
728 }
729 cout << endl;
730
731}
732
734{
735 int i;
736
737 if (Stabilizer_chain) {
738 ost << "The base has length " << base_len() << "\\\\" << endl;
739 ost << "The basic orbits are: \\\\" << endl;
740 for (i = 0; i < base_len(); i++) {
741 ost << "Basic orbit " << i << " is orbit of " << base_i(i)
742 << " of length " << transversal_length_i(i) << "\\\\" << endl;
743 }
744 }
745 else {
746 cout << "action " << label << " does not have a base" << endl;
747 }
748}
749
751{
752 if (Stabilizer_chain) {
753 cout << "action " << label << " has base ";
754 Lint_vec_print(cout, get_base(), base_len());
755 cout << endl;
756 }
757 else {
758 cout << "action " << label << " does not have a base" << endl;
759 }
760}
761
762void action::print_bare_base(std::ofstream &ost)
763{
764 if (Stabilizer_chain) {
766 }
767 else {
768 cout << "action " << label << " does not have a base" << endl;
769 exit(1);
770 }
771}
772
773void action::latex_all_points(std::ostream &ost)
774{
775 int i;
776 int *v;
777
778
779 if (ptr->ptr_unrank_point == NULL) {
780 cout << "action::latex_all_points ptr->ptr_unrank_point == NULL" << endl;
781 return;
782 }
784#if 0
785 cout << "action::latex_all_points "
786 "low_level_point_size=" << low_level_point_size << endl;
787 ost << "{\\renewcommand*{\\arraystretch}{1.5}" << endl;
788 ost << "$$" << endl;
789 ost << "\\begin{array}{|c|c|}" << endl;
790 ost << "\\hline" << endl;
791 ost << "i & P_{i}\\\\" << endl;
792 ost << "\\hline" << endl;
793 ost << "\\hline" << endl;
794 for (i = 0; i < degree; i++) {
795 unrank_point(i, v);
796 ost << i << " & ";
797 int_vec_print(ost, v, low_level_point_size);
798 ost << "\\\\" << endl;
799 if (((i + 1) % 10) == 0) {
800 ost << "\\hline" << endl;
801 ost << "\\end{array}" << endl;
802 if (((i + 1) % 50) == 0) {
803 ost << "$$" << endl;
804 ost << "$$" << endl;
805 }
806 else {
807 ost << ", \\;" << endl;
808 }
809 ost << "\\begin{array}{|c|c|}" << endl;
810 ost << "\\hline" << endl;
811 ost << "i & P_{i}\\\\" << endl;
812 ost << "\\hline" << endl;
813 ost << "\\hline" << endl;
814 }
815 }
816 ost << "\\hline" << endl;
817 ost << "\\end{array}" << endl;
818 ost << "$$}%" << endl;
819 cout << "action::latex_all_points done" << endl;
820#else
821 if (low_level_point_size < 10) {
822 ost << "\\begin{multicols}{2}" << endl;
823 }
824 ost << "\\noindent" << endl;
825 for (i = 0; i < degree; i++) {
826 unrank_point(i, v);
827 ost << i << " = ";
829 ost << "\\\\" << endl;
830 }
831 if (low_level_point_size < 10) {
832 ost << "\\end{multicols}" << endl;
833 }
834
835#endif
836
837 FREE_int(v);
838}
839
840void action::latex_point_set(std::ostream &ost, long int *set, int sz, int verbose_level)
841{
842 int f_v = (verbose_level >= 1);
843 int i;
844 int *v;
845
846 if (f_v) {
847 cout << "action::print_points "
848 "low_level_point_size=" << low_level_point_size << endl;
849 }
851#if 0
852 ost << "{\\renewcommand*{\\arraystretch}{1.5}" << endl;
853 ost << "$$" << endl;
854 ost << "\\begin{array}{|c|c|}" << endl;
855 ost << "\\hline" << endl;
856 ost << "i & P_{i} \\\\" << endl;
857 ost << "\\hline" << endl;
858 ost << "\\hline" << endl;
859 for (i = 0; i < sz; i++) {
860 unrank_point(set[i], v);
861 ost << i << " & ";
862 ost << set[i] << " = ";
863 int_vec_print(ost, v, low_level_point_size);
864 ost << "\\\\" << endl;
865 if (((i + 1) % 10) == 0) {
866 ost << "\\hline" << endl;
867 ost << "\\end{array}" << endl;
868 if (((i + 1) % 50) == 0) {
869 ost << "$$" << endl;
870 ost << "$$" << endl;
871 }
872 else {
873 ost << ", \\;" << endl;
874 }
875 ost << "\\begin{array}{|c|c|}" << endl;
876 ost << "\\hline" << endl;
877 ost << "i & P_{i}\\\\" << endl;
878 ost << "\\hline" << endl;
879 ost << "\\hline" << endl;
880 }
881 }
882 ost << "\\hline" << endl;
883 ost << "\\end{array}" << endl;
884 ost << "$$}%" << endl;
885#else
886
887 if (low_level_point_size < 10) {
888 ost << "\\begin{multicols}{2}" << endl;
889 }
890 ost << "\\noindent" << endl;
891 for (i = 0; i < sz; i++) {
892 unrank_point(set[i], v);
893 ost << i << " : ";
894 ost << set[i] << " = ";
896 ost << "\\\\" << endl;
897 }
898 if (low_level_point_size < 10) {
899 ost << "\\end{multicols}" << endl;
900 }
901#endif
902
903 FREE_int(v);
904 if (f_v) {
905 cout << "action::print_points done" << endl;
906 }
907}
908
909
911{
913 group_order(go);
914 cout << go;
915}
916
918{
919 int i;
920
922 group_order(go);
923 cout << go << " =";
924 if (Stabilizer_chain) {
925 for (i = 0; i < base_len(); i++) {
926 cout << " " << transversal_length_i(i);
927 }
928 }
929 else {
930 cout << "action " << label << " does not have a base" << endl;
931 }
932
933}
934
936{
937 int i, l;
938
939 l = v.len;
940 cout << "vector of " << l << " group elements:" << endl;
941 for (i = 0; i < l; i++) {
942 cout << i << " : " << endl;
943 element_print_quick(v.ith(i), cout);
944 cout << endl;
945 }
946}
947
949{
950 int i, l;
951
952 l = v.len;
953 cout << "vector of " << l << " group elements:" << endl;
954 for (i = 0; i < l; i++) {
955 cout << i << " : ";
957 cout << endl;
958 }
959}
960
961
962void action::write_set_of_elements_latex_file(std::string &fname, std::string &title, int *Elt, int nb_elts)
963{
964 {
965 ofstream ost(fname);
967
968 char c_title[1000];
969 char author[1000];
970
971 snprintf(c_title, 1000, "%s", title.c_str());
972 //strcpy(author, "");
973 author[0] = 0;
974
975
977
978 L.head(ost,
979 FALSE /* f_book*/,
980 TRUE /* f_title */,
981 c_title, author,
982 FALSE /* f_toc */,
983 FALSE /* f_landscape */,
984 TRUE /* f_12pt */,
985 TRUE /* f_enlarged_page */,
986 TRUE /* f_pagenumbers */,
987 NULL /* extra_praeamble */);
988
989
990 //Nth->report(ost, verbose_level);
991
992 int i;
993
994 for (i = 0; i < nb_elts; i++) {
995 ost << "$$" << endl;
996 element_print_latex(Elt + i * elt_size_in_int, ost);
997 ost << "$$" << endl;
998 }
999
1000 L.foot(ost);
1001
1002
1003 }
1004
1006
1007 cout << "Written file " << fname << " of size " << Fio.file_size(fname) << endl;
1008
1009}
1010
1012 std::string &fname, std::string &label,
1013 groups::strong_generators *SG, int verbose_level)
1014{
1015 int f_v = (verbose_level >= 1);
1016 int i, j;
1017 long int a;
1020
1021 if (f_v) {
1022 cout << "action::export_to_orbiter" << endl;
1023 }
1024
1025 SG->group_order(go);
1026 if (f_v) {
1027 cout << "action::export_to_orbiter go = " << go << endl;
1028 cout << "action::export_to_orbiter number of generators = " << SG->gens->len << endl;
1029 cout << "action::export_to_orbiter degree = " << degree << endl;
1030 }
1031 {
1032 ofstream fp(fname);
1033
1034 fp << "GENERATORS_" << label << " = \\" << endl;
1035 for (i = 0; i < SG->gens->len; i++) {
1036 fp << "\t\"";
1037 for (j = 0; j < degree; j++) {
1038 if (FALSE) {
1039 cout << "action::export_to_orbiter computing image of " << j << " under generator " << i << endl;
1040 }
1041 a = element_image_of(j, SG->gens->ith(i), 0 /* verbose_level*/);
1042 fp << a;
1043 if (j < degree - 1 || i < SG->gens->len - 1) {
1044 fp << ",";
1045 }
1046 }
1047 fp << "\"";
1048 if (i < SG->gens->len - 1) {
1049 fp << "\\" << endl;
1050 }
1051 else {
1052 fp << endl;
1053 }
1054 }
1055
1056 fp << endl;
1057 fp << label << ":" << endl;
1058 fp << "\t$(ORBITER_PATH)orbiter.out -v 2 \\" << endl;
1059 fp << "\t-define G -permutation_group -symmetric_group " << degree << " \\" << endl;
1060 fp << "\t-subgroup_by_generators " << label << " " << go << " " << SG->gens->len << " $(GENERATORS_" << label << ") -end \\" << endl;
1061
1062 // $(ORBITER_PATH)orbiter.out -v 10
1063 // -define G -permutation_group -symmetric_group 13
1064 // -subgroup_by_generators H5 5 1 $(GENERATORS_H5) -end
1065 // with backslashes at the end of the line
1066
1067 }
1068 cout << "Written file " << fname << " of size "
1069 << Fio.file_size(fname) << endl;
1070
1071 if (f_v) {
1072 cout << "action::export_to_orbiter" << endl;
1073 }
1074}
1075
1076
1078 std::string &fname, std::string &label, std::string &label_tex,
1079 groups::strong_generators *SG, int verbose_level)
1080{
1081 int f_v = (verbose_level >= 1);
1082#if 0
1083 int i, j;
1084 long int a;
1085 file_io Fio;
1086 longinteger_object go;
1087#endif
1088
1089 if (f_v) {
1090 cout << "action::export_to_orbiter_as_bsgs" << endl;
1091 }
1092
1093
1095 this,
1096 fname, label, label_tex,
1097 verbose_level);
1098
1099#if 0
1100 SG->group_order(go);
1101 if (f_v) {
1102 cout << "action::export_to_orbiter_as_bsgs go = " << go << endl;
1103 cout << "action::export_to_orbiter_as_bsgs number of generators = " << SG->gens->len << endl;
1104 cout << "action::export_to_orbiter_as_bsgs degree = " << degree << endl;
1105 }
1106 {
1107 ofstream fp(fname);
1108
1109 for (i = 0; i < SG->gens->len; i++) {
1110 fp << "GENERATOR_" << label << "_" << i << " = \\" << endl;
1111 fp << "\t\"";
1112 for (j = 0; j < degree; j++) {
1113 if (FALSE) {
1114 cout << "action::export_to_orbiter_as_bsgs computing image of " << j << " under generator " << i << endl;
1115 }
1116 a = element_image_of(j, SG->gens->ith(i), 0 /* verbose_level*/);
1117 fp << a;
1118 if (j < degree - 1) {
1119 fp << ",";
1120 }
1121 }
1122 fp << "\"";
1123 fp << endl;
1124 }
1125
1126 fp << endl;
1127 fp << label << ":" << endl;
1128 fp << "\t$(ORBITER_PATH)orbiter.out -v 2 \\" << endl;
1129 fp << "\t\t-define G -permutation_group \\" << endl;
1130 fp << "\t\t-bsgs " << label << " " << label_tex << " "
1131 << degree << " " << go << " ";
1132 fp << "\"";
1133 SG->A->print_bare_base(fp);
1134 fp << "\"";
1135 fp << " ";
1136 fp << SG->gens->len;
1137 fp << " \\" << endl;
1138 for (i = 0; i < SG->gens->len; i++) {
1139 fp << "\t\t\t" << "$(GENERATOR_" << label << "_" << i << ") \\" << endl;
1140 }
1141 fp << "\t\t-end" << endl;
1142
1143 //$(ORBITER_PATH)orbiter.out -v 10 \
1144 // -define G -permutation_group \
1145 // -bsgs C13 C_{13} 13 13 0 1 \
1146 // $(GEN_C13) \
1147 // -end \
1148
1149 // with backslashes at the end of the line
1150
1151 }
1152 cout << "Written file " << fname << " of size "
1153 << Fio.file_size(fname) << endl;
1154#endif
1155
1156 if (f_v) {
1157 cout << "action::export_to_orbiter_as_bsgs" << endl;
1158 }
1159}
1160
1161
1162
1163
1164}}}
1165
void print_bare_fully(std::ostream &ost, long int *v, int len)
Definition: lint_vec.cpp:315
void cheat_sheet(std::ostream &f, int verbose_level)
projective space PG(n,q) of dimension n over Fq
Definition: geometry.h:1916
void report(std::ostream &ost, graphics::layered_graph_draw_options *O, int verbose_level)
void projective_space_init(int n, field_theory::finite_field *F, int f_init_incidence_structure, int verbose_level)
options for drawing an object of type layered_graph
Definition: graphics.h:457
void read_and_parse_data_file_fancy(std::string &fname, int f_casenumbers, int &nb_cases, int *&Set_sizes, long int **&Sets, char **&Ago_ascii, char **&Aut_ascii, int *&Casenumbers, int verbose_level)
Definition: file_io.cpp:2304
void poset_classification_read_candidates_of_orbit(std::string &fname, int orbit_at_level, long int *&candidates, int &nb_candidates, int verbose_level)
Definition: file_io.cpp:191
void free_data_fancy(int nb_cases, int *Set_sizes, long int **Sets, char **Ago_ascii, char **Aut_ascii, int *Casenumbers)
Definition: file_io.cpp:2270
int find_orbit_index_in_data_file(std::string &prefix, int level_of_candidates_file, long int *starter, int verbose_level)
Definition: file_io.cpp:345
void head(std::ostream &ost, int f_book, int f_title, const char *title, const char *author, int f_toc, int f_landscape, int f_12pt, int f_enlarged_page, int f_pagenumbers, const char *extras_for_preamble)
a class to represent arbitrary precision integers
Definition: ring_theory.h:366
global functions related to group actions
Definition: actions.h:1015
void action_print_symmetry_group_type(std::ostream &ost, symmetry_group_type a)
void(* ptr_unrank_point)(action &A, long int rk, int *v)
Definition: actions.h:1116
void element_print_latex(void *elt, std::ostream &ost)
Definition: action_cb.cpp:364
void element_print_quick(void *elt, std::ostream &ost)
Definition: action_cb.cpp:353
void print_symmetry_group_type(std::ostream &ost)
Definition: action_io.cpp:671
void report(std::ostream &ost, int f_sims, groups::sims *S, int f_strong_gens, groups::strong_generators *SG, graphics::layered_graph_draw_options *LG_Draw_options, int verbose_level)
Definition: action_io.cpp:22
groups::strong_generators * Strong_gens
Definition: actions.h:130
stabilizer_chain_base_data * Stabilizer_chain
Definition: actions.h:178
void read_orbit_rep_and_candidates_from_files(std::string &prefix, int level, int orbit_at_level, int level_of_candidates_file, long int *&starter, int &starter_sz, groups::sims *&Stab, groups::strong_generators *&Strong_gens, long int *&candidates, int &nb_candidates, int &nb_cases, int verbose_level)
Definition: action_io.cpp:288
void export_to_orbiter(std::string &fname, std::string &label, groups::strong_generators *SG, int verbose_level)
Definition: action_io.cpp:1011
void read_orbit_rep_and_candidates_from_files_and_process(std::string &prefix, int level, int orbit_at_level, int level_of_candidates_file, void(*early_test_func_callback)(long int *S, int len, long int *candidates, int nb_candidates, long int *good_candidates, int &nb_good_candidates, void *data, int verbose_level), void *early_test_func_callback_data, long int *&starter, int &starter_sz, groups::sims *&Stab, groups::strong_generators *&Strong_gens, long int *&candidates, int &nb_candidates, int &nb_cases, int verbose_level)
Definition: action_io.cpp:203
void print_vector(data_structures_groups::vector_ge &v)
Definition: action_io.cpp:935
void read_file_and_print_representatives(std::string &fname, int f_print_stabilizer_generators, int verbose_level)
Definition: action_io.cpp:487
void read_set_and_stabilizer(std::string &fname, int no, long int *&set, int &set_sz, groups::sims *&stab, groups::strong_generators *&Strong_gens, int &nb_cases, int verbose_level)
Definition: action_io.cpp:556
void read_representatives(std::string &fname, int *&Reps, int &nb_reps, int &size, int verbose_level)
Definition: action_io.cpp:413
void latex_point_set(std::ostream &ost, long int *set, int sz, int verbose_level)
Definition: action_io.cpp:840
void group_order(ring_theory::longinteger_object &go)
Definition: action.cpp:2223
void report_what_we_act_on(std::ostream &ost, graphics::layered_graph_draw_options *O, int verbose_level)
Definition: action_io.cpp:164
groups::matrix_group * get_matrix_group()
Definition: action.cpp:2986
void export_to_orbiter_as_bsgs(std::string &fname, std::string &label, std::string &label_tex, groups::strong_generators *SG, int verbose_level)
Definition: action_io.cpp:1077
void write_set_of_elements_latex_file(std::string &fname, std::string &title, int *Elt, int nb_elts)
Definition: action_io.cpp:962
void element_print_as_permutation(void *elt, std::ostream &ost)
Definition: action_cb.cpp:421
void print_vector_as_permutation(data_structures_groups::vector_ge &v)
Definition: action_io.cpp:948
void print_group_order_long(std::ostream &ost)
Definition: action_io.cpp:917
long int element_image_of(long int a, void *elt, int verbose_level)
Definition: action_cb.cpp:198
void read_representatives_and_strong_generators(std::string &fname, int *&Reps, char **&Aut_ascii, int &nb_reps, int &size, int verbose_level)
Definition: action_io.cpp:449
void list_elements_as_permutations_vertically(data_structures_groups::vector_ge *gens, std::ostream &ost)
Definition: action_io.cpp:649
a matrix group over a finite field in projective, vector space or affine action
Definition: groups.h:318
a permutation group represented via a stabilizer chain
Definition: groups.h:1273
void group_order(ring_theory::longinteger_object &go)
Definition: sims.cpp:951
void report(std::ostream &ost, std::string &prefix, graphics::layered_graph_draw_options *LG_Draw_options, int verbose_level)
Definition: sims_io.cpp:760
a strong generating set for a permutation group with respect to a fixed action
Definition: groups.h:1703
void export_magma(actions::action *A, std::ostream &ost, int verbose_level)
void init_from_sims(groups::sims *S, int verbose_level)
void export_to_orbiter_as_bsgs(actions::action *A2, std::string &fname, std::string &label, std::string &label_tex, int verbose_level)
data_structures_groups::vector_ge * gens
Definition: groups.h:1708
void group_order(ring_theory::longinteger_object &go)
the wreath product group GL(d,q) wreath Sym(n)
Definition: groups.h:2093
void report(std::ostream &ost, int verbose_level)
#define Lint_vec_copy(A, B, C)
Definition: foundations.h:694
#define FREE_int(p)
Definition: foundations.h:640
#define NEW_OBJECT(type)
Definition: foundations.h:638
#define Lint_vec_print(A, B, C)
Definition: foundations.h:686
#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 FREE_lint(p)
Definition: foundations.h:642
#define NEW_lint(n)
Definition: foundations.h:628
#define Int_vec_print(A, B, C)
Definition: foundations.h:685
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects