Orbiter 2022
Combinatorial Objects
projective_space_with_action.cpp
Go to the documentation of this file.
1// projective_space_with_action.cpp
2//
3// Anton Betten
4//
5// December 22, 2017
6//
7//
8//
9//
10//
11
12#include "orbiter.h"
13
14using namespace std;
15
16namespace orbiter {
17namespace layer5_applications {
18namespace projective_geometry {
19
20
21#if 0
22static int table_of_sets_compare_func(void *data, int i,
23 void *search_object,
24 void *extra_data);
25#endif
26
27
29{
30 null();
31}
32
34{
35 freeself();
36}
37
39{
40 q = 0;
41 F = NULL;
42 P = NULL;
43 PA2 = NULL;
44 Dom = NULL;
45 QCDA = NULL;
46 A = NULL;
47 A_on_lines = NULL;
48
50 A_on_planes = NULL;
51
52 Elt1 = NULL;
53}
54
56{
57 if (P) {
59 }
60 if (PA2) {
62 }
63 if (Dom) {
65 }
66 if (QCDA) {
68 }
69 if (A) {
71 }
72 if (A_on_lines) {
74 }
77 }
78 if (Elt1) {
80 }
81 null();
82}
83
85 field_theory::finite_field *F, int n, int f_semilinear,
86 int f_init_incidence_structure,
87 int verbose_level)
88{
89 int f_v = (verbose_level >= 1);
90
91 if (f_v) {
92 cout << "projective_space_with_action::init" << endl;
93 }
98 d = n + 1;
99 q = F->q;
100
104 verbose_level);
105
106 init_group(f_semilinear, verbose_level);
107
108 if (n == 2) {
110
111 if (f_v) {
112 cout << "projective_space_with_action::init before Dom->init" << endl;
113 }
114 Dom->init(F, verbose_level);
115 if (f_v) {
116 cout << "projective_space_with_action::init after Dom->init" << endl;
117 }
119 if (f_v) {
120 cout << "projective_space_with_action::init before QCDA->init" << endl;
121 }
122 QCDA->init(Dom, this, verbose_level);
123 if (f_v) {
124 cout << "projective_space_with_action::init after QCDA->init" << endl;
125 }
126 }
127
128 if (n >= 3) {
129 if (f_v) {
130 cout << "projective_space_with_action::init n >= 3, so we initialize a plane" << endl;
131 }
133 if (f_v) {
134 cout << "projective_space_with_action::init before PA2->init" << endl;
135 }
136 PA2->init(F, 2, f_semilinear,
138 verbose_level - 2);
139 if (f_v) {
140 cout << "projective_space_with_action::init after PA2->init" << endl;
141 }
142 }
143
144
145
147
148
149 if (f_v) {
150 cout << "projective_space_with_action::init done" << endl;
151 }
152}
153
155 int f_semilinear, int verbose_level)
156{
157 int f_v = (verbose_level >= 1);
158
159 if (f_v) {
160 cout << "projective_space_with_action::init_group" << endl;
161 }
162 if (f_v) {
163 cout << "projective_space_with_action::init_group "
164 "creating linear group" << endl;
165 }
166
168
171 F, d,
172 TRUE /*f_projective*/,
173 FALSE /* f_general*/,
174 FALSE /* f_affine */,
176 FALSE /* f_special */,
177 nice_gens,
178 0 /* verbose_level*/);
179 if (f_v) {
180 cout << "projective_space_with_action::init_group "
181 "creating linear group done" << endl;
182 }
183#if 0
184 if (f_v) {
185 cout << "projective_space_with_action::init_group "
186 "before create_sims" << endl;
187 }
188 S = A->Strong_gens->create_sims(verbose_level - 2);
189
190 if (f_v) {
191 cout << "projective_space_with_action::init_group "
192 "after create_sims" << endl;
193 }
194#endif
195 FREE_OBJECT(nice_gens);
196
197
198 if (f_v) {
199 cout << "projective_space_with_action::init_group "
200 "creating action on lines" << endl;
201 }
202 A_on_lines = A->induced_action_on_grassmannian(2, verbose_level);
203 if (f_v) {
204 cout << "projective_space_with_action::init_group "
205 "creating action on lines done" << endl;
206 }
207
208 if (d >= 4) {
209 if (f_v) {
210 cout << "projective_space_with_action::init_group "
211 "creating action on planes" << endl;
212 }
214 A_on_planes = A->induced_action_on_grassmannian(3, verbose_level);
215 if (f_v) {
216 cout << "projective_space_with_action::init_group "
217 "creating action on lines planes" << endl;
218 }
219 }
220 else {
222 A_on_planes = NULL;
223 }
224
225 if (f_v) {
226 cout << "projective_space_with_action::init_group done" << endl;
227 }
228}
229
230
231#if 0
232void projective_space_with_action::canonical_form(
233 projective_space_object_classifier_description *Canonical_form_PG_Descr,
234 int verbose_level)
235{
236 int f_v = (verbose_level >= 1);
237 classification_of_objects *OC;
238
239 if (f_v) {
240 cout << "projective_space_with_action::canonical_form" << endl;
241 }
242
243#if 1
244 OC = NEW_OBJECT(classification_of_objects);
245
246 data_input_stream_description *IS_Descr;
247
248 IS_Descr = NEW_OBJECT(data_input_stream_description);
249
250 IS_Descr->add_set_of_points(a);
251
252 data_input_stream *IS;
253
254
255 IS = NEW_OBJECT(data_input_stream);
256
257
258 if (f_v) {
259 cout << "projective_space_with_action::canonical_form before OC->do_the_work" << endl;
260 }
261 OC->do_the_work(
262 Canonical_form_PG_Descr,
263 TRUE,
264 this,
265 IS,
266 verbose_level);
267 if (f_v) {
268 cout << "projective_space_with_action::canonical_form after OC->do_the_work" << endl;
269 }
270
271 FREE_OBJECT(OC);
272#endif
273
274 if (f_v) {
275 cout << "projective_space_with_action::canonical_form done" << endl;
276 }
277}
278#endif
279
282 int *canonical_labeling,
283 int verbose_level)
284{
285 int f_v = (verbose_level >= 1);
286
287 if (f_v) {
288 cout << "projective_space_with_action::canonical_labeling"
289 << endl;
290 }
291
292 if (f_v) {
293 cout << "projective_space_with_action::canonical_labeling "
294 "before OiP->canonical_labeling" << endl;
295 }
296
297 int nb_rows, nb_cols;
298
299 OiP->encoding_size(
300 nb_rows, nb_cols,
301 0 /* verbose_level */);
302
304
306 NO->allocate(nb_rows + nb_cols, 0 /* verbose_level */);
307
308
309 OiP->canonical_labeling(NO, verbose_level);
310
311 int i;
312
313 for (i = 0; i < NO->N; i++) {
315 }
316 if (f_v) {
317 cout << "projective_space_with_action::canonical_labeling "
318 "after OiP->canonical_labeling" << endl;
319 }
320
321 FREE_OBJECT(NO);
322
323
324 if (f_v) {
325 cout << "projective_space_with_action::canonical_labeling done" << endl;
326 }
327}
328
330 int *Elt, std::ostream &ost,
331 int verbose_level)
332{
333 int f_v = (verbose_level >= 1);
334
335 if (f_v) {
336 cout << "projective_space_with_action::report_fixed_points_lines_and_planes" << endl;
337 }
338
339 if (P->n < 3) {
340 cout << "projective_space_with_action::report_fixed_points_lines_and_planes P->n < 3" << endl;
341 exit(1);
342 }
344 int i, j, cnt;
345 int v[4];
346
347 P3 = P;
348
349 ost << "Fixed Objects:\\\\" << endl;
350
351
352
353 ost << "The element" << endl;
354 ost << "$$" << endl;
355 A->element_print_latex(Elt, ost);
356 ost << "$$" << endl;
357 ost << "has the following fixed objects:\\\\" << endl;
358
359
360 ost << "Fixed points:\\\\" << endl;
361
362 cnt = 0;
363 for (i = 0; i < P3->N_points; i++) {
364 j = A->element_image_of(i, Elt, 0 /* verbose_level */);
365 if (j == i) {
366 cnt++;
367 }
368 }
369
370 ost << "There are " << cnt << " fixed points, they are: \\\\" << endl;
371 for (i = 0; i < P3->N_points; i++) {
372 j = A->element_image_of(i, Elt, 0 /* verbose_level */);
373 F->PG_element_unrank_modified(v, 1, 4, i);
374 if (j == i) {
375 ost << i << " : ";
376 Int_vec_print(ost, v, 4);
377 ost << "\\\\" << endl;
378 cnt++;
379 }
380 }
381
382 ost << "Fixed Lines:\\\\" << endl;
383
384 {
385 actions::action *A2;
386
387 A2 = A->induced_action_on_grassmannian(2, 0 /* verbose_level*/);
388
389 cnt = 0;
390 for (i = 0; i < A2->degree; i++) {
391 j = A2->element_image_of(i, Elt, 0 /* verbose_level */);
392 if (j == i) {
393 cnt++;
394 }
395 }
396
397 ost << "There are " << cnt << " fixed lines, they are: \\\\" << endl;
398 cnt = 0;
399 for (i = 0; i < A2->degree; i++) {
400 j = A2->element_image_of(i, Elt, 0 /* verbose_level */);
401 if (j == i) {
402 ost << i << " : $\\left[";
404 ost << "\\right]$\\\\" << endl;
405 cnt++;
406 }
407 }
408
409 FREE_OBJECT(A2);
410 }
411
412 ost << "Fixed Planes:\\\\" << endl;
413
414 {
415 actions::action *A2;
416
417 A2 = A->induced_action_on_grassmannian(3, 0 /* verbose_level*/);
418
419 cnt = 0;
420 for (i = 0; i < A2->degree; i++) {
421 j = A2->element_image_of(i, Elt, 0 /* verbose_level */);
422 if (j == i) {
423 cnt++;
424 }
425 }
426
427 ost << "There are " << cnt << " fixed planes, they are: \\\\" << endl;
428 cnt = 0;
429 for (i = 0; i < A2->degree; i++) {
430 j = A2->element_image_of(i, Elt, 0 /* verbose_level */);
431 if (j == i) {
432 ost << i << " : $\\left[";
434 ost << "\\right]$\\\\" << endl;
435 cnt++;
436 }
437 }
438
439 FREE_OBJECT(A2);
440 }
441
442 if (f_v) {
443 cout << "projective_space_with_action::report_fixed_points_lines_and_planes done" << endl;
444 }
445}
446
448 int *Elt, std::ostream &ost,
449 int verbose_level)
450{
451 int f_v = (verbose_level >= 1);
452
453 if (f_v) {
454 cout << "projective_space_with_action::report_orbits_on_points_lines_and_planes" << endl;
455 }
456
457 if (P->n < 3) {
458 cout << "projective_space_with_action::report_orbits_on_points_lines_and_planes P->n < 3" << endl;
459 exit(1);
460 }
461 //projective_space *P3;
462 int order;
463
464 ring_theory::longinteger_object full_group_order;
465 order = A->element_order(Elt);
466
467 full_group_order.create(order, __FILE__, __LINE__);
468
469 //P3 = P;
470
471 ost << "Fixed Objects:\\\\" << endl;
472
473
474
475 ost << "The group generated by the element" << endl;
476 ost << "$$" << endl;
477 A->element_print_latex(Elt, ost);
478 ost << "$$" << endl;
479 ost << "has the following orbits:\\\\" << endl;
480
481 ost << "Orbits on points:\\\\" << endl;
482
483
484 groups::schreier *Sch;
485
488 Elt,
489 0 /*verbose_level*/);
490 Sch->print_orbit_lengths_tex(ost);
491
492
493 FREE_OBJECT(Sch);
494
495 ost << "Orbits on lines:\\\\" << endl;
496
497 {
498 actions::action *A2;
499 groups::schreier *Sch;
500
501 A2 = A->induced_action_on_grassmannian(2, 0 /* verbose_level*/);
502
505 Elt,
506 0 /*verbose_level*/);
507 Sch->print_orbit_lengths_tex(ost);
508
509
510 FREE_OBJECT(Sch);
511 FREE_OBJECT(A2);
512 }
513
514 ost << "Orbits on planes:\\\\" << endl;
515
516 {
517 actions::action *A2;
518 groups::schreier *Sch;
519
520
521 A2 = A->induced_action_on_grassmannian(3, 0 /* verbose_level*/);
522
525 Elt,
526 0 /*verbose_level*/);
527 Sch->print_orbit_lengths_tex(ost);
528
529
530 FREE_OBJECT(Sch);
531 FREE_OBJECT(A2);
532 }
533
534 if (f_v) {
535 cout << "projective_space_with_action::report_orbits_on_points_lines_and_planes done" << endl;
536 }
537}
538
540 int *Elt, ostream &ost, std::string &fname_base,
541 int verbose_level)
542{
543 int f_v = (verbose_level >= 1);
544
545 if (f_v) {
546 cout << "projective_space_with_action::report_decomposition_by_single_automorphism" << endl;
547 }
548
550
551
552 if (f_v) {
553 cout << "projective_space_with_action::report_decomposition_by_single_automorphism "
554 "before Geo.report_decomposition_by_single_automorphism" << endl;
555 }
556
558 this,
559 Elt, ost, fname_base,
560 verbose_level);
561
562 if (f_v) {
563 cout << "projective_space_with_action::report_decomposition_by_single_automorphism "
564 "after Geo.report_decomposition_by_single_automorphism" << endl;
565 }
566
567
568 if (f_v) {
569 cout << "projective_space_with_action::report_decomposition_by_single_automorphism done" << endl;
570 }
571}
572
573
574
575
576
577
580 int verbose_level)
581{
582 int f_v = (verbose_level >= 1);
583 int i;
584 long int a;
585 char str[1000];
586
587 if (f_v) {
588 cout << "projective_space_with_action::compute_group_of_set" << endl;
589 }
590
591#if 0
592 projective_space_object_classifier_description *Descr;
593 classification_of_objects *Classifier;
594
595 Descr = NEW_OBJECT(projective_space_object_classifier_description);
596 Classifier = NEW_OBJECT(classification_of_objects);
597
598 Descr->f_input = TRUE;
599 Descr->Data = NEW_OBJECT(data_input_stream_description);
600 Descr->Data->input_type[Descr->Data->nb_inputs] = INPUT_TYPE_SET_OF_POINTS;
601 Descr->Data->input_string[Descr->Data->nb_inputs].assign("");
602 for (i = 0; i < set_sz; i++) {
603 a = set[i];
604 sprintf(str, "%ld", a);
605 Descr->Data->input_string[Descr->Data->nb_inputs].append(str);
606 if (i < set_sz - 1) {
607 Descr->Data->input_string[Descr->Data->nb_inputs].append(",");
608 }
609 }
610 Descr->Data->input_string2[Descr->Data->nb_inputs].assign("");
611 Descr->Data->nb_inputs++;
612
613 if (f_v) {
614 cout << "projective_space_with_action::compute_group_of_set "
615 "before Classifier->do_the_work" << endl;
616 }
617
618 Classifier->do_the_work(
619 Descr,
620 TRUE,
621 this,
622 verbose_level);
623
624 if (f_v) {
625 cout << "projective_space_with_action::compute_group_of_set "
626 "after Classifier->do_the_work" << endl;
627 }
628
629 int idx;
630 long int ago;
631
632 idx = Classifier->CB->type_of[Classifier->CB->n - 1];
633
634
636
637 OiPA = (object_in_projective_space_with_action *) Classifier->CB->Type_extra_data[idx];
638
639
640 ago = OiPA->ago;
641
642 Sg = OiPA->Aut_gens;
643
644 Sg->A = A;
645
646
647 if (f_v) {
648 cout << "projective_space_with_action::compute_group_of_set ago = " << ago << endl;
649 }
650
651#endif
652
653
654 if (f_v) {
655 cout << "projective_space_with_action::compute_group_of_set done" << endl;
656 }
657}
658
659
662 std::string &evaluate_text,
663 int verbose_level)
664{
665 int f_v = (verbose_level >= 1);
666
667 if (f_v) {
668 cout << "projective_space_with_action::map" << endl;
669 }
670
671 if (f_v) {
672 cout << "projective_space_activity::map" << endl;
673 cout << "formula:" << endl;
674 Formula->print();
675 }
676
677 if (!Formula->f_is_homogeneous) {
678 cout << "Formula is not homogeneous" << endl;
679 exit(1);
680 }
681 if (f_v) {
682 cout << "Formula is homogeneous of degree " << Formula->degree << endl;
683 exit(1);
684 }
685 if (Formula->nb_managed_vars != P->n + 1) {
686 cout << "Formula->nb_managed_vars != P->n + 1" << endl;
687 exit(1);
688 }
689
691
693
694 if (f_v) {
695 cout << "projective_space_with_action::map before Poly->init" << endl;
696 }
697 Poly->init(F,
698 Formula->nb_managed_vars /* nb_vars */, Formula->degree,
699 FALSE /* f_init_incidence_structure */,
700 t_PART,
701 verbose_level);
702 if (f_v) {
703 cout << "projective_space_with_action::map after Poly->init" << endl;
704 }
705
706
708 int nb_monomials;
709
710 if (f_v) {
711 cout << "projective_space_with_action::map before Formula->get_subtrees" << endl;
712 }
713 Formula->get_subtrees(Poly, Subtrees, nb_monomials, verbose_level);
714 if (f_v) {
715 cout << "projective_space_with_action::map after Formula->get_subtrees" << endl;
716 }
717
718 int i;
719
720 for (i = 0; i < nb_monomials; i++) {
721 cout << "Monomial " << i << " : ";
722 if (Subtrees[i]) {
723 Subtrees[i]->print_expression(cout);
724 cout << " * ";
725 Poly->print_monomial(cout, i);
726 cout << endl;
727 }
728 else {
729 cout << "no subtree" << endl;
730 }
731 }
732
733
734 int *Coefficient_vector;
735
736 Coefficient_vector = NEW_int(nb_monomials);
737
738 Formula->evaluate(Poly,
739 Subtrees, evaluate_text, Coefficient_vector,
740 verbose_level);
741
742 if (f_v) {
743 cout << "projective_space_with_action::map coefficient vector:" << endl;
744 Int_vec_print(cout, Coefficient_vector, nb_monomials);
745 cout << endl;
746 }
747
748#if 0
749 del_pezzo_surface_of_degree_two_domain *del_Pezzo;
750
751 del_Pezzo = NEW_OBJECT(del_pezzo_surface_of_degree_two_domain);
752
753 del_Pezzo->init(P, Poly4_3, verbose_level);
754
755 del_pezzo_surface_of_degree_two_object *del_Pezzo_surface;
756
757 del_Pezzo_surface = NEW_OBJECT(del_pezzo_surface_of_degree_two_object);
758
759 del_Pezzo_surface->init(del_Pezzo,
760 Formula, Subtrees, Coefficient_vector,
761 verbose_level);
762
763 del_Pezzo_surface->enumerate_points_and_lines(verbose_level);
764
765 del_Pezzo_surface->pal->write_points_to_txt_file(Formula->name_of_formula, verbose_level);
766
767 del_Pezzo_surface->create_latex_report(Formula->name_of_formula, Formula->name_of_formula_latex, verbose_level);
768
769 FREE_OBJECT(del_Pezzo_surface);
770 FREE_OBJECT(del_Pezzo);
771#endif
772
773 FREE_int(Coefficient_vector);
774 FREE_OBJECT(Poly);
775
776 if (f_v) {
777 cout << "projective_space_with_action::map done" << endl;
778 }
779}
780
781
784 std::string &evaluate_text,
785 int verbose_level)
786{
787 int f_v = (verbose_level >= 1);
788
789 if (f_v) {
790 cout << "projective_space_with_action::analyze_del_Pezzo_surface" << endl;
791 }
792
793 if (f_v) {
794 cout << "projective_space_activity::analyze_del_Pezzo_surface" << endl;
795 cout << "formula:" << endl;
796 Formula->print();
797 }
798
799 if (!Formula->f_is_homogeneous) {
800 cout << "Formula is not homogeneous" << endl;
801 exit(1);
802 }
803 if (Formula->degree != 4) {
804 cout << "Formula is not of degree 4. Degree is " << Formula->degree << endl;
805 exit(1);
806 }
807 if (Formula->nb_managed_vars != 3) {
808 cout << "Formula should have 3 managed variables. Has " << Formula->nb_managed_vars << endl;
809 exit(1);
810 }
811
813
815
816 if (f_v) {
817 cout << "projective_space_with_action::analyze_del_Pezzo_surface before Poly->init" << endl;
818 }
819 Poly4_3->init(F,
820 Formula->nb_managed_vars /* nb_vars */, Formula->degree,
821 FALSE /* f_init_incidence_structure */,
822 t_PART,
823 verbose_level);
824 if (f_v) {
825 cout << "projective_space_with_action::analyze_del_Pezzo_surface after Poly->init" << endl;
826 }
827
828
830 int nb_monomials;
831
832 if (f_v) {
833 cout << "projective_space_with_action::analyze_del_Pezzo_surface before Formula->get_subtrees" << endl;
834 }
835 Formula->get_subtrees(Poly4_3, Subtrees, nb_monomials, verbose_level);
836 if (f_v) {
837 cout << "projective_space_with_action::analyze_del_Pezzo_surface after Formula->get_subtrees" << endl;
838 }
839
840 int i;
841
842 for (i = 0; i < nb_monomials; i++) {
843 cout << "Monomial " << i << " : ";
844 if (Subtrees[i]) {
845 Subtrees[i]->print_expression(cout);
846 cout << " * ";
847 Poly4_3->print_monomial(cout, i);
848 cout << endl;
849 }
850 else {
851 cout << "no subtree" << endl;
852 }
853 }
854
855
856 int *Coefficient_vector;
857
858 Coefficient_vector = NEW_int(nb_monomials);
859
860 Formula->evaluate(Poly4_3,
861 Subtrees, evaluate_text, Coefficient_vector,
862 verbose_level);
863
864 if (f_v) {
865 cout << "projective_space_with_action::analyze_del_Pezzo_surface coefficient vector:" << endl;
866 Int_vec_print(cout, Coefficient_vector, nb_monomials);
867 cout << endl;
868 }
869
871
873
874 del_Pezzo->init(P, Poly4_3, verbose_level);
875
877
879
880 del_Pezzo_surface->init(del_Pezzo,
881 Formula, Subtrees, Coefficient_vector,
882 verbose_level);
883
884 del_Pezzo_surface->enumerate_points_and_lines(verbose_level);
885
886 del_Pezzo_surface->pal->write_points_to_txt_file(Formula->name_of_formula, verbose_level);
887
888 del_Pezzo_surface->create_latex_report(Formula->name_of_formula, Formula->name_of_formula_latex, verbose_level);
889
890 FREE_OBJECT(del_Pezzo_surface);
891 FREE_OBJECT(del_Pezzo);
892
893 FREE_int(Coefficient_vector);
894 FREE_OBJECT(Poly4_3);
895
896 if (f_v) {
897 cout << "projective_space_with_action::analyze_del_Pezzo_surface done" << endl;
898 }
899}
900
901
903 int decomposition_by_element_power,
904 std::string &decomposition_by_element_data, std::string &fname_base,
905 int verbose_level)
906{
907 int f_v = (verbose_level >= 1);
908
909
910 if (f_v) {
911 cout << "projective_space_with_action::do_cheat_sheet_for_decomposition_by_element_PG verbose_level="
912 << verbose_level << endl;
913 }
914
915
917
918 F = P->F;
919
920
921 {
922 char title[1000];
923 char author[1000];
924
925 snprintf(title, 1000, "Decomposition of PG($%d,%d$)", n, F->q);
926 //strcpy(author, "");
927 author[0] = 0;
928
929
930 string fname_tex;
931
932 fname_tex.assign(fname_base);
933 fname_tex.append(".tex");
934
935 {
936 ofstream ost(fname_tex);
938
939 L.head(ost,
940 FALSE /* f_book*/,
941 TRUE /* f_title */,
942 title, author,
943 FALSE /* f_toc */,
944 FALSE /* f_landscape */,
945 TRUE /* f_12pt */,
946 TRUE /* f_enlarged_page */,
947 TRUE /* f_pagenumbers */,
948 NULL /* extra_praeamble */);
949
950
951 if (f_v) {
952 cout << "projective_space_with_action::do_cheat_sheet_for_decomposition_by_element_PG f_decomposition_by_element" << endl;
953 }
954
955 int *Elt;
956
957 Elt = NEW_int(A->elt_size_in_int);
958
959
961 decomposition_by_element_data, verbose_level);
962
963
965 decomposition_by_element_power, verbose_level);
966
968 Elt, ost, fname_base,
969 verbose_level);
970
971 FREE_int(Elt);
972
973
974 L.foot(ost);
975
976 }
978
979 if (f_v) {
980 cout << "written file " << fname_tex << " of size "
981 << Fio.file_size(fname_tex) << endl;
982 }
983 }
984
985 if (f_v) {
986 cout << "projective_space_with_action::do_cheat_sheet_for_decomposition_by_element_PG done" << endl;
987 }
988
989}
990
992 groups::linear_group_description * subgroup_Descr, int verbose_level)
993{
994 int f_v = (verbose_level >= 1);
995
996 if (f_v) {
997 cout << "projective_space_with_action::do_cheat_sheet_for_decomposition_by_subgroup" << endl;
998 }
999
1000
1002
1004
1005 subgroup_Descr->F = P->F;
1006
1007 if (f_v) {
1008 cout << "projective_space_with_action::do_cheat_sheet_for_decomposition_by_subgroup H_LG->init, "
1009 "creating the group" << endl;
1010 }
1011
1012 H_LG->linear_group_init(subgroup_Descr, verbose_level - 2);
1013
1014 if (f_v) {
1015 cout << "projective_space_with_action::do_cheat_sheet_for_decomposition_by_subgroup after H_LG->linear_group_init" << endl;
1016 }
1017
1018
1020
1021 A = H_LG->A2;
1022
1023
1024 string fname;
1025
1026 fname.assign(H_LG->label);
1027 fname.append("_decomp.tex");
1028
1029
1030 {
1031 char title[1000];
1032 char author[1000];
1033
1034 snprintf(title, 1000, "Decomposition of PG($%d,%d$)", n, F->q);
1035 //strcpy(author, "");
1036 author[0] = 0;
1037
1038
1039 {
1040 ofstream ost(fname);
1042
1043 L.head(ost,
1044 FALSE /* f_book*/,
1045 TRUE /* f_title */,
1046 title, author,
1047 FALSE /* f_toc */,
1048 FALSE /* f_landscape */,
1049 TRUE /* f_12pt */,
1050 TRUE /* f_enlarged_page */,
1051 TRUE /* f_pagenumbers */,
1052 NULL /* extra_praeamble */);
1053
1054
1055 if (f_v) {
1056 cout << "projective_space_with_action::do_cheat_sheet_for_decomposition_by_element_PG f_decomposition_by_element" << endl;
1057 }
1058
1059
1061 H_LG->Strong_gens, ost, H_LG->label,
1062 verbose_level);
1063
1064
1065
1066 L.foot(ost);
1067
1068 }
1070
1071 if (f_v) {
1072 cout << "written file " << fname << " of size "
1073 << Fio.file_size(fname) << endl;
1074 }
1075 }
1076
1077 if (f_v) {
1078 cout << "projective_space_with_action::do_cheat_sheet_for_decomposition_by_subgroup done" << endl;
1079 }
1080}
1081
1082
1084 ostream &ost,
1086 int verbose_level)
1087{
1088 int f_v = (verbose_level >= 1);
1089
1090 if (f_v) {
1091 cout << "projective_space_with_action::report" << endl;
1092 }
1093
1094
1095
1096 if (f_v) {
1097 cout << "projective_space_with_action::report done" << endl;
1098 }
1099}
1100
1101
1105 int verbose_level)
1106{
1107 int f_v = (verbose_level >= 1);
1108
1109 if (f_v) {
1110 cout << "projective_space_with_action::create_quartic_curve" << endl;
1111 }
1112 if (n != 2) {
1113 cout << "projective_space_with_action::create_quartic_curve we need a two-dimensional projective space" << endl;
1114 exit(1);
1115 }
1116
1117 if (Quartic_curve_descr->get_q() != q) {
1118 cout << "projective_space_activity::do_create_quartic_curve Quartic_curve_descr->get_q() != q" << endl;
1119 exit(1);
1120 }
1121
1123
1124 if (f_v) {
1125 cout << "projective_space_with_action::create_quartic_curve before SC->init" << endl;
1126 }
1127 QC->init(Quartic_curve_descr, this, QCDA, verbose_level);
1128 if (f_v) {
1129 cout << "projective_space_with_action::create_quartic_curve after SC->init" << endl;
1130 }
1131
1132
1133 if (f_v) {
1134 cout << "projective_space_with_action::create_quartic_curve "
1135 "before SC->apply_transformations" << endl;
1136 }
1137 QC->apply_transformations(Quartic_curve_descr->transform_coeffs,
1138 Quartic_curve_descr->f_inverse_transform,
1139 verbose_level - 2);
1140
1141 if (f_v) {
1142 cout << "projective_space_with_action::create_quartic_curve "
1143 "after SC->apply_transformations" << endl;
1144 }
1145
1146 QC->F->PG_element_normalize(QC->QO->eqn15, 1, 15);
1147
1148 if (f_v) {
1149 cout << "projective_space_with_action::create_quartic_curve done" << endl;
1150 }
1151}
1152
1154 std::string &label,
1155 int *genma, int m, int n,
1156 combinatorics::classification_of_objects_description *Canonical_form_codes_Descr,
1157 int verbose_level)
1158{
1159 int f_v = (verbose_level >= 1);
1160
1161 if (f_v) {
1162 cout << "projective_space_with_action::canonical_form_of_code" << endl;
1163 }
1164 int i, j;
1165 int *v;
1166 long int *set;
1167
1168 if (f_v) {
1169 cout << "Generator matrix: " << endl;
1170 Int_matrix_print(genma, m, n);
1171 cout << endl;
1172 }
1173 v = NEW_int(m);
1174 set = NEW_lint(n);
1175 for (j = 0; j < n; j++) {
1176 for (i = 0; i < m; i++) {
1177 v[i] = genma[i * n + j];
1178 }
1179 if (f_v) {
1180 cout << "projective_space_with_action::canonical_form_of_code "
1181 "before PA->P->rank_point" << endl;
1182 Int_vec_print(cout, v, m);
1183 cout << endl;
1184 }
1185 if (P == NULL) {
1186 cout << "P == NULL" << endl;
1187 exit(1);
1188 }
1189 set[j] = P->rank_point(v);
1190 }
1191 if (f_v) {
1192 cout << "projective_space_with_action::canonical_form_of_code set=";
1193 Lint_vec_print(cout, set, n);
1194 cout << endl;
1195 }
1196
1198 string points_as_string;
1199
1200 ST.create_comma_separated_list(points_as_string, set, n);
1201 if (f_v) {
1202 cout << "projective_space_with_action::canonical_form_of_code "
1203 "points_as_string=" << points_as_string << endl;
1204 }
1205
1208
1209 E.init_set_of_points(points_as_string);
1210 ISD.Input.push_back(E);
1211 ISD.nb_inputs++;
1212
1214
1215 IS.init(&ISD, verbose_level);
1216
1217
1218
1220
1221#if 0
1222 int f_save;
1223
1224 int f_save_as;
1225 std::string save_as_fname;
1226
1227 int f_extract_subset;
1228 std::string extract_subset_set;
1229 std::string extract_subset_fname;
1230
1231 int f_line_type;
1232
1233 int f_conic_type;
1234 int conic_type_threshold;
1235
1236 int f_non_conical_type;
1237
1238 int f_ideal;
1239 int ideal_degree;
1240
1241
1242 // options that apply to IS = data_input_stream
1243
1244 int f_canonical_form_PG;
1245 std::string canonical_form_PG_PG_label;
1246 classification_of_objects_description *Canonical_form_PG_Descr;
1247
1248 int f_canonical_form;
1249 classification_of_objects_description *Canonical_form_Descr;
1250
1251 int f_report;
1252 classification_of_objects_report_options *Classification_of_objects_report_options;
1253
1254#endif
1255
1258 COAD.Canonical_form_PG_PA = this;
1259 COAD.Canonical_form_PG_Descr = Canonical_form_codes_Descr;
1260
1261 COAD.f_report = TRUE;
1270
1271
1272
1274
1275 COA.init_input_stream(&COAD,
1276 &IS,
1277 verbose_level);
1278
1279
1280 COA.perform_activity(verbose_level);
1281
1282
1283
1284 if (f_v) {
1285 cout << "projective_space_with_action::canonical_form_of_code after PA->canonical_form" << endl;
1286 }
1287
1288
1289 FREE_int(v);
1290 FREE_lint(set);
1291 if (f_v) {
1292 cout << "projective_space_with_action::canonical_form_of_code done" << endl;
1293 }
1294
1295}
1296
1298{
1299 int f_v = (verbose_level >= 1);
1300
1301 if (f_v) {
1302 cout << "projective_space_with_action::table_of_quartic_curves" << endl;
1303 }
1304
1305 if (n != 2) {
1306 cout << "projective_space_with_action::table_of_quartic_curves "
1307 "we need a two-dimensional projective space" << endl;
1308 exit(1);
1309 }
1310
1312
1313 int nb_quartic_curves;
1314 int h;
1316 int *nb_K;
1317 long int *Table;
1318 int nb_cols = 6;
1319
1320 nb_quartic_curves = K.quartic_curves_nb_reps(q);
1321
1323
1324 nb_K = NEW_int(nb_quartic_curves);
1325
1326 Table = NEW_lint(nb_quartic_curves * nb_cols);
1327
1328 for (h = 0; h < nb_quartic_curves; h++) {
1329
1330 if (f_v) {
1331 cout << "projective_space_with_action::table_of_quartic_curves "
1332 << h << " / " << nb_quartic_curves << endl;
1333 }
1335
1336 Quartic_curve_descr.f_q = TRUE;
1337 Quartic_curve_descr.q = q;
1338 Quartic_curve_descr.f_catalogue = TRUE;
1339 Quartic_curve_descr.iso = h;
1340
1341
1342 int *data;
1343 int nb_gens;
1344 int data_size;
1345 string stab_order;
1346
1347 long int ago;
1349
1350 if (f_v) {
1351 cout << "projective_space_with_action::table_of_quartic_curves "
1352 << h << " / " << nb_quartic_curves << " before K.quartic_curves_stab_gens" << endl;
1353 }
1354 K.quartic_curves_stab_gens(q, h, data, nb_gens, data_size, stab_order);
1355
1356 if (f_v) {
1357 cout << "projective_space_with_action::table_of_quartic_curves "
1358 << h << " / " << nb_quartic_curves << " stab_order=" << stab_order << endl;
1359 }
1360 ago = ST.strtolint(stab_order);
1361
1362 if (ago > 0) {
1363
1365 &Quartic_curve_descr,
1366 QC[h],
1367 verbose_level);
1368
1369 nb_K[h] = QC[h]->QO->QP->nb_Kovalevski;
1370
1371
1372 Table[h * nb_cols + 0] = h;
1373 Table[h * nb_cols + 1] = nb_K[h];
1374 Table[h * nb_cols + 2] = QC[h]->QO->QP->nb_Kovalevski_on;
1375 Table[h * nb_cols + 3] = QC[h]->QO->QP->nb_Kovalevski_off;
1376 Table[h * nb_cols + 4] = QC[h]->QOA->Aut_gens->group_order_as_lint();
1377 Table[h * nb_cols + 5] = QC[h]->QO->nb_pts;
1378 }
1379 else {
1380 Table[h * nb_cols + 0] = h;
1381 Table[h * nb_cols + 1] = -1;
1382 Table[h * nb_cols + 2] = -1;
1383 Table[h * nb_cols + 3] = -1;
1384 Table[h * nb_cols + 4] = -1;
1385 Table[h * nb_cols + 5] = -1;
1386
1387 }
1388 if (f_v) {
1389 cout << "projective_space_with_action::table_of_quartic_curves "
1390 << h << " / " << nb_quartic_curves << " done" << endl;
1391 }
1392
1393 }
1394
1396 char str[1000];
1397
1398 sprintf(str, "_q%d", q);
1399
1400 string fname;
1401 fname.assign("quartic_curves");
1402 fname.append(str);
1403 fname.append("_info.csv");
1404
1405 //Fio.lint_matrix_write_csv(fname, Table, nb_quartic_curves, nb_cols);
1406
1407 {
1408 ofstream f(fname);
1409 int i, j;
1410
1411 f << "Row,OCN,K,Kon,Koff,Ago,NbPts,BisecantType,Eqn15,Eqn,Pts,Bitangents28";
1412 f << endl;
1413 for (i = 0; i < nb_quartic_curves; i++) {
1414 f << i;
1415
1416
1417 if (Table[i * nb_cols + 1] == -1) {
1418 for (j = 0; j < nb_cols; j++) {
1419 f << ",";
1420 }
1421 f << ",,,,,";
1422 }
1423 else {
1424
1425
1426 for (j = 0; j < nb_cols; j++) {
1427 f << "," << Table[i * nb_cols + j];
1428 }
1429 {
1430 string str;
1431 f << ",";
1432 orbiter_kernel_system::Orbiter->Int_vec->create_string_with_quotes(str, QC[i]->QO->QP->line_type_distribution, 3);
1433 f << str;
1434 }
1435 {
1436 string str;
1437 f << ",";
1439 f << str;
1440 }
1441
1442 {
1443 stringstream sstr;
1444 string str;
1445 QC[i]->QCDA->Dom->print_equation_maple(sstr, QC[i]->QO->eqn15);
1446 str.assign(sstr.str());
1447 f << ",";
1448 f << "\"$";
1449 f << str;
1450 f << "$\"";
1451 }
1452
1453 {
1454 string str;
1455 f << ",";
1457 f << str;
1458 }
1459 {
1460 string str;
1461 f << ",";
1462 orbiter_kernel_system::Orbiter->Lint_vec->create_string_with_quotes(str, QC[i]->QO->bitangents28, 28);
1463 f << str;
1464 }
1465 }
1466 f << endl;
1467 }
1468 f << "END" << endl;
1469 }
1470
1471
1472 cout << "Written file " << fname << " of size " << Fio.file_size(fname) << endl;
1473
1474 if (f_v) {
1475 cout << "projective_space_with_action::table_of_quartic_curves done" << endl;
1476 }
1477
1478}
1479
1481{
1482 int f_v = (verbose_level >= 1);
1483
1484 if (f_v) {
1485 cout << "projective_space_with_action::table_of_cubic_surfaces" << endl;
1486 }
1487
1488 if (n != 3) {
1489 cout << "projective_space_with_action::table_of_cubic_surfaces "
1490 "we need a three-dimensional projective space" << endl;
1491 exit(1);
1492 }
1493
1495
1497 Surf_A,
1498 verbose_level);
1499
1500 if (f_v) {
1501 cout << "projective_space_with_action::table_of_cubic_surfaces before Surf_A->table_of_cubic_surfaces" << endl;
1502 }
1503 Surf_A->table_of_cubic_surfaces(verbose_level);
1504 if (f_v) {
1505 cout << "projective_space_with_action::table_of_cubic_surfaces after Surf_A->table_of_cubic_surfaces" << endl;
1506 }
1507
1508
1509 if (f_v) {
1510 cout << "projective_space_with_action::table_of_cubic_surfaces done" << endl;
1511 }
1512
1513}
1514
1516 long int *Pts, int nb_pts, int threshold,
1517 int verbose_level)
1518{
1519 int f_v = (verbose_level >= 1);
1520
1521 if (f_v) {
1522 cout << "projective_space_with_action::conic_type threshold = " << threshold << endl;
1523 }
1524
1525
1526 long int **Pts_on_conic;
1527 int **Conic_eqn;
1528 int *nb_pts_on_conic;
1529 int len;
1530 int h;
1531
1532
1533 if (f_v) {
1534 cout << "projective_space_with_action::conic_type before PA->P->conic_type" << endl;
1535 }
1536
1537 P->conic_type(Pts, nb_pts,
1538 threshold,
1539 Pts_on_conic, Conic_eqn, nb_pts_on_conic, len,
1540 verbose_level);
1541
1542 if (f_v) {
1543 cout << "projective_space_with_action::conic_type after PA->P->conic_type" << endl;
1544 }
1545
1546
1547 cout << "We found the following conics:" << endl;
1548 for (h = 0; h < len; h++) {
1549 cout << h << " : " << nb_pts_on_conic[h] << " : ";
1550 Int_vec_print(cout, Conic_eqn[h], 6);
1551 cout << " : ";
1552 Lint_vec_print(cout, Pts_on_conic[h], nb_pts_on_conic[h]);
1553 cout << endl;
1554 }
1555
1556 cout << "computing intersection types with bisecants of the first 11 points:" << endl;
1557 int Line_P1[55];
1558 int Line_P2[55];
1559 int P1, P2;
1560 long int p1, p2, line_rk;
1561 long int *pts_on_line;
1562 long int pt;
1563 int *Conic_line_intersection_sz;
1564 int cnt;
1565 int i, j, q, u, v;
1566 int nb_pts_per_line;
1567
1568 q = P->F->q;
1569 nb_pts_per_line = q + 1;
1570 pts_on_line = NEW_lint(55 * nb_pts_per_line);
1571
1572 cnt = 0;
1573 for (i = 0; i < 11; i++) {
1574 for (j = i + 1; j < 11; j++) {
1575 Line_P1[cnt] = i;
1576 Line_P2[cnt] = j;
1577 cnt++;
1578 }
1579 }
1580 if (cnt != 55) {
1581 cout << "cnt != 55" << endl;
1582 cout << "cnt = " << cnt << endl;
1583 exit(1);
1584 }
1585 for (u = 0; u < 55; u++) {
1586 P1 = Line_P1[u];
1587 P2 = Line_P2[u];
1588 p1 = Pts[P1];
1589 p2 = Pts[P2];
1590 line_rk = P->line_through_two_points(p1, p2);
1591 P->create_points_on_line(line_rk, pts_on_line + u * nb_pts_per_line, 0 /*verbose_level*/);
1592 }
1593
1594 Conic_line_intersection_sz = NEW_int(len * 55);
1595 Int_vec_zero(Conic_line_intersection_sz, len * 55);
1596
1597 for (h = 0; h < len; h++) {
1598 for (u = 0; u < 55; u++) {
1599 for (v = 0; v < nb_pts_per_line; v++) {
1600 if (P->test_if_conic_contains_point(Conic_eqn[h], pts_on_line[u * nb_pts_per_line + v])) {
1601 Conic_line_intersection_sz[h * 55 + u]++;
1602 }
1603
1604 }
1605 }
1606 }
1607
1609 int idx;
1610
1611 cout << "We found the following conics and their intersections with the 55 bisecants:" << endl;
1612 for (h = 0; h < len; h++) {
1613 cout << h << " : " << nb_pts_on_conic[h] << " : ";
1614 Int_vec_print(cout, Conic_eqn[h], 6);
1615 cout << " : ";
1616 Int_vec_print_fully(cout, Conic_line_intersection_sz + h * 55, 55);
1617 cout << " : ";
1618 Lint_vec_print(cout, Pts_on_conic[h], nb_pts_on_conic[h]);
1619 cout << " : ";
1620 cout << endl;
1621 }
1622
1623 for (u = 0; u < 55; u++) {
1624 cout << "line " << u << " : ";
1625 int str[55];
1626
1627 Int_vec_zero(str, 55);
1628 for (v = 0; v < nb_pts; v++) {
1629 pt = Pts[v];
1630 if (Sorting.lint_vec_search_linear(pts_on_line + u * nb_pts_per_line, nb_pts_per_line, pt, idx)) {
1631 str[v] = 1;
1632 }
1633 }
1634 Int_vec_print_fully(cout, str, 55);
1635 cout << endl;
1636 }
1637
1638 if (f_v) {
1639 cout << "projective_space_with_action::conic_type done" << endl;
1640 }
1641
1642}
1643
1646 int verbose_level)
1647{
1648 int f_v = (verbose_level >= 1);
1649
1650 if (f_v) {
1651 cout << "projective_space_with_action::cheat_sheet" << endl;
1652 }
1653
1654
1655
1656 {
1657 char fname[1000];
1658 char title[1000];
1659 char author[1000];
1660
1661 snprintf(fname, 1000, "PG_%d_%d.tex", n, F->q);
1662 snprintf(title, 1000, "Cheat Sheet ${\\rm PG}(%d,%d)$", n, F->q);
1663 //strcpy(author, "");
1664 author[0] = 0;
1665
1666
1667 {
1668 ofstream ost(fname);
1670
1671 L.head(ost,
1672 FALSE /* f_book*/,
1673 TRUE /* f_title */,
1674 title, author,
1675 FALSE /* f_toc */,
1676 FALSE /* f_landscape */,
1677 TRUE /* f_12pt */,
1678 TRUE /* f_enlarged_page */,
1679 TRUE /* f_pagenumbers */,
1680 NULL /* extra_praeamble */);
1681
1682
1683 if (f_v) {
1684 cout << "projective_space_with_action::do_cheat_sheet_PG before A->report" << endl;
1685 }
1686
1687 A->report(ost, A->f_has_sims, A->Sims,
1689 O,
1690 verbose_level);
1691
1692 if (f_v) {
1693 cout << "projective_space_with_action::do_cheat_sheet_PG after PA->A->report" << endl;
1694 }
1695
1696 if (f_v) {
1697 cout << "projective_space_with_action::do_cheat_sheet_PG before PA->P->report" << endl;
1698 }
1699
1700
1701
1702 P->report(ost, O, verbose_level);
1703
1704 if (f_v) {
1705 cout << "projective_space_with_action::do_cheat_sheet_PG after PP->report" << endl;
1706 }
1707
1708
1709 L.foot(ost);
1710
1711 }
1713
1714 if (f_v) {
1715 cout << "written file " << fname << " of size "
1716 << Fio.file_size(fname) << endl;
1717 }
1718
1719 }
1720
1721 if (f_v) {
1722 cout << "projective_space_with_action::cheat_sheet done" << endl;
1723 }
1724
1725
1726}
1727
1728
1731 int verbose_level)
1732{
1733 int f_v = (verbose_level >= 1);
1734
1735 if (f_v) {
1736 cout << "projective_space_with_action::do_spread_classify" << endl;
1737 }
1739
1741
1742 if (f_v) {
1743 cout << "projective_space_with_action::do_spread_classify before SC->init" << endl;
1744 }
1745
1746 SC->init(
1747 this,
1748 k,
1749 TRUE /* f_recoordinatize */,
1750 verbose_level - 1);
1751 if (f_v) {
1752 cout << "projective_space_with_action::do_spread_classify after SC->init" << endl;
1753 }
1754
1755 if (f_v) {
1756 cout << "projective_space_with_action::do_spread_classify before SC->init2" << endl;
1757 }
1758 SC->init2(Control, verbose_level);
1759 if (f_v) {
1760 cout << "projective_space_with_action::do_spread_classify after SC->init2" << endl;
1761 }
1762
1763
1764 if (f_v) {
1765 cout << "projective_space_with_action::do_spread_classify before SC->compute" << endl;
1766 }
1767
1768 SC->compute(verbose_level);
1769
1770 if (f_v) {
1771 cout << "projective_space_with_action::do_spread_classify after SC->compute" << endl;
1772 }
1773
1774
1775 FREE_OBJECT(SC);
1776
1777 if (f_v) {
1778 cout << "projective_space_with_action::do_spread_classify done" << endl;
1779 }
1780}
1781
1784 int verbose_level)
1785{
1786 int f_v = (verbose_level >= 1);
1787
1788 if (f_v) {
1789 cout << "projective_space_with_action::setup_surface_with_action" << endl;
1790 cout << "projective_space_with_action::setup_surface_with_action verbose_level=" << verbose_level << endl;
1791 }
1792
1793
1795
1796
1797 if (f_v) {
1798 cout << "projective_space_with_action::setup_surface_with_action before Surf->init" << endl;
1799 }
1801 Surf->init(F, 0 /*verbose_level - 1*/);
1802 if (f_v) {
1803 cout << "projective_space_with_action::setup_surface_with_action after Surf->init" << endl;
1804 }
1805
1807
1808 if (f_v) {
1809 cout << "projective_space_with_action::setup_surface_with_action before Surf_A->init" << endl;
1810 }
1811 Surf_A->init(Surf, this, TRUE /* f_recoordinatize */, 0 /*verbose_level*/);
1812 if (f_v) {
1813 cout << "projective_space_with_action::setup_surface_with_action after Surf_A->init" << endl;
1814 }
1815
1816}
1817
1818
1820 groups::strong_generators *SG, std::ostream &ost, std::string &fname_base,
1821 int verbose_level)
1822{
1823 int f_v = (verbose_level >= 1);
1824
1825 if (f_v) {
1826 cout << "projective_space_with_action::report_decomposition_by_group" << endl;
1827 }
1828
1829
1831
1832
1833 if (f_v) {
1834 cout << "projective_space_with_action::report_decomposition_by_group "
1835 "before Geo.report_decomposition_by_group" << endl;
1836 }
1838 this,
1839 SG, ost, fname_base,
1840 verbose_level);
1841 if (f_v) {
1842 cout << "projective_space_with_action::report_decomposition_by_group "
1843 "after Geo.report_decomposition_by_group" << endl;
1844 }
1845
1846
1847
1848 if (f_v) {
1849 cout << "projective_space_with_action::report_decomposition_by_group done" << endl;
1850 }
1851}
1852
1853
1855 std::string &label,
1856 int verbose_level)
1857{
1858 int f_v = (verbose_level >= 1);
1859
1860 if (f_v) {
1861 cout << "projective_space_with_action::do_rank_lines_in_PG" << endl;
1862 }
1863
1864 int *v;
1865 int m, n;
1866
1868
1869 if (f_v) {
1870 cout << "projective_space_with_action::do_rank_lines_in_PG v: ";
1871 Int_matrix_print(v, m, n);
1872 cout << endl;
1873 }
1874
1875 if (n != 2 * (P->n + 1)) {
1876 cout << "projective_space_with_action::do_rank_lines_in_PG n != 2 * (P->n + 1)" << endl;
1877 exit(1);
1878 }
1879
1880 long int a;
1881 int i;
1882
1883 for (i = 0; i < m; i++) {
1884
1885
1886 a = P->rank_line(v + i * n);
1887
1888 Int_matrix_print(v + i * n, 2, P->n + 1);
1889 cout << "has rank " << a << endl;
1890
1891 }
1892
1893
1894 FREE_int(v);
1895
1896}
1897
1899 std::string &text,
1900 int verbose_level)
1901{
1902 int f_v = (verbose_level >= 1);
1903
1904 if (f_v) {
1905 cout << "projective_space_with_action::do_unrank_lines_in_PG" << endl;
1906 }
1907
1908 long int *v;
1909 int sz;
1910 int len;
1911 int *basis;
1912
1913 Lint_vec_scan(text, v, sz);
1914
1915 if (f_v) {
1916 cout << "projective_space_with_action::do_unrank_lines_in_PG v: ";
1917 Lint_vec_print(cout, v, sz);
1918 cout << endl;
1919 }
1920
1921 len = 2 * (P->n + 1);
1922
1923 basis = NEW_int(len);
1924
1925 int i;
1926
1927 for (i = 0; i < sz; i++) {
1928
1929
1930 P->unrank_line(basis, v[i]);
1931
1932
1933 cout << v[i] << " = " << endl;
1934 Int_matrix_print(basis, 2, P->n + 1);
1935 cout << endl;
1936
1937 }
1938
1939
1940 FREE_lint(v);
1941 FREE_int(basis);
1942
1943}
1944
1945
1946
1947
1948
1949
1950// #############################################################################
1951// globals:
1952// #############################################################################
1953
1954
1955#if 0
1956
1957void OiPA_encode(void *extra_data,
1958 long int *&encoding, int &encoding_sz, void *global_data)
1959{
1960 //cout << "OiPA_encode" << endl;
1962 object_with_canonical_form *OwCF;
1963
1964 OiPA = (object_in_projective_space_with_action *) extra_data;
1965 OwCF = OiPA->OwCF;
1966 //OiP->print(cout);
1967 OwCF->encode_object(encoding, encoding_sz, 1 /* verbose_level*/);
1968 //cout << "OiPA_encode done" << endl;
1969
1970}
1971
1972void OiPA_group_order(void *extra_data,
1973 longinteger_object &go, void *global_data)
1974{
1975 //cout << "OiPA_group_order" << endl;
1976 object_in_projective_space_with_action *OiPA;
1977 //object_in_projective_space *OiP;
1978
1979 OiPA = (object_in_projective_space_with_action *) extra_data;
1980 //OiP = OiPA->OiP;
1981 go.create(OiPA->ago, __FILE__, __LINE__);
1982 //OiPA->Aut_gens->group_order(go);
1983 //cout << "OiPA_group_order done" << endl;
1984
1985}
1986#endif
1987
1988
1989
1990#if 0
1991void compute_ago_distribution(
1992 classify_bitvectors *CB, tally *&C_ago, int verbose_level)
1993{
1994 int f_v = (verbose_level >= 1);
1995
1996 if (f_v) {
1997 cout << "compute_ago_distribution" << endl;
1998 }
1999 long int *Ago;
2000 int i;
2001
2002 Ago = NEW_lint(CB->nb_types);
2003 for (i = 0; i < CB->nb_types; i++) {
2004 object_in_projective_space_with_action *OiPA;
2005
2006 OiPA = (object_in_projective_space_with_action *)
2007 CB->Type_extra_data[i];
2008 Ago[i] = OiPA->ago; //OiPA->Aut_gens->group_order_as_lint();
2009 }
2010 C_ago = NEW_OBJECT(tally);
2011 C_ago->init_lint(Ago, CB->nb_types, FALSE, 0);
2012 FREE_lint(Ago);
2013 if (f_v) {
2014 cout << "compute_ago_distribution done" << endl;
2015 }
2016}
2017
2018void compute_ago_distribution_permuted(
2019 classify_bitvectors *CB, tally *&C_ago, int verbose_level)
2020{
2021 int f_v = (verbose_level >= 1);
2022
2023 if (f_v) {
2024 cout << "compute_ago_distribution_permuted" << endl;
2025 }
2026 long int *Ago;
2027 int i;
2028
2029 Ago = NEW_lint(CB->nb_types);
2030 for (i = 0; i < CB->nb_types; i++) {
2031 object_in_projective_space_with_action *OiPA;
2032
2033 OiPA = (object_in_projective_space_with_action *)
2034 CB->Type_extra_data[CB->perm[i]];
2035 Ago[i] = OiPA->ago; //OiPA->Aut_gens->group_order_as_lint();
2036 }
2037 C_ago = NEW_OBJECT(tally);
2038 C_ago->init_lint(Ago, CB->nb_types, FALSE, 0);
2039 FREE_lint(Ago);
2040 if (f_v) {
2041 cout << "compute_ago_distribution_permuted done" << endl;
2042 }
2043}
2044
2045void compute_and_print_ago_distribution(ostream &ost,
2046 classify_bitvectors *CB, int verbose_level)
2047{
2048 int f_v = (verbose_level >= 1);
2049
2050 if (f_v) {
2051 cout << "compute_and_print_ago_distribution" << endl;
2052 }
2053 tally *C_ago;
2054 compute_ago_distribution(CB, C_ago, verbose_level);
2055 ost << "ago distribution: " << endl;
2056 ost << "$$" << endl;
2057 C_ago->print_naked_tex(ost, TRUE /* f_backwards */);
2058 ost << endl;
2059 ost << "$$" << endl;
2060 FREE_OBJECT(C_ago);
2061}
2062
2063void compute_and_print_ago_distribution_with_classes(ostream &ost,
2064 classify_bitvectors *CB, int verbose_level)
2065{
2066 int f_v = (verbose_level >= 1);
2067 int i;
2068 latex_interface L;
2069
2070 if (f_v) {
2071 cout << "compute_and_print_ago_distribution_with_classes" << endl;
2072 }
2073 tally *C_ago;
2074 compute_ago_distribution_permuted(CB, C_ago, verbose_level);
2075 ost << "Ago distribution: " << endl;
2076 ost << "$$" << endl;
2077 C_ago->print_naked_tex(ost, TRUE /* f_backwards */);
2078 ost << endl;
2079 ost << "$$" << endl;
2080 set_of_sets *SoS;
2081 int *types;
2082 int nb_types;
2083
2084 SoS = C_ago->get_set_partition_and_types(types,
2085 nb_types, verbose_level);
2086
2087
2088 // go backwards to show large group orders first:
2089 for (i = SoS->nb_sets - 1; i >= 0; i--) {
2090 ost << "Group order $" << types[i]
2091 << "$ appears for the following $" << SoS->Set_size[i]
2092 << "$ classes: $" << endl;
2093 L.lint_set_print_tex(ost, SoS->Sets[i], SoS->Set_size[i]);
2094 ost << "$\\\\" << endl;
2095 //int_vec_print_as_matrix(ost, SoS->Sets[i],
2096 //SoS->Set_size[i], 10 /* width */, TRUE /* f_tex */);
2097 //ost << "$$" << endl;
2098
2099 }
2100
2101 FREE_int(types);
2102 FREE_OBJECT(SoS);
2103 FREE_OBJECT(C_ago);
2104}
2105#endif
2106
2107#if 0
2108static int table_of_sets_compare_func(void *data, int i,
2109 void *search_object,
2110 void *extra_data)
2111{
2112 long int *Data = (long int *) data;
2113 long int *p = (long int *) extra_data;
2114 long int len = p[0];
2115 int ret;
2117
2118 ret = Sorting.lint_vec_compare(Data + i * len, (long int *) search_object, len);
2119 return ret;
2120}
2121#endif
2122
2123
2124
2125
2126
2127}}}
2128
void init(geometry::projective_space *P, ring_theory::homogeneous_polynomial_domain *Poly4_3, int verbose_level)
void init(del_pezzo_surface_of_degree_two_domain *Dom, expression_parser::formula *RHS, expression_parser::syntax_tree_node **Subtrees, int *Coefficient_vector, int verbose_level)
domain for quartic curves in PG(2,q) with 28 bitangents
void init(field_theory::finite_field *F, int verbose_level)
void init(field_theory::finite_field *F, int verbose_level)
description of a classification of objects using class classification_of_objects
options for the report for a classification of combinatorial objects
describes one element in an input stream of combinatorial objects
description of input data for classification of geometric objects from the command line
std::vector< data_input_stream_description_element > Input
input data for classification of geometric objects from the command line
void init(data_input_stream_description *Descr, int verbose_level)
void create_string_with_quotes(std::string &str, int *v, int len)
Definition: int_vec.cpp:1088
void create_string_with_quotes(std::string &str, long int *v, int len)
Definition: lint_vec.cpp:533
a collection of functions related to sorted vectors
int lint_vec_search_linear(long int *v, int len, long int a, int &idx)
Definition: sorting.cpp:699
int lint_vec_compare(long int *p, long int *q, int len)
Definition: sorting.cpp:2326
functions related to strings and character arrays
void create_comma_separated_list(std::string &output, long int *input, int input_sz)
void evaluate(ring_theory::homogeneous_polynomial_domain *Poly, syntax_tree_node **Subtrees, std::string &evaluate_text, int *Values, int verbose_level)
Definition: formula.cpp:268
void get_subtrees(ring_theory::homogeneous_polynomial_domain *Poly, syntax_tree_node **&Subtrees, int &nb_monomials, int verbose_level)
Definition: formula.cpp:150
void PG_element_unrank_modified(int *v, int stride, int len, int a)
void print_single_generator_matrix_tex(std::ostream &ost, long int a)
Definition: grassmann.cpp:122
a combinatorial object for which a canonical form can be computed using Nauty
Definition: geometry.h:1487
void encode_object(long int *&encoding, int &encoding_sz, int verbose_level)
void encoding_size(int &nb_rows, int &nb_cols, int verbose_level)
void canonical_labeling(data_structures::nauty_output *NO, int verbose_level)
void write_points_to_txt_file(std::string &label, int verbose_level)
projective space PG(n,q) of dimension n over Fq
Definition: geometry.h:1916
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 create_points_on_line(long int line_rk, long int *line, int verbose_level)
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)
long int line_through_two_points(long int p1, long int p2)
options for drawing an object of type layered_graph
Definition: graphics.h:457
provides access to pre-computed combinatorial data in encoded form
void quartic_curves_stab_gens(int q, int i, int *&data, int &nb_gens, int &data_size, std::string &stab_order_str)
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)
void get_matrix_from_label(std::string &label, int *&v, int &m, int &n)
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)
a class to represent arbitrary precision integers
Definition: ring_theory.h:366
void create(long int i, const char *file, int line)
a permutation group in a fixed action.
Definition: actions.h:99
void element_print_latex(void *elt, std::ostream &ost)
Definition: action_cb.cpp:364
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
void make_element_from_string(int *Elt, std::string &data_string, int verbose_level)
Definition: action.cpp:1842
void element_power_int_in_place(int *Elt, int n, int verbose_level)
Definition: action.cpp:2000
action * induced_action_on_grassmannian(int k, int verbose_level)
void all_point_orbits_from_single_generator(groups::schreier &Schreier, int *Elt, int verbose_level)
Definition: action.cpp:1268
void init_linear_group(field_theory::finite_field *F, int m, int f_projective, int f_general, int f_affine, int f_semilinear, int f_special, data_structures_groups::vector_ge *&nice_gens, int verbose_level)
Definition: action_init.cpp:17
long int element_image_of(long int a, void *elt, int verbose_level)
Definition: action_cb.cpp:198
description of a linear group from the command line
Definition: groups.h:158
creates a linear group from command line arguments using linear_group_description
Definition: groups.h:244
void linear_group_init(linear_group_description *description, int verbose_level)
Schreier trees for orbits of groups on points.
Definition: groups.h:839
a strong generating set for a permutation group with respect to a fixed action
Definition: groups.h:1703
to control the behavior of the poset classification algorithm
void init(algebraic_geometry::surface_domain *Surf, projective_geometry::projective_space_with_action *PA, int f_recoordinatize, int verbose_level)
to create a quartic curve from a description using class quartic_curve_create_description
void init(quartic_curve_create_description *Descr, projective_geometry::projective_space_with_action *PA, quartic_curve_domain_with_action *QCDA, int verbose_level)
void apply_transformations(std::vector< std::string > &transform_coeffs, std::vector< int > &f_inverse_transform, int verbose_level)
void init(algebraic_geometry::quartic_curve_domain *Dom, projective_geometry::projective_space_with_action *PA, int verbose_level)
combinatorics::classification_of_objects_report_options * Classification_of_objects_report_options
void init_input_stream(combinatorial_object_activity_description *Descr, data_structures::data_input_stream *IS, 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)
void conic_type(long int *Pts, int nb_pts, int threshold, int verbose_level)
void do_spread_classify(int k, poset_classification::poset_classification_control *Control, int verbose_level)
applications_in_algebraic_geometry::quartic_curves::quartic_curve_domain_with_action * QCDA
void report(std::ostream &ost, graphics::layered_graph_draw_options *O, int verbose_level)
void do_cheat_sheet_for_decomposition_by_element_PG(int decomposition_by_element_power, std::string &decomposition_by_element_data, std::string &fname_base, int verbose_level)
void canonical_form_of_code(std::string &label, int *genma, int m, int n, combinatorics::classification_of_objects_description *Canonical_form_codes_Descr, int verbose_level)
void map(expression_parser::formula *Formula, std::string &evaluate_text, int verbose_level)
void init(field_theory::finite_field *F, int n, int f_semilinear, int f_init_incidence_structure, int verbose_level)
void analyze_del_Pezzo_surface(expression_parser::formula *Formula, std::string &evaluate_text, int verbose_level)
void cheat_sheet(graphics::layered_graph_draw_options *O, int verbose_level)
void canonical_labeling(geometry::object_with_canonical_form *OiP, int *canonical_labeling, int verbose_level)
void report_decomposition_by_group(groups::strong_generators *SG, std::ostream &ost, std::string &fname_base, int verbose_level)
void do_cheat_sheet_for_decomposition_by_subgroup(std::string &label, groups::linear_group_description *subgroup_Descr, int verbose_level)
void report_decomposition_by_single_automorphism(int *Elt, std::ostream &ost, std::string &fname_base, int verbose_level)
void create_quartic_curve(applications_in_algebraic_geometry::quartic_curves::quartic_curve_create_description *Quartic_curve_descr, applications_in_algebraic_geometry::quartic_curves::quartic_curve_create *&QC, int verbose_level)
void compute_group_of_set(long int *set, int set_sz, groups::strong_generators *&Sg, int verbose_level)
void report_orbits_on_points_lines_and_planes(int *Elt, std::ostream &ost, int verbose_level)
void setup_surface_with_action(applications_in_algebraic_geometry::cubic_surfaces_in_general::surface_with_action *&Surf_A, int verbose_level)
to classify spreads of PG(k-1,q) in PG(n-1,q) where k divides n
Definition: spreads.h:106
void init(projective_geometry::projective_space_with_action *PA, int k, int f_recoordinatize, int verbose_level)
void init2(poset_classification::poset_classification_control *Control, int verbose_level)
#define FREE_int(p)
Definition: foundations.h:640
#define Int_vec_zero(A, B)
Definition: foundations.h:713
#define Int_vec_print_fully(A, B, C)
Definition: foundations.h:687
#define Lint_vec_scan(A, B, C)
Definition: foundations.h:717
#define NEW_pvoid(n)
Definition: foundations.h:637
#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 Int_matrix_print(A, B, C)
Definition: foundations.h:707
#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
induced_actions::action_on_grassmannian * AG