Orbiter 2022
Combinatorial Objects
combinatorial_object_activity.cpp
Go to the documentation of this file.
1/*
2 * combinatorial_object_activity.cpp
3 *
4 * Created on: Mar 20, 2021
5 * Author: betten
6 */
7
8
9
10
11#include "orbiter.h"
12
13using namespace std;
14
15namespace orbiter {
16namespace layer5_applications {
17namespace apps_combinatorics {
18
19
20
22{
23 Descr = NULL;
24
26 GOC = NULL;
27
29 IS = NULL;
30
31}
32
34{
35}
36
37
41 int verbose_level)
42{
43 int f_v = (verbose_level >= 1);
44
45 if (f_v) {
46 cout << "combinatorial_object_activity::init" << endl;
47 }
48
52
53 if (f_v) {
54 cout << "combinatorial_object_activity::init done" << endl;
55 }
56}
57
58
59
63 int verbose_level)
64{
65 int f_v = (verbose_level >= 1);
66
67 if (f_v) {
68 cout << "combinatorial_object_activity::init_input_stream" << endl;
69 }
70
72 f_has_IS = TRUE;
74
75
76 if (f_v) {
77 cout << "combinatorial_object_activity::init_input_stream done" << endl;
78 }
79}
80
82{
83 int f_v = (verbose_level >= 1);
84
85 if (f_v) {
86 cout << "combinatorial_object_activity::perform_activity" << endl;
87 }
88 if (f_has_GOC) {
89 perform_activity_GOC(verbose_level);
90 }
91 else if (f_has_IS) {
92 perform_activity_IS(verbose_level);
93 }
94 if (f_v) {
95 cout << "combinatorial_object_activity::perform_activity done" << endl;
96 }
97}
98
99
101{
102 int f_v = (verbose_level >= 1);
103
104 if (f_v) {
105 cout << "combinatorial_object_activity::perform_activity_GOC" << endl;
106 }
107
108 if (Descr->f_line_type) {
109
110 if (f_v) {
111 cout << "combinatorial_object_activity::perform_activity_GOC f_line_type" << endl;
112 }
113
115
116 P = GOC->Descr->P;
117
118 int *type;
119
120 type = NEW_int(P->N_lines);
121
122
124 GOC->Pts, GOC->nb_pts, type, 0 /* verbose_level */);
125 // type[N_lines]
126
127
129
130 T.init(type, P->N_lines, FALSE, 0);
131
132 if (f_v) {
133 cout << "combinatorial_object_activity::perform_activity_GOC line type:" << endl;
134 T.print(TRUE /* f_backwards*/);
135 cout << endl;
136 }
137
138
139 }
140
141 if (Descr->f_conic_type) {
142
143 if (f_v) {
144 cout << "combinatorial_object_activity::perform_activity_GOC f_conic_type" << endl;
145 }
146
148
149 P = GOC->Descr->P;
150
151 long int **Pts_on_conic;
152 int **Conic_eqn;
153 int *nb_pts_on_conic;
154 int len;
155 int i;
156
157 P->conic_type(
158 GOC->Pts, GOC->nb_pts,
160 Pts_on_conic, Conic_eqn, nb_pts_on_conic, len,
161 verbose_level);
162
163
164 cout << "We found " << len << " conics" << endl;
165 for (i = 0; i < len; i++) {
166 cout << i << " : " << nb_pts_on_conic << endl;
167 }
168 //
169
170 }
171
173
174 if (f_v) {
175 cout << "combinatorial_object_activity::perform_activity_GOC f_conic_type" << endl;
176 }
177
179
180 P = GOC->Descr->P;
181
182 std::vector<int> Rk;
183
185 GOC->Pts, GOC->nb_pts,
186 Rk,
187 verbose_level);
188
189 cout << "We found " << Rk.size() << " non-conical 6 subsets" << endl;
190
191 }
192
193
194 if (Descr->f_ideal) {
195
196 if (f_v) {
197 cout << "combinatorial_object_activity::perform_activity_GOC f_ideal" << endl;
198 }
199
202
203 P = GOC->Descr->P;
204
206
207 if (f_v) {
208 cout << "combinatorial_object_activity::perform_activity_GOC before HPD->init" << endl;
209 }
210 HPD->init(P->F, P->n + 1, Descr->ideal_degree,
211 FALSE /* f_init_incidence_structure */,
212 t_PART /*Monomial_ordering_type*/,
213 verbose_level - 2);
214 if (f_v) {
215 cout << "combinatorial_object_activity::perform_activity_GOC after HPD->init" << endl;
216 }
217
218 int *Kernel;
219 //int *w1, *w2;
220 int r;
221
222 Kernel = NEW_int(HPD->get_nb_monomials() * HPD->get_nb_monomials());
223 //w1 = NEW_int(HPD->get_nb_monomials());
224 //w2 = NEW_int(HPD->get_nb_monomials());
225
226
227 if (f_v) {
228 cout << "combinatorial_object_activity::perform_activity_GOC the input set is:" << endl;
229 HPD->get_P()->print_set_numerical(cout, GOC->Pts, GOC->nb_pts);
230 }
231
232
233 if (f_v) {
234 cout << "combinatorial_object_activity::perform_activity_GOC before HPD->vanishing_ideal" << endl;
235 }
237 r, Kernel, verbose_level - 1);
238 if (f_v) {
239 cout << "combinatorial_object_activity::perform_activity_GOC after HPD->vanishing_ideal" << endl;
240 }
241
242 int h, ns;
243 int nb_pts;
244 long int *Pts;
245
246 ns = HPD->get_nb_monomials() - r; // dimension of null space
247
248 cout << "looping over all generators of the ideal:" << endl;
249 for (h = 0; h < ns; h++) {
250 cout << "generator " << h << " / " << ns << " is ";
251 Int_vec_print(cout, Kernel + h * HPD->get_nb_monomials(), HPD->get_nb_monomials());
252 cout << " : " << endl;
253
254 vector<long int> Points;
255 int i;
256
257 HPD->enumerate_points(Kernel + h * HPD->get_nb_monomials(),
258 Points, verbose_level);
259 nb_pts = Points.size();
260
261 Pts = NEW_lint(nb_pts);
262 for (i = 0; i < nb_pts; i++) {
263 Pts[i] = Points[i];
264 }
265
266
267 cout << "We found " << nb_pts << " points on the generator of the ideal" << endl;
268 cout << "They are : ";
269 Lint_vec_print(cout, Pts, nb_pts);
270 cout << endl;
271 HPD->get_P()->print_set_numerical(cout, Pts, nb_pts);
272
273#if 0
274 if (h == 0) {
275 size_out = HPD->get_nb_monomials();
276 set_out = NEW_lint(size_out);
277 //int_vec_copy(Kernel + h * HPD->nb_monomials, set_out, size_out);
278 int u;
279 for (u = 0; u < size_out; u++) {
280 set_out[u] = Kernel[h * HPD->get_nb_monomials() + u];
281 }
282 //break;
283 }
284#endif
285 FREE_lint(Pts);
286
287 } // next h
288
289 }
290
291
292 if (Descr->f_save) {
293
295 string fname;
296
297 fname.assign(GOC->label_txt);
298 fname.append(".txt");
299
300 if (f_v) {
301 cout << "We will write to the file " << fname << endl;
302 }
303 Fio.write_set_to_file(fname, GOC->Pts, GOC->nb_pts, verbose_level);
304 if (f_v) {
305 cout << "Written file " << fname << " of size "
306 << Fio.file_size(fname) << endl;
307 }
308 }
309
310 if (f_v) {
311 cout << "combinatorial_object_activity::perform_activity_GOC done" << endl;
312 }
313}
314
315
317{
318 int f_v = (verbose_level >= 1);
319
320 if (f_v) {
321 cout << "combinatorial_object_activity::perform_activity_IS" << endl;
322 }
323
325
326 if (f_v) {
327 cout << "combinatorial_object_activity::perform_activity_IS f_canonical_form_PG" << endl;
328 }
329
331
334 }
335 else {
336
337 int idx;
338
340
342
344 if (t != t_projective_space) {
345 cout << "combinatorial_object_activity::perform_activity_IS "
346 << Descr->canonical_form_PG_PG_label << " is not of type projective_space" << endl;
347 exit(1);
348 }
349
350
352 }
353
355
357
358 if (f_v) {
359 cout << "combinatorial_object_activity::perform_activity_IS before CO->perform_classification" << endl;
360 }
363 TRUE /* f_projective_space */, PA->P,
364 IS,
365 verbose_level);
366 if (f_v) {
367 cout << "combinatorial_object_activity::perform_activity_IS after CO->perform_classification" << endl;
368 }
369
370
371
373
374 if (f_v) {
375 cout << "combinatorial_object_activity::perform_activity_IS before post_process_classification" << endl;
376 }
378 CO,
379 OwP,
380 TRUE /* f_projective_space */, PA,
381 CO->Descr->label,
382 verbose_level);
383 if (f_v) {
384 cout << "combinatorial_object_activity::perform_activity_IS after post_process_classification" << endl;
385 }
386
387 if (Descr->f_report) {
388 if (f_v) {
389 cout << "combinatorial_object_activity::perform_activity_IS before classification_report" << endl;
390 }
392 CO,
393 OwP, verbose_level);
394 if (f_v) {
395 cout << "combinatorial_object_activity::perform_activity_IS after classification_report" << endl;
396 }
397 }
398
399 FREE_OBJECTS(OwP);
400 FREE_OBJECT(CO);
401
402
403
404 }
405 else if (Descr->f_canonical_form) {
406
407 if (f_v) {
408 cout << "combinatorial_object_activity::perform_activity_IS f_canonical_form" << endl;
409 }
410
411
412
414
416
417 if (f_v) {
418 cout << "combinatorial_object_activity::perform_activity_IS before CO->perform_classification" << endl;
419 }
422 FALSE /* f_projective_space */, NULL /* P */,
423 IS,
424 verbose_level);
425 if (f_v) {
426 cout << "combinatorial_object_activity::perform_activity_IS after CO->perform_classification" << endl;
427 }
428
429
431
432 if (f_v) {
433 cout << "combinatorial_object_activity::perform_activity_IS before post_process_classification" << endl;
434 }
436 CO,
437 OwP,
438 FALSE /* f_projective_space */, NULL,
439 CO->Descr->label,
440 verbose_level);
441 if (f_v) {
442 cout << "combinatorial_object_activity::perform_activity_IS after post_process_classification" << endl;
443 }
444
445 if (Descr->f_report) {
446 if (f_v) {
447 cout << "combinatorial_object_activity::perform_activity_IS before classification_report" << endl;
448 }
450 CO,
451 OwP, verbose_level);
452 if (f_v) {
453 cout << "combinatorial_object_activity::perform_activity_IS after classification_report" << endl;
454 }
455 }
456
457 FREE_OBJECTS(OwP);
458 FREE_OBJECT(CO);
459
460
461
462 }
464 if (f_v) {
465 cout << "combinatorial_object_activity::perform_activity_IS f_draw_incidence_matrices" << endl;
466 }
469 IS,
470 verbose_level);
471
472 }
474
475 if (f_v) {
476 cout << "combinatorial_object_activity::perform_activity_IS f_test_distinguishing_property" << endl;
477 }
478
479 int idx;
480
482
484
486 if (t != t_graph) {
487 cout << "combinatorial_object_activity::perform_activity_IS "
488 << Descr->test_distinguishing_property_graph << " is not of type graph" << endl;
489 exit(1);
490 }
491
492 //create_graph *Gr;
494
495 //Gr = (create_graph *) Orbiter->get_object(idx);
497
498#if 0
499 if (!Gr->f_has_CG) {
500 cout << "combinatorial_object_activity::perform_activity_IS !Gr->f_has_CG" << endl;
501 exit(1);
502 }
503#endif
504 int input_idx;
505 int *F_distinguishing;
506
507 F_distinguishing = NEW_int(IS->Objects.size());
508
509
510 for (input_idx = 0; input_idx < IS->Objects.size(); input_idx++) {
511
513
514 OwCF = (geometry::object_with_canonical_form *) IS->Objects[input_idx];
515
516 F_distinguishing[input_idx] = CG->test_distinguishing_property(OwCF->set, OwCF->sz, verbose_level);
517 }
518
520
521 T.init(F_distinguishing, IS->Objects.size(), FALSE, 0);
522 cout << "classification : ";
523 T.print_first(TRUE /* f_backwards*/);
524 cout << endl;
525
526 cout << "distinguishing sets are:";
527 for (input_idx = 0; input_idx < IS->Objects.size(); input_idx++) {
528 if (F_distinguishing[input_idx]) {
529 cout << input_idx << ", ";
530 }
531 }
532 cout << endl;
533
534 cout << "distinguishing sets are:";
535 for (input_idx = 0; input_idx < IS->Objects.size(); input_idx++) {
536 if (!F_distinguishing[input_idx]) {
537 continue;
538 }
539
541
542 OwCF = (geometry::object_with_canonical_form *) IS->Objects[input_idx];
543
544 OwCF->print(cout);
545
546 }
547 cout << endl;
548
549
550 FREE_int(F_distinguishing);
551
552 }
553 else if (Descr->f_save_as) {
554
555 if (f_v) {
556 cout << "combinatorial_object_activity::perform_activity_IS "
557 "f_save_as " << Descr->save_as_fname << endl;
558 }
559
561 FALSE, NULL, 0,
562 verbose_level);
563
564
565 }
566 else if (Descr->f_extract_subset) {
567
568 if (f_v) {
569 cout << "combinatorial_object_activity::perform_activity_IS "
570 "f_extract_subset " << Descr->extract_subset_fname << endl;
571 }
572 long int *extract_idx_set;
573 int extract_size;
574
576 extract_idx_set, extract_size, 0 /* verbose_level */);
578 TRUE /* f_extract */, extract_idx_set, extract_size,
579 verbose_level);
580
581
582 }
584
585 if (f_v) {
586 cout << "combinatorial_object_activity::perform_activity_IS "
587 "unpack_from_restricted_action "
590 }
591
595 IS,
596 verbose_level);
597
598 }
599
600 else if (Descr->f_line_covering_type) {
601
602 if (f_v) {
603 cout << "combinatorial_object_activity::perform_activity_IS "
604 "line_covering_type "
608 << endl;
609 }
610
615 IS,
616 verbose_level);
617
618 }
619
620
621
622}
623
624
625void combinatorial_object_activity::do_save(std::string &save_as_fname,
626 int f_extract, long int *extract_idx_set, int extract_size,
627 int verbose_level)
628{
629 int f_v = (verbose_level >= 1);
630
631 if (f_v) {
632 cout << "combinatorial_object_activity::do_save" << endl;
633 }
634 int input_idx;
635 int sz;
636 int N;
637
638 N = IS->Objects.size();
639
641
643
644 //OwCF->set;
645 sz = OwCF->sz;
646
647 for (input_idx = 0; input_idx < N; input_idx++) {
648
649 if (FALSE) {
650 cout << "combinatorial_object_activity::perform_activity_IS "
651 "input_idx = " << input_idx << " / " << IS->Objects.size() << endl;
652 }
653
655
656 OwCF = (geometry::object_with_canonical_form *) IS->Objects[input_idx];
657
658 //OwCF->set;
659 if (OwCF->sz != sz) {
660 cout << "the objects have different sizes, cannot save" << endl;
661 exit(1);
662 }
663
664
665 }
666
667 long int *Sets;
668
669 Sets = NEW_lint(N * sz);
670
671 for (input_idx = 0; input_idx < N; input_idx++) {
673
674 OwCF = (geometry::object_with_canonical_form *) IS->Objects[input_idx];
675
676 Lint_vec_copy(OwCF->set, Sets + input_idx * sz, sz);
677 }
678
679 cout << "The combined number of objects is " << N << endl;
680
681
682 if (f_extract) {
683 if (f_v) {
684 cout << "extracting subset of size " << extract_size << endl;
685 }
686 long int *Sets2;
687 int h, i;
688
689 Sets2 = NEW_lint(extract_size * sz);
690 for (h = 0; h < extract_size; h++) {
691 i = extract_idx_set[h];
692 Lint_vec_copy(Sets + i * sz, Sets2 + h * sz, sz);
693 }
694 FREE_lint(Sets);
695 Sets = Sets2;
696 if (f_v) {
697 cout << "number of sets is reduced from " << N << " to " << extract_size << endl;
698 }
699 N = extract_size;
700 }
701 else {
702
703 }
705
706 string fname_out;
707
708 fname_out.assign(save_as_fname);
709
710 Fio.lint_matrix_write_csv(fname_out, Sets, N, sz);
711
712 cout << "Written file " << fname_out << " of size " << Fio.file_size(fname_out) << endl;
713
714 if (f_v) {
715 cout << "combinatorial_object_activity::do_save done" << endl;
716 }
717}
718
722 int f_projective_space,
724 std::string &prefix,
725 int verbose_level)
726{
727 int f_v = (verbose_level >= 1);
728
729 if (f_v) {
730 cout << "combinatorial_object_activity::post_process_classification" << endl;
731 }
732
733
735
736 int iso_type;
737
738
739 for (iso_type = 0; iso_type < CO->nb_orbits; iso_type++) {
740
741 cout << "iso_type = " << iso_type << " / " << CO->nb_orbits << endl;
742 cout << "NO=" << endl;
743 CO->NO_transversal[iso_type]->print();
744
745 std::string label;
746 char str[1000];
747
748 sprintf(str, "_object%d", iso_type);
749 label.assign(prefix);
750 label.append(str);
751
752 OwP[iso_type].init(
753 CO->OWCF_transversal[iso_type],
754 CO->NO_transversal[iso_type],
755 f_projective_space, PA,
756 CO->Descr->max_TDO_depth,
757 label,
758 verbose_level);
759
760
761 }
762
763 if (f_v) {
764 cout << "combinatorial_object_activity::post_process_classification done" << endl;
765 }
766}
767
771 int verbose_level)
772{
773 int f_v = (verbose_level >= 1);
774
775 if (f_v) {
776 cout << "combinatorial_object_activity::classification_report" << endl;
777 }
778
780
781 if (CO->Descr->f_classification_prefix == FALSE) {
782 cout << "please use option -classification_prefix <prefix> to set the "
783 "prefix for the output file" << endl;
784 exit(1);
785 }
786
788
789 if (f_v) {
790 cout << "combinatorial_object_activity::classification_report before latex_report" << endl;
791 }
792 latex_report(Report_options,
793 CO,
794 OwP,
795 verbose_level);
796
797 if (f_v) {
798 cout << "combinatorial_object_activity::classification_report after latex_report" << endl;
799 }
800
801}
802
807 int verbose_level)
808{
809 int f_v = (verbose_level >= 1);
812
813 if (f_v) {
814 cout << "combinatorial_object_activity::latex_report" << endl;
815 }
816
817
818
819 string fname;
820
821 fname.assign(Report_options->prefix);
822 fname.append("_classification.tex");
823
824 if (f_v) {
825 cout << "combinatorial_object_activity::classification_report before latex_report" << endl;
826 }
827
828
829
830 if (f_v) {
831 cout << "combinatorial_object_activity::latex_report, CB->nb_types=" << CO->CB->nb_types << endl;
832 }
833 {
834 ofstream fp(fname);
836
837 L.head_easy(fp);
838
839
840 CO->report_summary_of_orbits(fp, verbose_level);
841
842
843 fp << "Ago : ";
844 CO->T_Ago->print_file_tex(fp, FALSE /* f_backwards*/);
845 fp << "\\\\" << endl;
846
847 if (f_v) {
848 cout << "combinatorial_object_activity::latex_report before loop" << endl;
849 }
850
851
852 report_all_isomorphism_types(fp, Report_options, CO, OwP,
853 verbose_level);
854
855 L.foot(fp);
856 }
857
858 if (f_v) {
859 cout << "Written file " << fname << " of size "
860 << Fio.file_size(fname) << endl;
861 }
862 //FREE_int(perm);
863 //FREE_int(v);
864 if (f_v) {
865 cout << "combinatorial_object_activity::latex_report done" << endl;
866 }
867}
868
870 std::ostream &fp,
874 int verbose_level)
875{
876 int f_v = (verbose_level >= 1);
877
878 if (f_v) {
879 cout << "combinatorial_object_activity::report_all_isomorphism_types" << endl;
880 }
881 int i;
882
884
885 for (i = 0; i < CO->CB->nb_types; i++) {
886
887 fp << "\\section*{Isomorphism type " << i << " / " << CO->CB->nb_types << "}" << endl;
888 fp << "Isomorphism type " << i << " / " << CO->CB->nb_types
889 //<< " stored at " << j
890 << " is original object "
891 << CO->CB->Type_rep[i] << " and appears "
892 << CO->CB->Type_mult[i] << " times: \\\\" << endl;
893
894 {
896 int *Input_objects;
897 int nb_input_objects;
898 CO->CB->C_type_of->get_class_by_value(Input_objects,
899 nb_input_objects, i, 0 /*verbose_level */);
900 Sorting.int_vec_heapsort(Input_objects, nb_input_objects);
901
902 fp << "This isomorphism type appears " << nb_input_objects
903 << " times, namely for the following "
904 << nb_input_objects << " input objects: " << endl;
905 if (nb_input_objects < 10) {
906 fp << "$" << endl;
907 L.int_set_print_tex(fp, Input_objects, nb_input_objects);
908 fp << "$\\\\" << endl;
909 }
910 else {
911 fp << "Too big to print. \\\\" << endl;
912#if 0
913 fp << "$$" << endl;
914 L.int_vec_print_as_matrix(fp, Input_objects,
915 nb_input_objects, 10 /* width */, TRUE /* f_tex */);
916 fp << "$$" << endl;
917#endif
918 }
919
920 FREE_int(Input_objects);
921 }
922
923 if (f_v) {
924 cout << "combinatorial_object_activity::report_all_isomorphism_types before report_isomorphism_type" << endl;
925 }
926 report_isomorphism_type(fp, Report_options, CO, OwP, i, verbose_level);
927 if (f_v) {
928 cout << "combinatorial_object_activity::report_all_isomorphism_types after report_isomorphism_type" << endl;
929 }
930
931
932 } // next i
933 if (f_v) {
934 cout << "combinatorial_object_activity::report_all_isomorphism_types done" << endl;
935 }
936
937}
938
939
941 std::ostream &fp,
945 int i, int verbose_level)
946{
947 int f_v = (verbose_level >= 1);
948
949 if (f_v) {
950 cout << "combinatorial_object_activity::report_isomorphism_type i=" << i << endl;
951 }
952 int j;
954
955 //j = CB->perm[i];
956 //j = CB->Type_rep[i];
957 j = i;
958
959 cout << "###################################################"
960 "#############################" << endl;
961 cout << "Orbit " << i << " / " << CO->CB->nb_types
962 << " is canonical form no " << j
963 << ", original object no " << CO->CB->Type_rep[i]
964 << ", frequency " << CO->CB->Type_mult[i]
965 << " : " << endl;
966
967
968 {
969 int *Input_objects;
970 int nb_input_objects;
971 CO->CB->C_type_of->get_class_by_value(Input_objects,
972 nb_input_objects, j, 0 /*verbose_level */);
973
974 cout << "This isomorphism type appears " << nb_input_objects
975 << " times, namely for the following "
976 "input objects:" << endl;
977 if (nb_input_objects < 10) {
978 L.int_vec_print_as_matrix(cout, Input_objects,
979 nb_input_objects, 10 /* width */,
980 FALSE /* f_tex */);
981 }
982 else {
983 cout << "too many to print" << endl;
984 }
985
986 FREE_int(Input_objects);
987 }
988
989
990
991 if (f_v) {
992 cout << "combinatorial_object_activity::report_isomorphism_type i=" << i << " before report_object" << endl;
993 }
994 report_object(fp,
995 Report_options,
996 CO,
997 OwP,
998 i /* object_idx */,
999 verbose_level);
1000 if (f_v) {
1001 cout << "combinatorial_object_activity::report_isomorphism_type i=" << i << " after report_object" << endl;
1002 }
1003
1004
1005
1006
1007 if (f_v) {
1008 cout << "combinatorial_object_activity::report_isomorphism_type i=" << i << " done" << endl;
1009 }
1010}
1011
1016 int object_idx,
1017 int verbose_level)
1018{
1019 int f_v = (verbose_level >= 1);
1020
1021 if (f_v) {
1022 cout << "combinatorial_object_activity::report_object" << endl;
1023 }
1024
1025
1027
1028 OwCF->print_tex_detailed(fp, Report_options->f_show_incidence_matrices, verbose_level);
1029
1030 if (FALSE /*CO->f_projective_space*/) {
1031
1032#if 0
1033 object_in_projective_space_with_action *OiPA;
1034
1035 OiPA = (object_in_projective_space_with_action *)
1036 CB->Type_extra_data[object_idx];
1037
1038 OiPA->report(fp, PA, max_TDO_depth, verbose_level);
1039#endif
1040
1041 }
1042 else {
1043 OwP[object_idx].latex_report(fp, Report_options, verbose_level);
1044 }
1045
1046
1047
1048}
1049
1051 std::string &prefix,
1053 int verbose_level)
1054{
1055 int f_v = (verbose_level >= 1);
1058
1059 if (f_v) {
1060 cout << "combinatorial_object_activity::draw_incidence_matrices" << endl;
1061 }
1062
1063
1064
1065 string fname;
1066
1067 fname.assign(prefix);
1068 fname.append("_incma.tex");
1069
1070 if (f_v) {
1071 cout << "combinatorial_object_activity::draw_incidence_matrices before latex_report" << endl;
1072 }
1073
1074
1075 {
1076 ofstream ost(fname);
1078
1079 L.head_easy(ost);
1080
1081
1082 int N;
1083
1084 N = IS->Objects.size();
1085
1086
1087
1088 if (f_v) {
1089 cout << "combinatorial_object_activity::draw_incidence_matrices before loop" << endl;
1090 }
1091
1092 int i;
1093
1094 ost << "\\noindent" << endl;
1095
1096 for (i = 0; i < N; i++) {
1097
1099
1101
1102
1104
1105 OwCF->encode_incma(Enc, verbose_level);
1106
1107 //Enc->latex_set_system_by_columns(ost, verbose_level);
1108
1109 //Enc->latex_set_system_by_rows(ost, verbose_level);
1110
1111 Enc->latex_incma(ost, verbose_level);
1112
1113 FREE_OBJECT(Enc);
1114
1115
1116 }
1117
1118
1119
1120 L.foot(ost);
1121 }
1122
1123 if (f_v) {
1124 cout << "Written file " << fname << " of size "
1125 << Fio.file_size(fname) << endl;
1126 }
1127 if (f_v) {
1128 cout << "combinatorial_object_activity::draw_incidence_matrices done" << endl;
1129 }
1130}
1131
1133 std::string &prefix,
1134 std::string &group_label,
1136 int verbose_level)
1137{
1138 int f_v = (verbose_level >= 1);
1141
1142 if (f_v) {
1143 cout << "combinatorial_object_activity::unpack_from_restricted_action" << endl;
1144 }
1145
1146
1148
1151
1152 LG = G->LG;
1153
1154
1155 if (!G->f_linear_group) {
1156 cout << "combinatorial_object_activity::unpack_from_restricted_action must be a linear group" << endl;
1157 exit(1);
1158 }
1159
1160 if (LG->A2->type_G != action_by_restriction_t) {
1161 cout << "combinatorial_object_activity::unpack_from_restricted_action must be a restricted action" << endl;
1162 exit(1);
1163 }
1165 ABR = LG->A2->G.ABR;
1166
1167
1168 string fname;
1169
1170 fname.assign(prefix);
1171 fname.append("_unpacked.txt");
1172
1173 if (f_v) {
1174 cout << "combinatorial_object_activity::unpack_from_restricted_action before latex_report" << endl;
1175 }
1176
1177
1178 {
1179
1180 ofstream ost(fname);
1181
1182 int N;
1183
1184 N = IS->Objects.size();
1185
1186
1187
1188 if (f_v) {
1189 cout << "combinatorial_object_activity::unpack_from_restricted_action before loop" << endl;
1190 }
1191
1192 int i, h;
1193 long int a, b;
1194
1195
1196 for (i = 0; i < N; i++) {
1197
1199
1201
1202
1203 //encoded_combinatorial_object *Enc;
1204
1205 //OwCF->encode_incma(Enc, verbose_level);
1206
1207 for (h = 0; h < OwCF->sz; h++) {
1208
1209 a = OwCF->set[h];
1210 b = ABR->original_point(a);
1211 OwCF->set[h] = b;
1212 }
1213
1214 //Enc->latex_incma(ost, verbose_level);
1215
1216 //FREE_OBJECT(Enc);
1217
1218 ost << OwCF->sz;
1219 for (h = 0; h < OwCF->sz; h++) {
1220 ost << " " << OwCF->set[h];
1221 }
1222 ost << endl;
1223
1224 }
1225
1226 ost << -1 << endl;
1227
1228
1229 }
1230
1231 if (f_v) {
1232 cout << "Written file " << fname << " of size "
1233 << Fio.file_size(fname) << endl;
1234 }
1235 if (f_v) {
1236 cout << "combinatorial_object_activity::unpack_from_restricted_action done" << endl;
1237 }
1238}
1239
1240
1242 std::string &prefix,
1243 std::string &projective_space_label,
1244 std::string &lines,
1246 int verbose_level)
1247{
1248 int f_v = (verbose_level >= 1);
1251
1252 if (f_v) {
1253 cout << "combinatorial_object_activity::line_covering_type" << endl;
1254 }
1255
1257
1259
1261
1262 P = PA->P;
1263
1264 long int *the_lines;
1265 int nb_lines;
1266
1267 orbiter_kernel_system::Orbiter->get_lint_vector_from_label(lines, the_lines, nb_lines, verbose_level);
1268
1269 string fname;
1270
1271 fname.assign(prefix);
1272 fname.append("_line_covering_type.txt");
1273
1274 if (f_v) {
1275 cout << "combinatorial_object_activity::line_covering_type before latex_report" << endl;
1276 }
1277
1278
1279 {
1280
1281 ofstream ost(fname);
1282
1283 int N;
1284
1285 N = IS->Objects.size();
1286
1287
1288
1289 if (f_v) {
1290 cout << "combinatorial_object_activity::line_covering_type before loop" << endl;
1291 }
1292
1293 int i, h;
1294
1295 int *type;
1296
1297 type = NEW_int(nb_lines);
1298
1299
1300 for (i = 0; i < N; i++) {
1301
1303
1305
1306
1308 the_lines, nb_lines,
1309 OwCF->set, OwCF->sz, type, 0 /*verbose_level */);
1310
1311 ost << OwCF->sz;
1312 for (h = 0; h < nb_lines; h++) {
1313 ost << " " << type[h];
1314 }
1315 ost << endl;
1316
1317 }
1318
1319 ost << -1 << endl;
1320
1321
1322 }
1323
1324 if (f_v) {
1325 cout << "Written file " << fname << " of size "
1326 << Fio.file_size(fname) << endl;
1327 }
1328 if (f_v) {
1329 cout << "combinatorial_object_activity::line_covering_type done" << endl;
1330 }
1331}
1332
1333
1334
1335
1336}}}
1337
1338
1339
1340
options for the report for a classification of combinatorial objects
classification of combinatorial objects using a graph-theoretic approach
void perform_classification(classification_of_objects_description *Descr, int f_projective_space, geometry::projective_space *P, data_structures::data_input_stream *IS, int verbose_level)
encoding of combinatorial object for use with nauty
input data for classification of geometric objects from the command line
a collection of functions related to sorted vectors
a statistical analysis of data consisting of single integers
void print_file_tex(std::ostream &ost, int f_backwards)
Definition: tally.cpp:338
void init(int *data, int data_length, int f_second, int verbose_level)
Definition: tally.cpp:72
void get_class_by_value(int *&Pts, int &nb_pts, int value, int verbose_level)
Definition: tally.cpp:644
to create a geometric object from a description using class geometric_object_description
Definition: geometry.h:568
a combinatorial object for which a canonical form can be computed using Nauty
Definition: geometry.h:1487
void encode_incma(combinatorics::encoded_combinatorial_object *&Enc, int verbose_level)
void print_tex_detailed(std::ostream &ost, int f_show_incma, int verbose_level)
projective space PG(n,q) of dimension n over Fq
Definition: geometry.h:1916
void print_set_numerical(std::ostream &ost, long int *set, int set_size)
void conic_type(long int *set, int set_size, int threshold, long int **&Pts_on_conic, int **&Conic_eqn, int *&nb_pts_on_conic, int &nb_conics, int verbose_level)
void determine_nonconical_six_subsets(long int *set, int set_size, std::vector< int > &Rk, int verbose_level)
void line_intersection_type(long int *set, int set_size, int *type, int verbose_level)
void line_intersection_type_basic_given_a_set_of_lines(long int *lines_by_rank, int nb_lines, long int *set, int set_size, int *type, int verbose_level)
int test_distinguishing_property(long int *set, int sz, int verbose_level)
void lint_matrix_write_csv(std::string &fname, long int *M, int m, int n)
Definition: file_io.cpp:1323
void write_set_to_file(std::string &fname, long int *the_set, int set_size, int verbose_level)
Definition: file_io.cpp:2434
void int_vec_print_as_matrix(std::ostream &ost, int *v, int len, int width, int f_tex)
void get_lint_vector_from_label(std::string &label, long int *&v, int &sz, int verbose_level)
homogeneous polynomials of a given degree in a given number of variables over a finite field GF(q)
Definition: ring_theory.h:88
void init(field_theory::finite_field *F, int nb_vars, int degree, int f_init_incidence_structure, monomial_ordering_type Monomial_ordering_type, int verbose_level)
void enumerate_points(int *coeff, std::vector< long int > &Pts, int verbose_level)
void vanishing_ideal(long int *Pts, int nb_pts, int &r, int *Kernel, int verbose_level)
creates a linear group from command line arguments using linear_group_description
Definition: groups.h:244
a wrapper for linear_group and permutation_group_create
combinatorics::classification_of_objects_report_options * Classification_of_objects_report_options
void draw_incidence_matrices(std::string &prefix, data_structures::data_input_stream *IS, int verbose_level)
void report_isomorphism_type(std::ostream &fp, combinatorics::classification_of_objects_report_options *Report_options, combinatorics::classification_of_objects *CO, object_with_properties *OwP, int i, int verbose_level)
void classification_report(combinatorics::classification_of_objects *CO, object_with_properties *OwP, int verbose_level)
void line_covering_type(std::string &prefix, std::string &projective_space_label, std::string &lines, data_structures::data_input_stream *IS, int verbose_level)
void init_input_stream(combinatorial_object_activity_description *Descr, data_structures::data_input_stream *IS, int verbose_level)
void do_save(std::string &save_as_fname, int f_extract, long int *extract_idx_set, int extract_size, int verbose_level)
void init(combinatorial_object_activity_description *Descr, geometry::geometric_object_create *GOC, int verbose_level)
void report_object(std::ostream &fp, combinatorics::classification_of_objects_report_options *Report_options, combinatorics::classification_of_objects *CO, object_with_properties *OwP, int object_idx, int verbose_level)
void report_all_isomorphism_types(std::ostream &fp, combinatorics::classification_of_objects_report_options *Report_options, combinatorics::classification_of_objects *CO, object_with_properties *OwP, int verbose_level)
void latex_report(combinatorics::classification_of_objects_report_options *Report_options, combinatorics::classification_of_objects *CO, object_with_properties *OwP, int verbose_level)
void unpack_from_restricted_action(std::string &prefix, std::string &group_label, data_structures::data_input_stream *IS, int verbose_level)
void post_process_classification(combinatorics::classification_of_objects *CO, object_with_properties *&OwP, int f_projective_space, projective_geometry::projective_space_with_action *PA, std::string &prefix, int verbose_level)
object properties which are derived from nauty canonical form
void init(geometry::object_with_canonical_form *OwCF, data_structures::nauty_output *NO, int f_projective_space, projective_geometry::projective_space_with_action *PA, int max_TDO_depth, std::string &label, int verbose_level)
void latex_report(std::ostream &ost, combinatorics::classification_of_objects_report_options *Report_options, int verbose_level)
projective space PG(n,q) with automorphism group PGGL(n+1,q)
projective_geometry::projective_space_with_action * get_object_of_type_projective_space(std::string &label)
#define Lint_vec_copy(A, B, C)
Definition: foundations.h:694
#define FREE_OBJECTS(p)
Definition: foundations.h:652
#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 NEW_OBJECTS(type, n)
Definition: foundations.h:639
#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
user_interface::orbiter_top_level_session * The_Orbiter_top_level_session
the orbiter library for the classification of combinatorial objects
induced_actions::action_by_restriction * ABR