Orbiter 2022
Combinatorial Objects
schlaefli.cpp
Go to the documentation of this file.
1/*
2 * schlaefli.cpp
3 *
4 * Created on: Oct 13, 2020
5 * Author: betten
6 */
7
8
9
10
11#include "foundations.h"
12
13using namespace std;
14
15
16namespace orbiter {
17namespace layer1_foundations {
18namespace algebraic_geometry {
19
20
22{
23 Surf = NULL;
24
25 Labels = NULL;
26
27 Trihedral_pairs = NULL;
30
31 Triads = NULL;
32 nb_triads = 0;
33
39 Eckardt_points = NULL;
40 Eckard_point_label = NULL;
42
45
48
50
51 Double_six = NULL;
53 Half_double_sixes = NULL;
57
61
62}
63
65{
66 int f_v = FALSE;
67
69 delete [] Eckard_point_label;
70 }
72 delete [] Eckard_point_label_tex;
73 }
74
75 if (Labels) {
77 }
78
81 }
84 }
87 }
88
89 if (f_v) {
90 cout << "before FREE_int(Trihedral_pairs);" << endl;
91 }
92 if (Trihedral_pairs) {
94 }
96 delete [] Trihedral_pair_labels;
97 }
98
99 if (Triads) {
101 }
102
105 }
108 }
109 if (f_v) {
110 cout << "before FREE_OBJECT Classify_trihedral_pairs_"
111 "row_values;" << endl;
112 }
115 }
118 }
119 if (Eckardt_points) {
121 }
122
123 if (Double_six) {
125 }
127 delete [] Double_six_label_tex;
128 }
129 if (Half_double_sixes) {
131 }
132
135 }
136
139 }
142 }
143
146 }
149 }
152 }
153
154}
155
156void schlaefli::init(surface_domain *Surf, int verbose_level)
157{
158 int f_v = (verbose_level >= 1);
159
160 if (f_v) {
161 cout << "schlaefli::init" << endl;
162 }
163
165
166
168 if (f_v) {
169 cout << "schlaefli::init before Labels->init" << endl;
170 }
171 Labels->init(verbose_level);
172 if (f_v) {
173 cout << "schlaefli::init after Labels->init" << endl;
174 }
175
176
177 if (f_v) {
178 cout << "schlaefli::init before make_trihedral_pairs" << endl;
179 }
180 make_trihedral_pairs(verbose_level);
181 if (f_v) {
182 cout << "schlaefli::init after make_trihedral_pairs" << endl;
183 }
184
185 if (f_v) {
186 cout << "schlaefli::init before make_triads" << endl;
187 }
188 make_triads(verbose_level);
189 if (f_v) {
190 cout << "schlaefli::init after make_triads" << endl;
191 }
192
193 if (f_v) {
194 cout << "schlaefli::init before process_trihedral_pairs" << endl;
195 }
196 process_trihedral_pairs(verbose_level);
197 if (f_v) {
198 cout << "schlaefli::init after process_trihedral_pairs" << endl;
199 }
200
201 if (f_v) {
202 cout << "schlaefli::init before make_Eckardt_points" << endl;
203 }
204 make_Eckardt_points(verbose_level);
205 if (f_v) {
206 cout << "schlaefli::init after make_Eckardt_points" << endl;
207 }
208
209 if (f_v) {
210 cout << "schlaefli::init before init_Trihedral_to_Eckardt" << endl;
211 }
212 init_Trihedral_to_Eckardt(verbose_level);
213 if (f_v) {
214 cout << "schlaefli::init after init_Trihedral_to_Eckardt" << endl;
215 }
216
217 if (f_v) {
218 cout << "schlaefli::init before init_collinear_Eckardt_triples" << endl;
219 }
220 init_collinear_Eckardt_triples(verbose_level);
221 if (f_v) {
222 cout << "schlaefli::init after init_collinear_Eckardt_triples" << endl;
223 }
224
225 if (f_v) {
226 cout << "schlaefli::init before init_double_sixes" << endl;
227 }
228 init_double_sixes(verbose_level);
229 if (f_v) {
230 cout << "schlaefli::init after init_double_sixes" << endl;
231 }
232
233 if (f_v) {
234 cout << "schlaefli::init before create_half_double_sixes" << endl;
235 }
236 create_half_double_sixes(verbose_level);
237 if (f_v) {
238 cout << "schlaefli::init after create_half_double_sixes" << endl;
239 }
240 //print_half_double_sixes_in_GAP();
241
242 if (f_v) {
243 cout << "schlaefli::init before init_adjacency_matrix_of_lines" << endl;
244 }
245 init_adjacency_matrix_of_lines(verbose_level);
246 if (f_v) {
247 cout << "schlaefli::init after init_adjacency_matrix_of_lines" << endl;
248 }
249
250 if (f_v) {
251 cout << "schlaefli::init before init_incidence_matrix_of_lines_vs_tritangent_planes" << endl;
252 }
254 if (f_v) {
255 cout << "schlaefli::init after init_incidence_matrix_of_lines_vs_tritangent_planes" << endl;
256 }
257
258
259 if (f_v) {
260 cout << "schlaefli::init done" << endl;
261 }
262}
263
264
265
267 int line_idx,
268 int &plane1, int &plane2, int verbose_level)
269{
270 int f_v = (verbose_level >= 1);
271 int idx;
272 int three_lines[3];
274
275 if (f_v) {
276 cout << "schlaefli::find_tritangent_planes_intersecting_in_a_line" << endl;
277 }
278 for (plane1 = 0; plane1 < nb_Eckardt_points; plane1++) {
279
280 Eckardt_points[plane1].three_lines(Surf, three_lines);
281 if (Sorting.int_vec_search_linear(three_lines, 3, line_idx, idx)) {
282 for (plane2 = plane1 + 1;
283 plane2 < nb_Eckardt_points;
284 plane2++) {
285
286 Eckardt_points[plane2].three_lines(Surf, three_lines);
287 if (Sorting.int_vec_search_linear(three_lines, 3, line_idx, idx)) {
288 if (f_v) {
289 cout << "schlaefli::find_tritangent_planes_"
290 "intersecting_in_a_line done" << endl;
291 }
292 return;
293 }
294 }
295 }
296 }
297 cout << "schlaefli::find_tritangent_planes_intersecting_in_a_line could not find "
298 "two planes" << endl;
299 exit(1);
300}
301
302void schlaefli::make_triads(int verbose_level)
303{
304 int f_v = (verbose_level >= 1);
306 int *Adj;
307 int i, j, h, u;
308
309 if (f_v) {
310 cout << "schlaefli::make_triads" << endl;
311 }
312 make_trihedral_pair_disjointness_graph(Adj, verbose_level);
313 Triads = NEW_int(40 * 3);
314 h = 0;
315 for (i = 0; i < nb_trihedral_pairs; i++) {
316 for (j = 0; j < i; j++) {
317 if (Adj[j * nb_trihedral_pairs + i]) {
318 break;
319 }
320 }
321 if (j < i) {
322 continue;
323 }
324 Triads[h * 3 + 0] = i;
325 u = 1;
326 for (j = i + 1; j < nb_trihedral_pairs; j++) {
327 if (Adj[i * nb_trihedral_pairs + j]) {
328 Triads[h * 3 + u] = j;
329 u++;
330 }
331 }
332 if (u != 3) {
333 cout << "schlaefli::make_triads u != 3" << endl;
334 exit(1);
335 }
336 h++;
337 }
338 if (h != 40) {
339 cout << "schlaefli::make_triads h != 40" << endl;
340 exit(1);
341 }
342 nb_triads = h;
343 if (f_v) {
344 cout << "schlaefli::make_triads done" << endl;
345 }
346}
347
349{
350 int f_v = (verbose_level >= 1);
352 int *T;
353 int i, j;
354
355 if (f_v) {
356 cout << "schlaefli::make_trihedral_pair_disjointness_graph" << endl;
357 cout << "nb_trihedral_pairs=" << nb_trihedral_pairs << endl;
358 }
361 for (i = 0; i < nb_trihedral_pairs; i++) {
362 Int_vec_copy(Trihedral_pairs + i * 9, T + i * 9, 9);
363 Sorting.int_vec_heapsort(T + i * 9, 9);
364 }
366 for (i = 0; i < nb_trihedral_pairs; i++) {
367 for (j = i + 1; j < nb_trihedral_pairs; j++) {
368 if (Sorting.int_vecs_are_disjoint(T + i * 9, 9, T + j * 9, 9)) {
369 Adj[i * nb_trihedral_pairs + j] = 1;
370 Adj[j * nb_trihedral_pairs + 1] = 1;
371 }
372 else {
373 }
374 }
375 }
376 FREE_int(T);
377#if 0
378 colored_graph *CG;
379
380 CG = NEW_OBJECT(colored_graph);
381
382 CG->init_adjacency_no_colors(nb_trihedral_pairs, Adj,
383 verbose_level);
384
385 FREE_int(Adj);
386#endif
387
388 if (f_v) {
389 cout << "schlaefli::make_trihedral_pair_disjointness_graph done" << endl;
390 }
391 //return CG;
392}
393
394void schlaefli::make_trihedral_pairs(int verbose_level)
395{
396 int f_v = (verbose_level >= 1);
397 int h, s, idx;
398 int subset[6];
399 int second_subset[6];
400 int complement[6];
401 int subset_complement[6];
402 int size_complement;
403 char label[1000];
406
407 if (f_v) {
408 cout << "schlaefli::make_trihedral_pairs" << endl;
409 }
410 nb_trihedral_pairs = 120;
412 Trihedral_pair_labels = new std::string [nb_trihedral_pairs];
413
414 idx = 0;
415
416 // the first type (20 of them, 6 choose 3):
417 for (h = 0; h < 20; h++, idx++) {
418 Combi.unrank_k_subset(h, subset, 6, 3);
419 Combi.set_complement(subset, 3, complement,
420 size_complement, 6);
421 snprintf(label, 1000, "%d%d%d;%d%d%d",
422 subset[0] + 1, subset[1] + 1, subset[2] + 1,
423 complement[0] + 1, complement[1] + 1, complement[2] + 1);
424
425 make_Tijk(Trihedral_pairs + idx * 9, subset[0], subset[1], subset[2]);
426 Trihedral_pair_labels[idx].assign(label);
427 }
428
429 // the second type (90 of them, (6 choose 2) times (4 choose 2)):
430 for (h = 0; h < 15; h++) {
431 Combi.unrank_k_subset(h, subset, 6, 4);
432 Combi.set_complement(subset, 4, subset_complement,
433 size_complement, 6);
434 for (s = 0; s < 6; s++, idx++) {
435 Combi.unrank_k_subset(s, second_subset, 4, 2);
436 Combi.set_complement(second_subset, 2, complement,
437 size_complement, 4);
438 make_Tlmnp(Trihedral_pairs + idx * 9,
439 subset[second_subset[0]],
440 subset[second_subset[1]],
441 subset[complement[0]],
442 subset[complement[1]]);
443 snprintf(label, 1000, "%d%d;%d%d;%d%d",
444 subset[second_subset[0]] + 1,
445 subset[second_subset[1]] + 1,
446 subset[complement[0]] + 1,
447 subset[complement[1]] + 1,
448 subset_complement[0] + 1,
449 subset_complement[1] + 1);
450 Trihedral_pair_labels[idx].assign(label);
451 }
452 }
453
454 // the third type (10 of them, (6 choose 3) divide by 2):
455 for (h = 0; h < 10; h++, idx++) {
456 Combi.unrank_k_subset(h, subset + 1, 5, 2);
457 subset[0] = 0;
458 subset[1]++;
459 subset[2]++;
460 Combi.set_complement(subset, 3, complement,
461 size_complement, 6);
463 subset[0], subset[1], subset[2],
464 complement[0], complement[1], complement[2]);
465 snprintf(label, 1000, "%d%d%d,%d%d%d",
466 subset[0] + 1,
467 subset[1] + 1,
468 subset[2] + 1,
469 complement[0] + 1,
470 complement[1] + 1,
471 complement[2] + 1);
472 Trihedral_pair_labels[idx].assign(label);
473 }
474
475 if (idx != 120) {
476 cout << "schlaefli::make_trihedral_pairs idx != 120" << endl;
477 exit(1);
478 }
479
480
481 if (f_v) {
482 cout << "The trihedral pairs are:" << endl;
484 Trihedral_pairs, 120, 9, FALSE /* f_tex */);
486 Trihedral_pairs, 120, 9, TRUE /* f_tex */);
487 }
488
489 if (f_v) {
490 cout << "schlaefli::make_trihedral_pairs done" << endl;
491 }
492}
493
495{
496 int f_v = (verbose_level >= 1);
497 int subset[3];
498 int i, j, h, rk, a;
502
503 if (f_v) {
504 cout << "schlaefli::process_trihedral_pairs" << endl;
505 }
508 for (i = 0; i < nb_trihedral_pairs; i++) {
509 for (j = 0; j < 3; j++) {
510 for (h = 0; h < 3; h++) {
511 a = Trihedral_pairs[i * 9 + j * 3 + h];
512 subset[h] = a;
513 }
514 Sorting.int_vec_heapsort(subset, 3);
515 rk = Combi.rank_k_subset(subset, 27, 3);
516 //rk = Eckardt_point_from_tritangent_plane(subset);
517 Trihedral_pairs_row_sets[i * 3 + j] = rk;
518 }
519 }
520 for (i = 0; i < nb_trihedral_pairs; i++) {
521 for (j = 0; j < 3; j++) {
522 for (h = 0; h < 3; h++) {
523 a = Trihedral_pairs[i * 9 + h * 3 + j];
524 subset[h] = a;
525 }
526 Sorting.int_vec_heapsort(subset, 3);
527 rk = Combi.rank_k_subset(subset, 27, 3);
528 //rk = Eckardt_point_from_tritangent_plane(subset);
529 Trihedral_pairs_col_sets[i * 3 + j] = rk;
530 }
531 }
532
533 if (f_v) {
534 cout << "schlaefli::process_trihedral_pairs "
535 "The trihedral pairs row sets:" << endl;
538 FALSE /* f_tex */);
539
540 cout << "The trihedral pairs col sets:" << endl;
543 FALSE /* f_tex */);
544 }
545
548 Trihedral_pairs_row_sets, 120 * 3, FALSE, 0);
549
550 if (f_v) {
551 cout << "schlaefli::process_trihedral_pairs "
552 "sorted row values:" << endl;
555 120 * 3 / 10, 10, FALSE /* f_tex */);
556 }
557
561 120 * 3, FALSE, 0);
562
563 if (f_v) {
564 cout << "schlaefli::process_trihedral_pairs "
565 "sorted col values:" << endl;
568 120 * 3 / 10, 10, FALSE /* f_tex */);
569 }
570 if (f_v) {
571 cout << "schlaefli::process_trihedral_pairs done" << endl;
572 }
573}
574
576{
577 if (i >= 6) {
578 cout << "schlaefli::line_ai i >= 6" << endl;
579 exit(1);
580 }
581 return i;
582}
583
585{
586 if (i >= 6) {
587 cout << "schlaefli::line_bi i >= 6" << endl;
588 exit(1);
589 }
590 return 6 + i;
591}
592
593int schlaefli::line_cij(int i, int j)
594{
595 int a;
597
598 if (i > j) {
599 return line_cij(j, i);
600 }
601 if (i == j) {
602 cout << "schlaefli::line_cij i==j" << endl;
603 exit(1);
604 }
605 if (i >= 6) {
606 cout << "schlaefli::line_cij i >= 6" << endl;
607 exit(1);
608 }
609 if (j >= 6) {
610 cout << "schlaefli::line_cij j >= 6" << endl;
611 exit(1);
612 }
613 a = Combi.ij2k(i, j, 6);
614 return 12 + a;
615}
616
618// 0 = a_i, 1 = b_i, 2 = c_ij
619{
620 if (line < 6) {
621 return 0;
622 }
623 else if (line < 12) {
624 return 1;
625 }
626 else if (line < 27) {
627 return 2;
628 }
629 else {
630 cout << "schlaefli::type_of_line error" << endl;
631 exit(1);
632 }
633}
634
635void schlaefli::index_of_line(int line, int &i, int &j)
636// returns i for a_i, i for b_i and (i,j) for c_ij
637{
638 int a;
640
641 if (line < 6) { // ai
642 i = line;
643 }
644 else if (line < 12) { // bj
645 i = line - 6;
646 }
647 else if (line < 27) { // c_ij
648 a = line - 12;
649 Combi.k2ij(a, i, j, 6);
650 }
651 else {
652 cout << "schlaefli::index_of_line error" << endl;
653 exit(1);
654 }
655}
656
657int schlaefli::third_line_in_tritangent_plane(int l1, int l2, int verbose_level)
658{
659 int f_v = (verbose_level >= 1);
660 int h, i, j, k, l, m, n;
661
662 if (f_v) {
663 cout << "schlaefli::third_line_in_tritangent_plane" << endl;
664 }
665 if (l1 > l2) {
666 int t = l1;
667 l1 = l2;
668 l2 = t;
669 }
670 // now l1 < l2.
671 if (l1 < 6) {
672 // l1 = ai line
673 i = l1;
674 if (l2 < 6) {
675 cout << "schlaefli::third_line_in_tritangent_plane impossible (1)" << endl;
676 exit(1);
677 }
678 if (l2 < 12) {
679 j = l2 - 6;
680 return line_cij(i, j);
681 }
682 else {
683 index_of_line(l2, h, k);
684 if (h == i) {
685 return line_bi(k);
686 }
687 else if (k == i) {
688 return line_bi(h);
689 }
690 else {
691 cout << "schlaefli::third_line_in_tritangent_plane impossible (2)" << endl;
692 exit(1);
693 }
694 }
695 }
696 else if (l1 < 12) {
697 // l1 = bh line
698 h = l1 - 6;
699 if (l2 < 12) {
700 cout << "schlaefli::third_line_in_tritangent_plane impossible (3)" << endl;
701 exit(1);
702 }
703 index_of_line(l2, i, j);
704 if (i == h) {
705 return line_ai(j);
706 }
707 else if (h == j) {
708 return line_ai(i);
709 }
710 else {
711 cout << "schlaefli::third_line_in_tritangent_plane impossible (4)" << endl;
712 exit(1);
713 }
714 }
715 else {
716 // now we must be in a tritangent plane c_{ij,kl,mn}
717 index_of_line(l1, i, j);
718 index_of_line(l2, k, l);
719
720 ijkl2mn(i, j, k, l, m, n);
721
722 return line_cij(m, n);
723 }
724}
725
726void schlaefli::make_Tijk(int *T, int i, int j, int k)
727{
728 T[0] = line_cij(j, k);
729 T[1] = line_bi(k);
730 T[2] = line_ai(j);
731 T[3] = line_ai(k);
732 T[4] = line_cij(i, k);
733 T[5] = line_bi(i);
734 T[6] = line_bi(j);
735 T[7] = line_ai(i);
736 T[8] = line_cij(i, j);
737}
738
739void schlaefli::make_Tlmnp(int *T, int l, int m, int n, int p)
740{
741 int subset[4];
742 int complement[2];
743 int size_complement;
744 int r, s;
747
748 subset[0] = l;
749 subset[1] = m;
750 subset[2] = n;
751 subset[3] = p;
752 Sorting.int_vec_heapsort(subset, 4);
753 Combi.set_complement(subset, 4, complement, size_complement, 6);
754 r = complement[0];
755 s = complement[1];
756
757 T[0] = line_ai(l);
758 T[1] = line_bi(p);
759 T[2] = line_cij(l, p);
760 T[3] = line_bi(n);
761 T[4] = line_ai(m);
762 T[5] = line_cij(m, n);
763 T[6] = line_cij(l, n);
764 T[7] = line_cij(m, p);
765 T[8] = line_cij(r, s);
766}
767
769 int d, int e, int f, int g, int h, int t)
770{
771 T[0] = line_cij(d, g);
772 T[1] = line_cij(e, h);
773 T[2] = line_cij(f, t);
774 T[3] = line_cij(e, t);
775 T[4] = line_cij(f, g);
776 T[5] = line_cij(d, h);
777 T[6] = line_cij(f, h);
778 T[7] = line_cij(d, t);
779 T[8] = line_cij(e, g);
780}
781
782void schlaefli::make_Eckardt_points(int verbose_level)
783{
784 int f_v = (verbose_level >= 1);
785 int i;
786 char str[1000];
787
788 if (f_v) {
789 cout << "schlaefli::make_Eckardt_points" << endl;
790 }
793 for (i = 0; i < nb_Eckardt_points; i++) {
795 }
798 for (i = 0; i < nb_Eckardt_points; i++) {
800 Eckard_point_label[i].assign(str);
801 Eckard_point_label_tex[i].assign(str);
802 }
803 if (f_v) {
804 cout << "schlaefli::make_Eckardt_points done" << endl;
805 }
806}
807
808
810{
811 int f_v = (verbose_level >= 1);
812 int t, i, j, rk;
813 int tritangent_plane[3];
815
816 if (f_v) {
817 cout << "schlaefli::init_Trihedral_to_Eckardt" << endl;
818 }
821 for (t = 0; t < nb_trihedral_pairs; t++) {
822 for (i = 0; i < 3; i++) {
823 for (j = 0; j < 3; j++) {
824 tritangent_plane[j] = Trihedral_pairs[t * 9 + i * 3 + j];
825 }
826 rk = Eckardt_point_from_tritangent_plane(tritangent_plane);
827 Trihedral_to_Eckardt[t * 6 + i] = rk;
828 }
829 for (j = 0; j < 3; j++) {
830 for (i = 0; i < 3; i++) {
831 tritangent_plane[i] = Trihedral_pairs[t * 9 + i * 3 + j];
832 }
833 rk = Eckardt_point_from_tritangent_plane(tritangent_plane);
834 Trihedral_to_Eckardt[t * 6 + 3 + j] = rk;
835 }
836 }
837 if (f_v) {
838 cout << "Trihedral_to_Eckardt:" << endl;
841 FALSE /* f_tex */);
842 }
843 if (f_v) {
844 cout << "schlaefli::init_Trihedral_to_Eckardt done" << endl;
845 }
846}
847
848
850{
851 int a, b, c, rk;
854
855 Sorting.int_vec_heapsort(tritangent_plane, 3);
856 a = tritangent_plane[0];
857 b = tritangent_plane[1];
858 c = tritangent_plane[2];
859 if (a < 6) {
860 E.init2(a, b - 6);
861 }
862 else {
863 if (a < 12) {
864 cout << "schlaefli::Eckardt_point_from_tritangent_plane a < 12" << endl;
865 exit(1);
866 }
867 a -= 12;
868 b -= 12;
869 c -= 12;
870 E.init3(a, b, c);
871 }
872 rk = E.rank();
873 return rk;
874}
875
876
878{
879 int f_v = (verbose_level >= 1);
880 int t, i, rk, h;
881 int subset[3];
885
886 if (f_v) {
887 cout << "schlaefli::init_collinear_Eckardt_triples" << endl;
888 }
891 for (t = 0; t < nb_trihedral_pairs; t++) {
892 for (i = 0; i < 2; i++) {
893 for (h = 0; h < 3; h++) {
894 subset[h] = Trihedral_to_Eckardt[6 * t + i * 3 + h];
895 }
896 Sorting.int_vec_heapsort(subset, 3);
897 rk = Combi.rank_k_subset(subset, nb_Eckardt_points, 3);
898 collinear_Eckardt_triples_rank[t * 2 + i] = rk;
899 }
900 }
901 if (f_v) {
902 cout << "collinear_Eckardt_triples_rank:" << endl;
905 FALSE /* f_tex */);
906 }
907
911 FALSE, 0);
912
913 if (f_v) {
914 cout << "schlaefli::init_collinear_Eckardt_triples done" << endl;
915 }
916}
917
919 int *E_idx, int nb_E,
920 int *&T_idx, int &nb_T, int verbose_level)
921{
922 int f_v = (verbose_level >= 1);
923 int nCk, h, k, rk, idx, i, t_idx;
924 int subset[3];
925 int set[3];
928
929 if (f_v) {
930 cout << "schlaefli::find_trihedral_pairs_from_collinear_"
931 "triples_of_Eckardt_points" << endl;
932 }
933 nCk = Combi.int_n_choose_k(nb_E, 3);
934 T_idx = NEW_int(nCk);
935 nb_T = 0;
936 for (h = 0; h < nCk; h++) {
937 //cout << "subset " << h << " / " << nCk << ":";
938 Combi.unrank_k_subset(h, subset, nb_E, 3);
939 //int_vec_print(cout, subset, 3);
940 //cout << " = ";
941
942 for (k = 0; k < 3; k++) {
943 set[k] = E_idx[subset[k]];
944 }
945 //int_vec_print(cout, set, 3);
946 //cout << " = ";
947 Sorting.int_vec_heapsort(set, 3);
948
949 rk = Combi.rank_k_subset(set, nb_Eckardt_points, 3);
950
951
952 //int_vec_print(cout, set, 3);
953 //cout << " rk=" << rk << endl;
954
955 if (Sorting.int_vec_search(
958 //cout << "idx=" << idx << endl;
959 for (i = idx; i >= 0; i--) {
960 //cout << "i=" << i << " value="
961 // << Classify_collinear_Eckardt_triples->data_sorted[i]
962 // << " collinear triple index = "
963 // << Classify_collinear_Eckardt_triples->sorting_perm_inv[
964 // i] / 3 << endl;
966 break;
967 }
968 t_idx =
970
971#if 0
972 int idx2, j;
973
974 if (!int_vec_search(T_idx, nb_T, t_idx, idx2)) {
975 for (j = nb_T; j > idx2; j--) {
976 T_idx[j] = T_idx[j - 1];
977 }
978 T_idx[idx2] = t_idx;
979 nb_T++;
980 }
981 else {
982 cout << "We already have this trihedral pair" << endl;
983 }
984#else
985 T_idx[nb_T++] = t_idx;
986#endif
987 }
988 }
989
990 }
991
992
993#if 1
995
996 C.init(T_idx, nb_T, TRUE, 0);
997 cout << "The trihedral pairs come in these multiplicities: ";
998 C.print_naked(TRUE);
999 cout << endl;
1000
1001 int t2, f2, l2, sz;
1002 int t1, f1, /*l1,*/ pt;
1003
1004 for (t2 = 0; t2 < C.second_nb_types; t2++) {
1005 f2 = C.second_type_first[t2];
1006 l2 = C.second_type_len[t2];
1007 sz = C.second_data_sorted[f2];
1008 if (sz != 1) {
1009 continue;
1010 }
1011 //cout << "clebsch::clebsch_map_print_fibers fibers of size "
1012 // << sz << ":" << endl;
1013 //*fp << "There are " << l2 << " fibers of size " << sz
1014 // << ":\\\\" << endl;
1015 for (i = 0; i < l2; i++) {
1016 t1 = C.second_sorting_perm_inv[f2 + i];
1017 f1 = C.type_first[t1];
1018 //l1 = C.type_len[t1];
1019 pt = C.data_sorted[f1];
1020 T_idx[i] = pt;
1021#if 0
1022 //*fp << "Arc pt " << pt << ", fiber $\\{"; // << l1
1023 // << " surface points in the list of Pts (local numbering): ";
1024 for (j = 0; j < l1; j++) {
1025 u = C.sorting_perm_inv[f1 + j];
1026
1027 cout << u << endl;
1028 //*fp << u;
1029 //cout << Pts[u];
1030 if (j < l1 - 1) {
1031 cout << ", ";
1032 }
1033 }
1034#endif
1035 }
1036 nb_T = l2;
1037 }
1038#endif
1039
1040
1041
1042 cout << "Found " << nb_T << " special trihedral pairs:" << endl;
1043 cout << "T_idx: ";
1044 Int_vec_print(cout, T_idx, nb_T);
1045 cout << endl;
1046 for (i = 0; i < nb_T; i++) {
1047 cout << i << " / " << nb_T << " T_{"
1048 << Trihedral_pair_labels[T_idx[i]] << "}" << endl;
1049 }
1050 if (f_v) {
1051 cout << "schlaefli::find_trihedral_pairs_from_collinear_"
1052 "triples_of_Eckardt_points done" << endl;
1053 }
1054}
1055
1056
1057void schlaefli::init_double_sixes(int verbose_level)
1058{
1059 int f_v = (verbose_level >= 1);
1060 int i, j, k, ij, u, v, l, m, n, h, a, b, c;
1061 int set[6];
1062 int size_complement;
1064
1065 if (f_v) {
1066 cout << "schlaefli::init_double_sixes" << endl;
1067 }
1068 Double_six = NEW_lint(36 * 12);
1069 h = 0;
1070 // first type: D : a_1,..., a_6; b_1, ..., b_6
1071 for (i = 0; i < 12; i++) {
1072 Double_six[h * 12 + i] = i;
1073 }
1074 h++;
1075
1076 // second type:
1077 // D_{ij} :
1078 // a_1, b_1, c_23, c_24, c_25, c_26;
1079 // a_2, b_2, c_13, c_14, c_15, c_16
1080 for (ij = 0; ij < 15; ij++, h++) {
1081 //cout << "second type " << ij << " / " << 15 << endl;
1082 Combi.k2ij(ij, i, j, 6);
1083 set[0] = i;
1084 set[1] = j;
1085 Combi.set_complement(set, 2 /* subset_size */, set + 2,
1086 size_complement, 6 /* universal_set_size */);
1087 //cout << "set : ";
1088 //int_vec_print(cout, set, 6);
1089 //cout << endl;
1090 Double_six[h * 12 + 0] = line_ai(i);
1091 Double_six[h * 12 + 1] = line_bi(i);
1092 for (u = 0; u < 4; u++) {
1093 Double_six[h * 12 + 2 + u] = line_cij(j, set[2 + u]);
1094 }
1095 Double_six[h * 12 + 6] = line_ai(j);
1096 Double_six[h * 12 + 7] = line_bi(j);
1097 for (u = 0; u < 4; u++) {
1098 Double_six[h * 12 + 8 + u] = line_cij(i, set[2 + u]);
1099 }
1100 }
1101
1102 // third type: D_{ijk} :
1103 // a_1, a_2, a_3, c_56, c_46, c_45;
1104 // c_23, c_13, c_12, b_4, b_5, b_6
1105 for (v = 0; v < 20; v++, h++) {
1106 //cout << "third type " << v << " / " << 20 << endl;
1107 Combi.unrank_k_subset(v, set, 6, 3);
1108 Combi.set_complement(set, 3 /* subset_size */, set + 3,
1109 size_complement, 6 /* universal_set_size */);
1110 i = set[0];
1111 j = set[1];
1112 k = set[2];
1113 l = set[3];
1114 m = set[4];
1115 n = set[5];
1116 Double_six[h * 12 + 0] = line_ai(i);
1117 Double_six[h * 12 + 1] = line_ai(j);
1118 Double_six[h * 12 + 2] = line_ai(k);
1119 Double_six[h * 12 + 3] = line_cij(m, n);
1120 Double_six[h * 12 + 4] = line_cij(l, n);
1121 Double_six[h * 12 + 5] = line_cij(l, m);
1122 Double_six[h * 12 + 6] = line_cij(j, k);
1123 Double_six[h * 12 + 7] = line_cij(i, k);
1124 Double_six[h * 12 + 8] = line_cij(i, j);
1125 Double_six[h * 12 + 9] = line_bi(l);
1126 Double_six[h * 12 + 10] = line_bi(m);
1127 Double_six[h * 12 + 11] = line_bi(n);
1128 }
1129
1130 if (h != 36) {
1131 cout << "schlaefli::init_double_sixes h != 36" << endl;
1132 exit(1);
1133 }
1134
1135 Double_six_label_tex = new string [36];
1136 char str[1000];
1137
1138 for (i = 0; i < 36; i++) {
1139 if (i < 1) {
1140 snprintf(str, 1000, "{\\cal D}");
1141 }
1142 else if (i < 1 + 15) {
1143 ij = i - 1;
1144 Combi.k2ij(ij, a, b, 6);
1145 set[0] = a;
1146 set[1] = b;
1147 Combi.set_complement(set, 2 /* subset_size */, set + 2,
1148 size_complement, 6 /* universal_set_size */);
1149 snprintf(str, 1000, "{\\cal D}_{%d%d}", a + 1, b + 1);
1150 }
1151 else {
1152 v = i - 16;
1153 Combi.unrank_k_subset(v, set, 6, 3);
1154 Combi.set_complement(set, 3 /* subset_size */, set + 3,
1155 size_complement, 6 /* universal_set_size */);
1156 a = set[0];
1157 b = set[1];
1158 c = set[2];
1159 snprintf(str, 1000, "{\\cal D}_{%d%d%d}", a + 1, b + 1, c + 1);
1160 }
1161 if (f_v) {
1162 cout << "creating label " << str
1163 << " for Double six " << i << endl;
1164 }
1165 Double_six_label_tex[i].assign(str);
1166 }
1167
1168 if (f_v) {
1169 cout << "schlaefli::init_double_sixes done" << endl;
1170 }
1171}
1172
1174{
1175 int f_v = (verbose_level >= 1);
1176 int i, j, a, b, c, ij, v;
1177 int set[6];
1178 int size_complement;
1181
1182 if (f_v) {
1183 cout << "schlaefli::create_half_double_sixes" << endl;
1184 }
1185 Half_double_sixes = NEW_lint(72 * 6);
1188
1190 for (i = 0; i < 36; i++) {
1191 for (j = 0; j < 2; j++) {
1192 Sorting.lint_vec_heapsort(
1193 Half_double_sixes + (2 * i + j) * 6, 6);
1194 Half_double_six_to_double_six[2 * i + j] = i;
1195 Half_double_six_to_double_six_row[2 * i + j] = j;
1196 }
1197 }
1198 Half_double_six_label_tex = new string [72];
1199 char str[1000];
1200
1201 for (i = 0; i < 36; i++) {
1202 for (j = 0; j < 2; j++) {
1203 if (i < 1) {
1204 snprintf(str, 1000, "D");
1205 }
1206 else if (i < 1 + 15) {
1207 ij = i - 1;
1208 Combi.k2ij(ij, a, b, 6);
1209 set[0] = a;
1210 set[1] = b;
1211 Combi.set_complement(set, 2 /* subset_size */,
1212 set + 2, size_complement,
1213 6 /* universal_set_size */);
1214 snprintf(str, 1000, "D_{%d%d}", a + 1, b + 1);
1215 }
1216 else {
1217 v = i - 16;
1218 Combi.unrank_k_subset(v, set, 6, 3);
1219 Combi.set_complement(set, 3 /* subset_size */,
1220 set + 3, size_complement,
1221 6 /* universal_set_size */);
1222 a = set[0];
1223 b = set[1];
1224 c = set[2];
1225 snprintf(str, 1000, "D_{%d%d%d}",
1226 a + 1, b + 1, c + 1);
1227 }
1228 if (j == 0) {
1229 sprintf(str + strlen(str), "^\\top");
1230 }
1231 else {
1232 sprintf(str + strlen(str), "^\\bot");
1233 }
1234 if (f_v) {
1235 cout << "creating label " << str
1236 << " for half double six "
1237 << 2 * i + j << endl;
1238 }
1239 Half_double_six_label_tex[2 * i + j].assign(str);
1240 }
1241 }
1242
1243 if (f_v) {
1244 cout << "schlaefli::create_half_double_sixes done" << endl;
1245 }
1246}
1247
1248int schlaefli::find_half_double_six(long int *half_double_six)
1249{
1250 int i;
1252
1253 Sorting.lint_vec_heapsort(half_double_six, 6);
1254 for (i = 0; i < 72; i++) {
1255 if (Sorting.lint_vec_compare(half_double_six,
1256 Half_double_sixes + i * 6, 6) == 0) {
1257 return i;
1258 }
1259 }
1260 cout << "schlaefli::find_half_double_six did not find "
1261 "half double six" << endl;
1262 exit(1);
1263}
1264
1265void schlaefli::ijklm2n(int i, int j, int k, int l, int m, int &n)
1266{
1267 int v[6];
1268 int size_complement;
1270
1271 v[0] = i;
1272 v[1] = j;
1273 v[2] = k;
1274 v[3] = l;
1275 v[4] = m;
1276 Combi.set_complement_safe(v, 5, v + 5, size_complement, 6);
1277 if (size_complement != 1) {
1278 cout << "schlaefli::ijklm2n size_complement != 1" << endl;
1279 exit(1);
1280 }
1281 n = v[5];
1282}
1283
1284void schlaefli::ijkl2mn(int i, int j, int k, int l, int &m, int &n)
1285{
1286 int v[6];
1287 int size_complement;
1289
1290 v[0] = i;
1291 v[1] = j;
1292 v[2] = k;
1293 v[3] = l;
1294 Combi.set_complement_safe(v, 4, v + 4, size_complement, 6);
1295 if (size_complement != 2) {
1296 cout << "schlaefli::ijkl2mn size_complement != 2" << endl;
1297 exit(1);
1298 }
1299 m = v[4];
1300 n = v[5];
1301}
1302
1303void schlaefli::ijk2lmn(int i, int j, int k, int &l, int &m, int &n)
1304{
1305 int v[6];
1306 int size_complement;
1308
1309 v[0] = i;
1310 v[1] = j;
1311 v[2] = k;
1312 cout << "schlaefli::ijk2lmn v=";
1313 Int_vec_print(cout, v, 3);
1314 cout << endl;
1315 Combi.set_complement_safe(v, 3, v + 3, size_complement, 6);
1316 if (size_complement != 3) {
1317 cout << "schlaefli::ijk2lmn size_complement != 3" << endl;
1318 cout << "size_complement=" << size_complement << endl;
1319 exit(1);
1320 }
1321 l = v[3];
1322 m = v[4];
1323 n = v[5];
1324}
1325
1326void schlaefli::ij2klmn(int i, int j, int &k, int &l, int &m, int &n)
1327{
1328 int v[6];
1329 int size_complement;
1331
1332 v[0] = i;
1333 v[1] = j;
1334 Combi.set_complement_safe(v, 2, v + 2, size_complement, 6);
1335 if (size_complement != 4) {
1336 cout << "schlaefli::ij2klmn size_complement != 4" << endl;
1337 exit(1);
1338 }
1339 k = v[2];
1340 l = v[3];
1341 m = v[4];
1342 n = v[5];
1343}
1344
1346 int line1, int line2, int transversal,
1347 int hds[6],
1348 int verbose_level)
1349{
1350 int f_v = (verbose_level >= 1);
1351 int t1, t2, t3;
1352 int i, j, k, l, m, n;
1353 int i1, j1;
1354 int null;
1355
1356 if (f_v) {
1357 cout << "schlaefli::get_half_double_six_associated_with_Clebsch_map" << endl;
1358 }
1359
1360 if (line1 > line2) {
1361 cout << "schlaefli::get_half_double_six_associated_"
1362 "with_Clebsch_map line1 > line2" << endl;
1363 exit(1);
1364 }
1365 t1 = type_of_line(line1);
1366 t2 = type_of_line(line2);
1367 t3 = type_of_line(transversal);
1368
1369 if (f_v) {
1370 cout << "t1=" << t1 << " t2=" << t2 << " t3=" << t3 << endl;
1371 }
1372 if (t1 == 0 && t2 == 0) { // ai and aj:
1373 index_of_line(line1, i, null);
1374 index_of_line(line2, j, null);
1375 if (t3 == 1) { // bk
1376 index_of_line(transversal, k, null);
1377 //cout << "i=" << i << " j=" << j << " k=" << k <<< endl;
1378 ijk2lmn(i, j, k, l, m, n);
1379 // bl, bm, bn, cij, cik, cjk
1380 hds[0] = line_bi(l);
1381 hds[1] = line_bi(m);
1382 hds[2] = line_bi(n);
1383 hds[3] = line_cij(i, j);
1384 hds[4] = line_cij(i, k);
1385 hds[5] = line_cij(j, k);
1386 }
1387 else if (t3 == 2) { // cij
1388 index_of_line(transversal, i1, j1);
1389 // test whether {i1,j1} = {i,j}
1390 if ((i == i1 && j == j1) || (i == j1 && j == i1)) {
1391 ij2klmn(i, j, k, l, m, n);
1392 // bi, bj, bk, bl, bm, bn
1393 hds[0] = line_bi(i);
1394 hds[1] = line_bi(j);
1395 hds[2] = line_bi(k);
1396 hds[3] = line_bi(l);
1397 hds[4] = line_bi(m);
1398 hds[5] = line_bi(n);
1399 }
1400 else {
1401 cout << "schlaefli::get_half_doble_six_associated_"
1402 "with_Clebsch_map not {i,j} = {i1,j1}" << endl;
1403 exit(1);
1404 }
1405 }
1406 }
1407 else if (t1 == 1 && t2 == 1) { // bi and bj:
1408 index_of_line(line1, i, null);
1409 index_of_line(line2, j, null);
1410 if (t3 == 0) { // ak
1411 index_of_line(transversal, k, null);
1412 ijk2lmn(i, j, k, l, m, n);
1413 // al, am, an, cij, cik, cjk
1414 hds[0] = line_ai(l);
1415 hds[1] = line_ai(m);
1416 hds[2] = line_ai(n);
1417 hds[3] = line_cij(i, j);
1418 hds[4] = line_cij(i, k);
1419 hds[5] = line_cij(j, k);
1420 }
1421 else if (t3 == 2) { // cij
1422 index_of_line(transversal, i1, j1);
1423 if ((i == i1 && j == j1) || (i == j1 && j == i1)) {
1424 ij2klmn(i, j, k, l, m, n);
1425 // ai, aj, ak, al, am, an
1426 hds[0] = line_ai(i);
1427 hds[1] = line_ai(j);
1428 hds[2] = line_ai(k);
1429 hds[3] = line_ai(l);
1430 hds[4] = line_ai(m);
1431 hds[5] = line_ai(n);
1432 }
1433 else {
1434 cout << "schlaefli::get_half_doble_six_associated_"
1435 "with_Clebsch_map not {i,j} = {i1,j1}" << endl;
1436 exit(1);
1437 }
1438 }
1439 }
1440 else if (t1 == 0 && t2 == 1) { // ai and bi:
1441 index_of_line(line1, i, null);
1442 index_of_line(line2, j, null);
1443 if (j != i) {
1444 cout << "schlaefli::get_half_double_six_associated_"
1445 "with_Clebsch_map j != i" << endl;
1446 exit(1);
1447 }
1448 if (t3 != 2) {
1449 cout << "schlaefli::get_half_double_six_associated_"
1450 "with_Clebsch_map t3 != 2" << endl;
1451 exit(1);
1452 }
1453 index_of_line(transversal, i1, j1);
1454 if (i1 == i) {
1455 j = j1;
1456 }
1457 else {
1458 j = i1;
1459 }
1460 ij2klmn(i, j, k, l, m, n);
1461 // cik, cil, cim, cin, aj, bj
1462 hds[0] = line_cij(i, k);
1463 hds[1] = line_cij(i, l);
1464 hds[2] = line_cij(i, m);
1465 hds[3] = line_cij(i, n);
1466 hds[4] = line_ai(j);
1467 hds[5] = line_bi(j);
1468 }
1469 else if (t1 == 1 && t2 == 2) { // bi and cjk:
1470 index_of_line(line1, i, null);
1471 index_of_line(line2, j, k);
1472 if (t3 == 2) { // cil
1473 index_of_line(transversal, i1, j1);
1474 if (i1 == i) {
1475 l = j1;
1476 }
1477 else if (j1 == i) {
1478 l = i1;
1479 }
1480 else {
1481 cout << "schlaefli::get_half_double_six_associated_"
1482 "with_Clebsch_map error" << endl;
1483 exit(1);
1484 }
1485 ijkl2mn(i, j, k, l, m, n);
1486 // cin, cim, aj, ak, al, cnm
1487 hds[0] = line_cij(i, n);
1488 hds[1] = line_cij(i, m);
1489 hds[2] = line_ai(j);
1490 hds[3] = line_ai(k);
1491 hds[4] = line_ai(l);
1492 hds[5] = line_cij(n, m);
1493 }
1494 else if (t3 == 0) { // aj
1495 index_of_line(transversal, j1, null);
1496 if (j1 == k) {
1497 // swap k and j
1498 int tmp = k;
1499 k = j;
1500 j = tmp;
1501 }
1502 if (j1 != j) {
1503 cout << "schlaefli::get_half_double_six_associated_"
1504 "with_Clebsch_map error" << endl;
1505 exit(1);
1506 }
1507 ijk2lmn(i, j, k, l, m, n);
1508 // ak, cil, cim, cin, bk, cij
1509 hds[0] = line_ai(k);
1510 hds[1] = line_cij(i, l);
1511 hds[2] = line_cij(i, m);
1512 hds[3] = line_cij(i, n);
1513 hds[4] = line_bi(k);
1514 hds[5] = line_cij(i, j);
1515 }
1516 }
1517 else if (t1 == 0 && t2 == 2) { // ai and cjk:
1518 index_of_line(line1, i, null);
1519 index_of_line(line2, j, k);
1520 if (t3 == 2) { // cil
1521 index_of_line(transversal, i1, j1);
1522 if (i1 == i) {
1523 l = j1;
1524 }
1525 else if (j1 == i) {
1526 l = i1;
1527 }
1528 else {
1529 cout << "schlaefli::get_half_double_six_associated_"
1530 "with_Clebsch_map error" << endl;
1531 exit(1);
1532 }
1533 ijkl2mn(i, j, k, l, m, n);
1534 // cin, cim, bj, bk, bl, cnm
1535 hds[0] = line_cij(i, n);
1536 hds[1] = line_cij(i, m);
1537 hds[2] = line_bi(j);
1538 hds[3] = line_bi(k);
1539 hds[4] = line_bi(l);
1540 hds[5] = line_cij(n, m);
1541 }
1542 else if (t3 == 1) { // bj
1543 index_of_line(transversal, j1, null);
1544 if (j1 == k) {
1545 // swap k and j
1546 int tmp = k;
1547 k = j;
1548 j = tmp;
1549 }
1550 if (j1 != j) {
1551 cout << "schlaefli::get_half_double_six_associated_"
1552 "with_Clebsch_map error" << endl;
1553 exit(1);
1554 }
1555 ijk2lmn(i, j, k, l, m, n);
1556 // bk, cil, cim, cin, ak, cij
1557 hds[0] = line_bi(k);
1558 hds[1] = line_cij(i, l);
1559 hds[2] = line_cij(i, m);
1560 hds[3] = line_cij(i, n);
1561 hds[4] = line_ai(k);
1562 hds[5] = line_cij(i, j);
1563 }
1564 }
1565 else if (t1 == 2 && t2 == 2) { // cij and cik:
1566 index_of_line(line1, i, j);
1567 index_of_line(line2, i1, j1);
1568 if (i == i1) {
1569 k = j1;
1570 }
1571 else if (i == j1) {
1572 k = i1;
1573 }
1574 else if (j == i1) {
1575 j = i;
1576 i = i1;
1577 k = j1;
1578 }
1579 else if (j == j1) {
1580 j = i;
1581 i = j1;
1582 k = i1;
1583 }
1584 else {
1585 cout << "schlaefli::get_half_double_six_associated_"
1586 "with_Clebsch_map error" << endl;
1587 exit(1);
1588 }
1589 if (t3 == 0) { // ai
1590 index_of_line(transversal, i1, null);
1591 if (i1 != i) {
1592 cout << "schlaefli::get_half_double_six_associated_"
1593 "with_Clebsch_map error" << endl;
1594 exit(1);
1595 }
1596 ijk2lmn(i, j, k, l, m, n);
1597 // bi, clm, cnm, cln, bj, bk
1598 hds[0] = line_bi(i);
1599 hds[1] = line_cij(l, m);
1600 hds[2] = line_cij(n, m);
1601 hds[3] = line_cij(l, n);
1602 hds[4] = line_bi(j);
1603 hds[5] = line_bi(k);
1604 }
1605 else if (t3 == 1) { // bi
1606 index_of_line(transversal, i1, null);
1607 if (i1 != i) {
1608 cout << "schlaefli::get_half_double_six_associated_"
1609 "with_Clebsch_map error" << endl;
1610 exit(1);
1611 }
1612 ijk2lmn(i, j, k, l, m, n);
1613 // ai, clm, cnm, cln, aj, ak
1614 hds[0] = line_ai(i);
1615 hds[1] = line_cij(l, m);
1616 hds[2] = line_cij(n, m);
1617 hds[3] = line_cij(l, n);
1618 hds[4] = line_ai(j);
1619 hds[5] = line_ai(k);
1620 }
1621 else if (t3 == 2) { // clm
1622 index_of_line(transversal, l, m);
1623 ijklm2n(i, j, k, l, m, n);
1624 // ai, bi, cmn, cln, ckn, cjn
1625 hds[0] = line_ai(i);
1626 hds[1] = line_bi(i);
1627 hds[2] = line_cij(m, n);
1628 hds[3] = line_cij(l, n);
1629 hds[4] = line_cij(k, n);
1630 hds[5] = line_cij(j, n);
1631 }
1632 }
1633 else {
1634 cout << "schlaefli::get_half_double_six_associated_"
1635 "with_Clebsch_map error" << endl;
1636 exit(1);
1637 }
1638 if (f_v) {
1639 cout << "schlaefli::get_half_double_six_associated_with_Clebsch_map done" << endl;
1640 }
1641}
1642
1643void schlaefli::prepare_clebsch_map(int ds, int ds_row,
1644 int &line1, int &line2, int &transversal,
1645 int verbose_level)
1646{
1647 int ij, i, j, k, l, m, n, size_complement;
1648 int set[6];
1650
1651 if (ds == 0) {
1652 if (ds_row == 0) {
1653 line1 = line_bi(0);
1654 line2 = line_bi(1);
1655 transversal = line_cij(0, 1);
1656 return;
1657 }
1658 else {
1659 line1 = line_ai(0);
1660 line2 = line_ai(1);
1661 transversal = line_cij(0, 1);
1662 return;
1663 }
1664 }
1665 ds--;
1666 if (ds < 15) {
1667 ij = ds;
1668 Combi.k2ij(ij, i, j, 6);
1669
1670 if (ds_row == 0) {
1671 line1 = line_ai(j);
1672 line2 = line_bi(j);
1673 transversal = line_cij(i, j);
1674 return;
1675 }
1676 else {
1677 line1 = line_ai(i);
1678 line2 = line_bi(i);
1679 transversal = line_cij(i, j);
1680 return;
1681 }
1682 }
1683 ds -= 15;
1684 Combi.unrank_k_subset(ds, set, 6, 3);
1685 Combi.set_complement(set, 3 /* subset_size */, set + 3,
1686 size_complement, 6 /* universal_set_size */);
1687 i = set[0];
1688 j = set[1];
1689 k = set[2];
1690 l = set[3];
1691 m = set[4];
1692 n = set[5];
1693 if (ds_row == 0) {
1694 line1 = line_bi(l);
1695 line2 = line_bi(m);
1696 transversal = line_ai(n);
1697 return;
1698 }
1699 else {
1700 line1 = line_ai(i);
1701 line2 = line_ai(j);
1702 transversal = line_bi(k);
1703 return;
1704 }
1705}
1706
1708{
1709 int f_v = (verbose_level >= 1);
1710 int i, j, k, l;
1711
1712 if (f_v) {
1713 cout << "schlaefli::init_adjacency_matrix_of_lines" << endl;
1714 }
1715
1718
1719 // the ai lines:
1720 for (i = 0; i < 6; i++) {
1721 for (j = 0; j < 6; j++) {
1722 if (j == i) {
1723 continue;
1724 }
1726 }
1727 for (k = 0; k < 6; k++) {
1728 if (k == i) {
1729 continue;
1730 }
1732 }
1733 }
1734
1735
1736 // the bi lines:
1737 for (i = 0; i < 6; i++) {
1738 for (j = 0; j < 6; j++) {
1739 if (j == i) {
1740 continue;
1741 }
1743 }
1744 for (k = 0; k < 6; k++) {
1745 if (k == i) {
1746 continue;
1747 }
1749 }
1750 }
1751
1752
1753
1754
1755 // the cij lines:
1756 for (i = 0; i < 6; i++) {
1757 for (j = 0; j < 6; j++) {
1758 if (j == i) {
1759 continue;
1760 }
1761 for (k = 0; k < 6; k++) {
1762 if (k == i) {
1763 continue;
1764 }
1765 if (k == j) {
1766 continue;
1767 }
1768 for (l = 0; l < 6; l++) {
1769 if (l == i) {
1770 continue;
1771 }
1772 if (l == j) {
1773 continue;
1774 }
1775 if (k == l) {
1776 continue;
1777 }
1779 line_cij(i, j), line_cij(k, l));
1780 } // next l
1781 } // next k
1782 } // next j
1783 } // next i
1784
1785 int r, c;
1786
1787 for (i = 0; i < 27; i++) {
1788 r = 0;
1789 for (j = 0; j < 27; j++) {
1791 r++;
1792 }
1793 }
1794 if (r != 10) {
1795 cout << "schlaefli::init_adjacency_matrix_of_lines "
1796 "row sum r != 10, r = " << r << " in row " << i << endl;
1797 }
1798 }
1799
1800 for (j = 0; j < 27; j++) {
1801 c = 0;
1802 for (i = 0; i < 27; i++) {
1804 c++;
1805 }
1806 }
1807 if (c != 10) {
1808 cout << "schlaefli::init_adjacency_matrix_of_lines "
1809 "col sum c != 10, c = " << c << " in col " << j << endl;
1810 }
1811 }
1812
1813 if (f_v) {
1814 cout << "schlaefli::init_adjacency_matrix_of_lines done" << endl;
1815 }
1816}
1817
1819{
1820 int f_v = (verbose_level >= 1);
1821 int i, j, h;
1822 int three_lines[3];
1823
1824 if (f_v) {
1825 cout << "schlaefli::init_incidence_matrix_of_lines_vs_tritangent_planes" << endl;
1826 }
1827
1830
1831
1834
1835 for (j = 0; j < nb_Eckardt_points; j++) {
1836 eckardt_point *E;
1837
1838 E = Eckardt_points + j;
1839 E->three_lines(Surf, three_lines);
1840 for (h = 0; h < 3; h++) {
1841 Lines_in_tritangent_planes[j * 3 + h] = three_lines[h];
1842 // conversion to long int
1843 }
1844 for (h = 0; h < 3; h++) {
1845 i = three_lines[h];
1847 }
1848 }
1849
1850
1851
1852 if (f_v) {
1853 cout << "schlaefli::init_incidence_matrix_of_lines_vs_tritangent_planes done" << endl;
1854 }
1855}
1856
1858{
1859 adjacency_matrix_of_lines[i * 27 + j] = 1;
1860 adjacency_matrix_of_lines[j * 27 + i] = 1;
1861}
1862
1864{
1865 return adjacency_matrix_of_lines[i * 27 + j];
1866}
1867
1869 int transversal_line, int verbose_level)
1870{
1871 int f_v = (verbose_level >= 1);
1872 int j, nb;
1873 int planes[45];
1874
1875 if (f_v) {
1876 cout << "schlaefli::choose_tritangent_plane_for_Clebsch_map" << endl;
1877 }
1878
1879 nb = 0;
1880 for (j = 0; j < 45; j++) {
1881 if (incidence_lines_vs_tritangent_planes[line_a * 45 + j] == 0 &&
1882 incidence_lines_vs_tritangent_planes[line_b * 45 + j] == 0 &&
1883 incidence_lines_vs_tritangent_planes[transversal_line * 45 + j]) {
1884 planes[nb++] = j;
1885 }
1886 }
1887 if (nb != 3) {
1888 cout << "schlaefli::choose_tritangent_plane_for_Clebsch_map nb != 3" << endl;
1889 exit(1);
1890 }
1891 if (f_v) {
1892 cout << "schlaefli::choose_tritangent_plane_for_Clebsch_map done" << endl;
1893 }
1894 return planes[0];
1895}
1896
1898{
1899 ost << "\\clearpage" << endl << endl;
1900 ost << "\\section*{Eckardt Points}" << endl;
1902
1903 ost << "\\clearpage" << endl << endl;
1904 ost << "\\section*{Double Sixes}" << endl;
1906
1907 ost << "\\clearpage" << endl << endl;
1908 ost << "\\section*{Half Double Sixes}" << endl;
1910
1911 ost << "\\clearpage" << endl << endl;
1912 ost << "\\section*{Tritangent Planes}" << endl;
1914
1915 ost << "\\clearpage" << endl << endl;
1916 ost << "\\section*{Steiner Trihedral Pairs}" << endl;
1918
1919 ost << "\\clearpage" << endl << endl;
1920 ost << "\\section*{Triads}" << endl;
1921 latex_triads(ost);
1922
1923}
1924
1925void schlaefli::latex_abstract_trihedral_pair(std::ostream &ost, int t_idx)
1926{
1927 latex_trihedral_pair(ost, Trihedral_pairs + t_idx * 9,
1928 Trihedral_to_Eckardt + t_idx * 6);
1929}
1930
1932{
1933 int i;
1934
1935 ost << "\\begin{multicols}{5}" << endl;
1936 ost << "\\noindent";
1937 for (i = 0; i < 27; i++) {
1938 ost << "$" << i << " = ";
1939 print_line(ost, i);
1940 ost << "$\\\\" << endl;
1941 }
1942 ost << "\\end{multicols}" << endl;
1943}
1944
1945void schlaefli::latex_trihedral_pair(std::ostream &ost, int *T, long int *TE)
1946{
1947 int i, j;
1948
1949 ost << "\\begin{array}{*{" << 3 << "}{c}|c}" << endl;
1950 for (i = 0; i < 3; i++) {
1951 for (j = 0; j < 3; j++) {
1952 print_line(ost, T[i * 3 + j]);
1953 ost << " & ";
1954 }
1955 ost << "\\pi_{";
1956 Eckardt_points[TE[i]].latex_index_only(ost);
1957 ost << "}\\\\" << endl;
1958 }
1959 ost << "\\hline" << endl;
1960 for (j = 0; j < 3; j++) {
1961 ost << "\\pi_{";
1962 Eckardt_points[TE[3 + j]].latex_index_only(ost);
1963 ost << "} & ";
1964 }
1965 ost << "\\\\" << endl;
1966 ost << "\\end{array}" << endl;
1967}
1968
1970{
1971 int i;
1972
1973 cout << "schlaefli::latex_table_of_trihedral_pairs" << endl;
1974 ost << "\\begin{multicols}{2}" << endl;
1975 for (i = 0; i < nb_trihedral_pairs; i++) {
1976 ost << "$T_{" << i << "} = T_{"
1977 << Trihedral_pair_labels[i] << "} = \\\\" << endl;
1978 //ost << "\\left[" << endl;
1979 //ost << "\\begin{array}" << endl;
1981 Trihedral_to_Eckardt + i * 6);
1982 //ost << "\\end{array}" << endl;
1983 //ost << "\\right]" << endl;
1984 ost << "$\\\\" << endl;
1985#if 0
1986 ost << "planes: $";
1987 int_vec_print(ost, Trihedral_to_Eckardt + i * 6, 6);
1988 ost << "$\\\\" << endl;
1989#endif
1990 }
1991 ost << "\\end{multicols}" << endl;
1992
1994
1995 cout << "schlaefli::latex_table_of_trihedral_pairs done" << endl;
1996}
1997
1998void schlaefli::latex_triads(std::ostream &ost)
1999{
2001 int i, j, a;
2002
2003 cout << "schlaefli::latex_triads" << endl;
2004
2005 ost << "\\subsection*{Triads}" << endl;
2006 ost << "The 40 triads are:\\\\" << endl;
2007
2008 ost << "$$" << endl;
2010 Triads, 40, 3, 0, 0, TRUE /* f_tex*/);
2011 ost << "$$";
2012
2013 ost << "\\begin{multicols}{2}" << endl;
2014 for (i = 0; i < nb_triads; i++) {
2015 ost << "\\noindent ${\\cal T}_{" << i << "} = \\{";
2016 for (j = 0; j < 3; j++) {
2017 a = Triads[i * 3 + j];
2018 ost << "T_{" << Trihedral_pair_labels[a] << "}";
2019 if (j < 3 - 1) {
2020 ost << ", ";
2021 }
2022 }
2023 ost << "\\}$\\\\" << endl;
2024 }
2025 ost << "\\end{multicols}" << endl;
2026
2027 cout << "schlaefli::latex_triads done" << endl;
2028}
2029
2031{
2033 int i, j, a;
2034
2035 //ost << "\\clearpage" << endl;
2036
2037 ost << "\\bigskip" << endl;
2038
2039
2040 ost << "\\subsection*{Trihedral pairs}" << endl;
2041 ost << "The 120 trihedral pairs are:\\\\" << endl;
2042 ost << "{\\renewcommand{\\arraystretch}{1.3}" << endl;
2043 ost << "$$" << endl;
2044
2045 int n = 6;
2046 int n_offset = 0;
2047 int m = 40;
2048 int m_offset = 0;
2049 long int *p = Trihedral_to_Eckardt;
2050
2051 ost << "\\begin{array}{|r|r|*{" << n << "}r|}" << endl;
2052 ost << "\\hline" << endl;
2053 ost << " & ";
2054 for (j = 0; j < n; j++) {
2055 ost << " & " << n_offset + j;
2056 }
2057 ost << "\\\\" << endl;
2058 ost << "\\hline" << endl;
2059 for (i = 0; i < m; i++) {
2060 ost << m_offset + i << " & S_{";
2061 ost << Trihedral_pair_labels[m_offset + i] << "}";
2062 for (j = 0; j < n; j++) {
2063 a = p[i * n + j];
2064 ost << " & \\pi_{" << Eckard_point_label_tex[a] << "}";
2065 }
2066 ost << "\\\\";
2067 ost << endl;
2068 }
2069 ost << "\\hline" << endl;
2070 ost << "\\end{array}" << endl;
2071
2072 //L.print_integer_matrix_with_standard_labels(ost,
2073 // Surf->Trihedral_to_Eckardt, 40, 6, TRUE /* f_tex */);
2074 ost << "$$" << endl;
2075
2076
2077 ost << "$$" << endl;
2078
2079 m_offset = 40;
2080 p = Trihedral_to_Eckardt + 40 * 6;
2081
2082 ost << "\\begin{array}{|r|r|*{" << n << "}r|}" << endl;
2083 ost << "\\hline" << endl;
2084 ost << " & ";
2085 for (j = 0; j < n; j++) {
2086 ost << " & " << n_offset + j;
2087 }
2088 ost << "\\\\" << endl;
2089 ost << "\\hline" << endl;
2090 for (i = 0; i < m; i++) {
2091 ost << m_offset + i << " & S_{";
2092 ost << Trihedral_pair_labels[m_offset + i] << "}";
2093 for (j = 0; j < n; j++) {
2094 a = p[i * n + j];
2095 ost << " & \\pi_{" << Eckard_point_label_tex[a] << "}";
2096 }
2097 ost << "\\\\";
2098 ost << endl;
2099 }
2100 ost << "\\hline" << endl;
2101 ost << "\\end{array}" << endl;
2102
2103
2104 //L.print_integer_matrix_with_standard_labels_and_offset(ost,
2105 // Surf->Trihedral_to_Eckardt + 40 * 6, 40, 6, 40, 0,
2106 // TRUE /* f_tex */);
2107 ost << "$$" << endl;
2108 ost << "$$" << endl;
2109
2110 m_offset = 80;
2111 p = Trihedral_to_Eckardt + 80 * 6;
2112
2113 ost << "\\begin{array}{|r|r|*{" << n << "}r|}" << endl;
2114 ost << "\\hline" << endl;
2115 ost << " & ";
2116 for (j = 0; j < n; j++) {
2117 ost << " & " << n_offset + j;
2118 }
2119 ost << "\\\\" << endl;
2120 ost << "\\hline" << endl;
2121 for (i = 0; i < m; i++) {
2122 ost << m_offset + i << " & S_{";
2123 ost << Trihedral_pair_labels[m_offset + i] << "}";
2124 for (j = 0; j < n; j++) {
2125 a = p[i * n + j];
2126 ost << " & \\pi_{" << Eckard_point_label_tex[a] << "}";
2127 }
2128 ost << "\\\\";
2129 ost << endl;
2130 }
2131 ost << "\\hline" << endl;
2132 ost << "\\end{array}" << endl;
2133
2134
2135 //L.print_integer_matrix_with_standard_labels_and_offset(ost,
2136 // Surf->Trihedral_to_Eckardt + 80 * 6, 40, 6, 80, 0,
2137 // TRUE /* f_tex */);
2138 ost << "$$}" << endl;
2139}
2140
2141#if 0
2142void schlaefli::print_trihedral_pairs(std::ostream &ost)
2143{
2144 latex_interface L;
2145 int i, j;
2146
2147 ost << "List of trihedral pairs:\\\\" << endl;
2148 for (i = 0; i < nb_trihedral_pairs; i++) {
2149 ost << i << " / " << nb_trihedral_pairs
2150 << ": $T_{" << i << "} = T_{"
2151 << Trihedral_pair_labels[i] << "}=(";
2152 for (j = 0; j < 6; j++) {
2153 ost << "\\pi_{" << Trihedral_to_Eckardt[i * 6 + j]
2154 << "}";
2155 if (j == 2) {
2156 ost << "; ";
2157 }
2158 else if (j < 6 - 1) {
2159 ost << ", ";
2160 }
2161 }
2162 ost << ")$\\\\" << endl;
2163 }
2164 ost << "List of trihedral pairs numerically:\\\\" << endl;
2165 ost << "$$" << endl;
2166 L.print_lint_matrix_with_standard_labels_and_offset(ost,
2167 Trihedral_to_Eckardt, 40, 6, 0, 0, TRUE /* f_tex*/);
2168 ost << "\\;";
2169 //ost << "$$" << endl;
2170 //ost << "$$" << endl;
2171 L.print_lint_matrix_with_standard_labels_and_offset(ost,
2172 Trihedral_to_Eckardt + 40 * 6, 40, 6, 40, 0, TRUE /* f_tex*/);
2173 ost << "\\;";
2174 //ost << "$$" << endl;
2175 //ost << "$$" << endl;
2176 L.print_lint_matrix_with_standard_labels_and_offset(ost,
2177 Trihedral_to_Eckardt + 80 * 6, 40, 6, 80, 0, TRUE /* f_tex*/);
2178 ost << "$$" << endl;
2179}
2180#endif
2181
2183{
2184 int i, j, h;
2185 long int D[12];
2186
2187 //cout << "schlaefli::latex_table_of_double_sixes" << endl;
2188
2189
2190
2191 //ost << "\\begin{multicols}{2}" << endl;
2192 for (h = 0; h < 36; h++) {
2193
2194 Lint_vec_copy(Double_six + h * 12, D, 12);
2195
2196 ost << "$D_{" << h << "} = " << Double_six_label_tex[h] << endl;
2197
2198 ost << " = \\left[";
2199 ost << "\\begin{array}{cccccc}" << endl;
2200 for (i = 0; i < 2; i++) {
2201 for (j = 0; j < 6; j++) {
2202 ost << Labels->Line_label_tex[D[i * 6 + j]];
2203 if (j < 6 - 1) {
2204 ost << " & ";
2205 }
2206 }
2207 ost << "\\\\" << endl;
2208 }
2209 ost << "\\end{array}" << endl;
2210 ost << "\\right]" << endl;
2211 ost << " = \\left[";
2212 ost << "\\begin{array}{cccccc}" << endl;
2213 for (i = 0; i < 2; i++) {
2214 for (j = 0; j < 6; j++) {
2215 ost << D[i * 6 + j];
2216 if (j < 6 - 1) {
2217 ost << " & ";
2218 }
2219 }
2220 ost << "\\\\" << endl;
2221 }
2222 ost << "\\end{array}" << endl;
2223 ost << "\\right]" << endl;
2224 ost << "$\\\\" << endl;
2225 }
2226 //ost << "\\end{multicols}" << endl;
2227
2228 //cout << "schlaefli::latex_table_of_double_sixes done" << endl;
2229
2230}
2231
2232
2234{
2235 int i;
2236
2237 //cout << "schlaefli::latex_table_of_half_double_sixes" << endl;
2238
2239
2240
2241 //ost << "\\begin{multicols}{2}" << endl;
2242 for (i = 0; i < 72; i++) {
2243
2244
2245 ost << "$" << endl;
2246
2247 latex_half_double_six(ost, i);
2248
2249 ost << "$\\\\" << endl;
2250
2251 }
2252 //ost << "\\end{multicols}" << endl;
2253
2254
2255
2256 //cout << "schlaefli::latex_table_of_double_sixes done" << endl;
2257}
2258
2259void schlaefli::latex_half_double_six(std::ostream &ost, int idx)
2260{
2261 int j;
2262 long int H[6];
2263
2264 //cout << "schlaefli::latex_table_of_half_double_sixes" << endl;
2265
2266
2267
2268
2269 Lint_vec_copy(Half_double_sixes + idx * 6, H, 6);
2270
2271 ost << "H_{" << idx << "} = " << Half_double_six_label_tex[idx] << endl;
2272
2273 ost << " = \\{";
2274 for (j = 0; j < 6; j++) {
2275 ost << Labels->Line_label_tex[H[j]];
2276 if (j < 6 - 1) {
2277 ost << ", ";
2278 }
2279 }
2280 ost << "\\}";
2281
2282 ost << "= \\{";
2283
2284 for (j = 0; j < 6; j++) {
2285 ost << H[j];
2286 if (j < 6 - 1) {
2287 ost << ", ";
2288 }
2289 }
2290 ost << "\\}";
2291
2292
2293
2294
2295 //cout << "schlaefli::latex_table_of_double_sixes done" << endl;
2296}
2297
2298
2299
2301{
2302 int i, j;
2303 int three_lines[3];
2304
2305 //cout << "schlaefli::latex_table_of_Eckardt_points" << endl;
2306 ost << "\\begin{multicols}{2}" << endl;
2307 for (i = 0; i < nb_Eckardt_points; i++) {
2308
2309 Eckardt_points[i].three_lines(Surf, three_lines);
2310
2311 ost << "$E_{" << i << "} = " << endl;
2312 Eckardt_points[i].latex(ost);
2313 ost << " = ";
2314 for (j = 0; j < 3; j++) {
2315 ost << Labels->Line_label_tex[three_lines[j]];
2316 if (j < 3 - 1) {
2317 ost << " \\cap ";
2318 }
2319 }
2320 ost << "$\\\\" << endl;
2321 }
2322 ost << "\\end{multicols}" << endl;
2323 //cout << "schlaefli::latex_table_of_Eckardt_points done" << endl;
2324}
2325
2327{
2328 int i, j;
2329 int three_lines[3];
2330
2331 //cout << "schlaefli::latex_table_of_tritangent_planes" << endl;
2332 ost << "\\begin{multicols}{2}" << endl;
2333 for (i = 0; i < nb_Eckardt_points; i++) {
2334
2335 Eckardt_points[i].three_lines(Surf, three_lines);
2336
2337 ost << "$\\pi_{" << i << "} = \\pi_{" << endl;
2339 ost << "} = ";
2340 for (j = 0; j < 3; j++) {
2341 ost << Labels->Line_label_tex[three_lines[j]];
2342 }
2343 ost << "$\\\\" << endl;
2344 }
2345 ost << "\\end{multicols}" << endl;
2346 //cout << "schlaefli::latex_table_of_tritangent_planes done" << endl;
2347}
2348
2349void schlaefli::print_line(ostream &ost, int rk)
2350{
2352
2353 if (rk < 6) {
2354 ost << "a_" << rk + 1 << endl;
2355 }
2356 else if (rk < 12) {
2357 ost << "b_" << rk - 6 + 1 << endl;
2358 }
2359 else {
2360 int i, j;
2361
2362 rk -= 12;
2363 Combi.k2ij(rk, i, j, 6);
2364 ost << "c_{" << i + 1 << j + 1 << "}";
2365 }
2366}
2367
2369{
2370 int j, h;
2371
2372 ost << "The Schlaefli labeling of lines:\\\\" << endl;
2373 ost << "$$" << endl;
2374 for (j = 0; j < 3; j++) {
2375 ost << "\\begin{array}{|r|r|}" << endl;
2376 ost << "\\hline" << endl;
2377 ost << "h & \\mbox{line} \\\\" << endl;
2378 ost << "\\hline" << endl;
2379 ost << "\\hline" << endl;
2380 for (h = 0; h < 9; h++) {
2381 ost << j * 9 + h << " & "
2382 << Labels->Line_label_tex[j * 9 + h] << "\\\\" << endl;
2383 }
2384 ost << "\\hline" << endl;
2385 ost << "\\end{array}" << endl;
2386 if (j < 3 - 1) {
2387 ost << "\\qquad" << endl;
2388 }
2389 }
2390 ost << "$$" << endl;
2391}
2392
2393void schlaefli::print_set_of_lines_tex(ostream &ost, long int *v, int len)
2394{
2395 int i;
2396
2397 ost << "\\{";
2398 for (i = 0; i < len; i++) {
2399 ost << Labels->Line_label_tex[v[i]];
2400 if (i < len - 1) {
2401 ost << ", ";
2402 }
2403 }
2404 ost << "\\}";
2405}
2406
2408{
2409 int e, line, j, l1, l2, t1, t2, t3, t4, c1, c2, cnt;
2410 int three_lines[3];
2411 int transversal_line;
2412 //int intersecting_lines[10];
2413
2414 cnt = 0;
2415 //cout << "schlaefli::latex_table_of_clebsch_maps" << endl;
2416 //ost << "\\begin{multicols}{2}" << endl;
2417 for (e = 0; e < nb_Eckardt_points; e++) {
2418
2419 Eckardt_points[e].three_lines(Surf, three_lines);
2420
2421 for (line = 0; line < 3; line++) {
2422
2423 transversal_line = three_lines[line];
2424 if (line == 0) {
2425 c1 = three_lines[1];
2426 c2 = three_lines[2];
2427 }
2428 else if (line == 1) {
2429 c1 = three_lines[0];
2430 c2 = three_lines[2];
2431 }
2432 else if (line == 2) {
2433 c1 = three_lines[0];
2434 c2 = three_lines[1];
2435 }
2436
2437 for (l1 = 0; l1 < 27; l1++) {
2438 if (l1 == c1 || l1 == c2) {
2439 continue;
2440 }
2442 transversal_line, l1) == 0) {
2443 continue;
2444 }
2445 for (l2 = l1 + 1; l2 < 27; l2++) {
2446 if (l2 == c1 || l2 == c2) {
2447 continue;
2448 }
2450 transversal_line, l2) == 0) {
2451 continue;
2452 }
2453
2454
2455
2456 cout << "e=" << e << endl;
2457 cout << "transversal_line=" << transversal_line << endl;
2458 cout << "c1=" << c1 << endl;
2459 cout << "c2=" << c2 << endl;
2460 cout << "l1=" << l1 << endl;
2461 cout << "l2=" << l2 << endl;
2462
2463 for (t1 = 0; t1 < 27; t1++) {
2464 if (t1 == three_lines[0] ||
2465 t1 == three_lines[1] ||
2466 t1 == three_lines[2]) {
2467 continue;
2468 }
2469 if (t1 == l1 || t1 == l2) {
2470 continue;
2471 }
2472 if (get_adjacency_matrix_of_lines(l1, t1) == 0 ||
2473 get_adjacency_matrix_of_lines(l2, t1) == 0) {
2474 continue;
2475 }
2476 cout << "t1=" << t1 << endl;
2477
2478 for (t2 = t1 + 1; t2 < 27; t2++) {
2479 if (t2 == three_lines[0] ||
2480 t2 == three_lines[1] ||
2481 t2 == three_lines[2]) {
2482 continue;
2483 }
2484 if (t2 == l1 || t2 == l2) {
2485 continue;
2486 }
2487 if (get_adjacency_matrix_of_lines(l1, t2) == 0 ||
2488 get_adjacency_matrix_of_lines(l2, t2) == 0) {
2489 continue;
2490 }
2491 cout << "t2=" << t2 << endl;
2492
2493 for (t3 = t2 + 1; t3 < 27; t3++) {
2494 if (t3 == three_lines[0] ||
2495 t3 == three_lines[1] ||
2496 t3 == three_lines[2]) {
2497 continue;
2498 }
2499 if (t3 == l1 || t3 == l2) {
2500 continue;
2501 }
2502 if (get_adjacency_matrix_of_lines(l1, t3) == 0 ||
2503 get_adjacency_matrix_of_lines(l2, t3) == 0) {
2504 continue;
2505 }
2506 cout << "t3=" << t3 << endl;
2507
2508 for (t4 = t3 + 1; t4 < 27; t4++) {
2509 if (t4 == three_lines[0] ||
2510 t4 == three_lines[1] ||
2511 t4 == three_lines[2]) {
2512 continue;
2513 }
2514 if (t4 == l1 || t4 == l2) {
2515 continue;
2516 }
2517 if (get_adjacency_matrix_of_lines(l1, t4) == 0 ||
2518 get_adjacency_matrix_of_lines(l2, t4) == 0) {
2519 continue;
2520 }
2521 cout << "t4=" << t4 << endl;
2522
2523
2524 int tc1[4], tc2[4];
2525 int n1 = 0, n2 = 0;
2526
2527 if (get_adjacency_matrix_of_lines(t1, c1)) {
2528 tc1[n1++] = t1;
2529 }
2530 if (get_adjacency_matrix_of_lines(t1, c2)) {
2531 tc2[n2++] = t1;
2532 }
2533 if (get_adjacency_matrix_of_lines(t2, c1)) {
2534 tc1[n1++] = t2;
2535 }
2536 if (get_adjacency_matrix_of_lines(t2, c2)) {
2537 tc2[n2++] = t2;
2538 }
2539 if (get_adjacency_matrix_of_lines(t3, c1)) {
2540 tc1[n1++] = t3;
2541 }
2542 if (get_adjacency_matrix_of_lines(t3, c2)) {
2543 tc2[n2++] = t3;
2544 }
2545 if (get_adjacency_matrix_of_lines(t4, c1)) {
2546 tc1[n1++] = t4;
2547 }
2548 if (get_adjacency_matrix_of_lines(t4, c2)) {
2549 tc2[n2++] = t4;
2550 }
2551 cout << "n1=" << n1 << endl;
2552 cout << "n2=" << n2 << endl;
2553
2554 ost << cnt << " : $\\pi_{" << e << "} = \\pi_{";
2556 ost << "}$, $\\;$ ";
2557
2558#if 0
2559 ost << " = ";
2560 for (j = 0; j < 3; j++) {
2561 ost << Line_label_tex[three_lines[j]];
2562 }
2563 ost << "$, $\\;$ " << endl;
2564#endif
2565
2566 ost << "$" << Labels->Line_label_tex[transversal_line] << "$, $\\;$ ";
2567 //ost << "$(" << Line_label_tex[c1] << ", " << Line_label_tex[c2];
2568 //ost << ")$, $\\;$ ";
2569
2570 ost << "$(" << Labels->Line_label_tex[l1] << "," << Labels->Line_label_tex[l2] << ")$, $\\;$ ";
2571#if 0
2572 ost << "$(" << Line_label_tex[t1]
2573 << "," << Line_label_tex[t2]
2574 << "," << Line_label_tex[t3]
2575 << "," << Line_label_tex[t4]
2576 << ")$, $\\;$ ";
2577#endif
2578 ost << "$"
2579 << Labels->Line_label_tex[c1] << " \\cap \\{";
2580 for (j = 0; j < n1; j++) {
2581 ost << Labels->Line_label_tex[tc1[j]];
2582 if (j < n1 - 1) {
2583 ost << ", ";
2584 }
2585 }
2586 ost << "\\}$ ";
2587 ost << "$"
2588 << Labels->Line_label_tex[c2] << " \\cap \\{";
2589 for (j = 0; j < n2; j++) {
2590 ost << Labels->Line_label_tex[tc2[j]];
2591 if (j < n2 - 1) {
2592 ost << ", ";
2593 }
2594 }
2595 ost << "\\}$ ";
2596 ost << "\\\\" << endl;
2597 cnt++;
2598
2599 } // next t4
2600 } // next t3
2601 } // next t2
2602 } // next t1
2603 //ost << "\\hline" << endl;
2604 } // next l2
2605 } // next l1
2606
2607 } // line
2608 ost << endl;
2609 ost << "\\bigskip" << endl;
2610 ost << endl;
2611 } // e
2612 //ost << "\\end{multicols}" << endl;
2613 //cout << "schlaefli::latex_table_of_clebsch_maps done" << endl;
2614}
2615
2617{
2618 int i, j;
2619
2620 cout << "[";
2621 for (i = 0; i < 72; i++) {
2622 cout << "[";
2623 for (j = 0; j < 6; j++) {
2624 cout << Half_double_sixes[i * 6 + j] + 1;
2625 if (j < 6 - 1) {
2626 cout << ", ";
2627 }
2628 }
2629 cout << "]";
2630 if (i < 72 - 1) {
2631 cout << "," << endl;
2632 }
2633 }
2634 cout << "];" << endl;
2635}
2636
2637int schlaefli::identify_Eckardt_point(int line1, int line2, int line3, int verbose_level)
2638{
2639 int f_v = (verbose_level >= 1);
2640 int lines[3];
2643 int idx;
2644
2645 if (f_v) {
2646 cout << "schlaefli::identify_Eckardt_point" << endl;
2647 }
2648 lines[0] = line1;
2649 lines[1] = line2;
2650 lines[2] = line3;
2651 Sorting.int_vec_heapsort(lines, 3);
2652 line1 = lines[0];
2653 line2 = lines[1];
2654 line3 = lines[2];
2655 if (line1 < 6) {
2656 if (line2 < 6) {
2657 cout << "schlaefli::identify_Eckardt_point line1 < 6 and line2 < 6" << endl;
2658 exit(1);
2659 }
2660 idx = Combi.ordered_pair_rank(line1, line2 - 6, 6);
2661 }
2662 else {
2663 int i, j, k, l, m, n;
2664
2665 if (line1 < 12) {
2666 cout << "schlaefli::identify_Eckardt_point second case, line1 < 12" << endl;
2667 exit(1);
2668 }
2669 if (line2 < 12) {
2670 cout << "schlaefli::identify_Eckardt_point second case, line2 < 12" << endl;
2671 exit(1);
2672 }
2673 if (line3 < 12) {
2674 cout << "schlaefli::identify_Eckardt_point second case, line3 < 12" << endl;
2675 exit(1);
2676 }
2677 Combi.k2ij(line1 - 12, i, j, 6);
2678 Combi.k2ij(line2 - 12, k, l, 6);
2679 Combi.k2ij(line3 - 12, m, n, 6);
2680 idx = 30 + Combi.unordered_triple_pair_rank(i, j, k, l, m, n);
2681 }
2682 if (f_v) {
2683 cout << "schlaefli::identify_Eckardt_point done" << endl;
2684 }
2685 return idx;
2686}
2687
2688
2689}}}
2690
Eckardt point on a cubic surface using the Schlaefli labeling.
void three_lines(surface_domain *S, int *three_lines)
schlaefli labeling of objects in cubic surfaces with 27 lines
void latex_abstract_trihedral_pair(std::ostream &ost, int t_idx)
Definition: schlaefli.cpp:1925
void find_trihedral_pairs_from_collinear_triples_of_Eckardt_points(int *E_idx, int nb_E, int *&T_idx, int &nb_T, int verbose_level)
Definition: schlaefli.cpp:918
int choose_tritangent_plane_for_Clebsch_map(int line_a, int line_b, int transversal_line, int verbose_level)
Definition: schlaefli.cpp:1868
void print_set_of_lines_tex(std::ostream &ost, long int *v, int len)
Definition: schlaefli.cpp:2393
int third_line_in_tritangent_plane(int l1, int l2, int verbose_level)
Definition: schlaefli.cpp:657
void find_tritangent_planes_intersecting_in_a_line(int line_idx, int &plane1, int &plane2, int verbose_level)
Definition: schlaefli.cpp:266
void make_trihedral_pair_disjointness_graph(int *&Adj, int verbose_level)
Definition: schlaefli.cpp:348
void make_Tlmnp(int *T, int l, int m, int n, int p)
Definition: schlaefli.cpp:739
void ijkl2mn(int i, int j, int k, int l, int &m, int &n)
Definition: schlaefli.cpp:1284
void make_Tdefght(int *T, int d, int e, int f, int g, int h, int t)
Definition: schlaefli.cpp:768
void ij2klmn(int i, int j, int &k, int &l, int &m, int &n)
Definition: schlaefli.cpp:1326
void latex_trihedral_pair(std::ostream &ost, int *T, long int *TE)
Definition: schlaefli.cpp:1945
void latex_half_double_six(std::ostream &ost, int idx)
Definition: schlaefli.cpp:2259
void ijklm2n(int i, int j, int k, int l, int m, int &n)
Definition: schlaefli.cpp:1265
void get_half_double_six_associated_with_Clebsch_map(int line1, int line2, int transversal, int hds[6], int verbose_level)
Definition: schlaefli.cpp:1345
void init(surface_domain *Surf, int verbose_level)
Definition: schlaefli.cpp:156
void init_incidence_matrix_of_lines_vs_tritangent_planes(int verbose_level)
Definition: schlaefli.cpp:1818
void prepare_clebsch_map(int ds, int ds_row, int &line1, int &line2, int &transversal, int verbose_level)
Definition: schlaefli.cpp:1643
int identify_Eckardt_point(int line1, int line2, int line3, int verbose_level)
Definition: schlaefli.cpp:2637
void ijk2lmn(int i, int j, int k, int &l, int &m, int &n)
Definition: schlaefli.cpp:1303
int unordered_triple_pair_rank(int i, int j, int k, int l, int m, int n)
void set_complement_safe(int *subset, int subset_size, int *complement, int &size_complement, int universal_set_size)
void set_complement(int *subset, int subset_size, int *complement, int &size_complement, int universal_set_size)
a collection of functions related to sorted vectors
int int_vec_search(int *v, int len, int a, int &idx)
Definition: sorting.cpp:1094
int lint_vec_compare(long int *p, long int *q, int len)
Definition: sorting.cpp:2326
int int_vecs_are_disjoint(int *v1, int len1, int *v2, int len2)
Definition: sorting.cpp:260
int int_vec_search_linear(int *v, int len, int a, int &idx)
Definition: sorting.cpp:686
a statistical analysis of data consisting of single integers
void init(int *data, int data_length, int f_second, int verbose_level)
Definition: tally.cpp:72
void print_lint_matrix_with_standard_labels(std::ostream &ost, long int *p, int m, int n, int f_tex)
void print_integer_matrix_with_standard_labels(std::ostream &ost, int *p, int m, int n, int f_tex)
void print_integer_matrix_with_standard_labels_and_offset(std::ostream &ost, int *p, int m, int n, int m_offset, int n_offset, int f_tex)
#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 Int_vec_zero(A, B)
Definition: foundations.h:713
#define NEW_OBJECT(type)
Definition: foundations.h:638
#define FREE_OBJECT(p)
Definition: foundations.h:651
#define NEW_int(n)
Definition: foundations.h:625
#define NEW_OBJECTS(type, n)
Definition: foundations.h:639
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
#define Int_vec_copy(A, B, C)
Definition: foundations.h:693
#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