Orbiter 2022
Combinatorial Objects
web_of_cubic_curves.cpp
Go to the documentation of this file.
1/*
2 * web_of_cubic_curves.cpp
3 *
4 * Created on: Jun 3, 2020
5 * Author: betten
6 */
7
8
9
10
11#include "foundations.h"
12
13
14using namespace std;
15
16
17
18namespace orbiter {
19namespace layer1_foundations {
20namespace algebraic_geometry {
21
22
23static void Web_of_cubic_curves_entry_print(int *p,
24 int m, int n, int i, int j, int val,
25 std::string &output, void *data);
26
27
29{
30
31 Surf = NULL;
32
33 nb_T = 0;
34 T_idx = NULL;
35
36 arc6[0] = 0;
37
38 E = NULL;
39 E_idx = NULL;
40 T_idx = NULL;
41 nb_T = 0;
42
43 base_curves4[0] = 0;
44 t_idx0 = 0;
48 base_curves = NULL;
49 The_plane_rank = NULL;
50 The_plane_duals = NULL;
51 Dual_point_ranks = NULL;
52 Lines27[0] = 0;
53
54}
55
57{
58 if (E) {
60 }
61 if (E_idx) {
63 }
64 if (T_idx) {
66 }
69 }
72 }
73 if (base_curves) {
75 }
76 if (The_plane_rank) {
78 }
79 if (The_plane_duals) {
81 }
82 if (Dual_point_ranks) {
84 }
85}
86
88 long int *arc6, int verbose_level)
89{
90 int f_v = (verbose_level >= 1);
91 int h;
92
93 if (f_v) {
94 cout << "web_of_cubic_curves::init" << endl;
95 }
97
99
100
101 if (f_v) {
102 cout << "web_of_cubic_curves::init before find_Eckardt_points" << endl;
103 }
104 find_Eckardt_points(verbose_level);
105 if (f_v) {
106 cout << "web_of_cubic_curves::init after find_Eckardt_points" << endl;
107 }
108
109 if (f_v) {
110 cout << "web_of_cubic_curves::init "
111 "before print_Eckardt_point_data" << endl;
112 }
113 print_Eckardt_point_data(cout, verbose_level);
114 if (f_v) {
115 cout << "web_of_cubic_curves::init "
116 "after print_Eckardt_point_data" << endl;
117 }
118
119 if (f_v) {
120 cout << "web_of_cubic_curves::init before find_trihedral_pairs" << endl;
121 }
122 find_trihedral_pairs(verbose_level);
123 if (f_v) {
124 cout << "web_of_cubic_curves::init after find_trihedral_pairs" << endl;
125 }
126
127 //int t_idx0;
128 //t_idx0 = T_idx[0];
129 t_idx0 = T_idx[115];
130 //t_idx = T_idx[0];
131 //t_idx = T_idx[115];
132 if (f_v) {
133 cout << "web_of_cubic_curves::init "
134 "We choose trihedral pair t_idx0=" << t_idx0 << endl;
135 }
136
137 for (h = 0; h < 6; h++) {
139 }
140 //int_vec_copy(Surf->Trihedral_to_Eckardt + t_idx0 * 6, row_col_Eckardt_points, 6);
141
142#if 1
147#else
152#endif
153
154 if (f_v) {
155 cout << "web_of_cubic_curves::init base_curves4=";
156 Int_vec_print(cout, base_curves4, 4);
157 cout << endl;
158 }
159
160 if (f_v) {
161 cout << "web_of_cubic_curves::init "
162 "Creating the web of cubic "
163 "curves through the arc:" << endl;
164 }
167 0 /*verbose_level*/);
168
169 if (f_v) {
170 cout << "web_of_cubic_curves::init "
171 "Testing the web of cubic curves:" << endl;
172 }
173
174 int pt_vec[3];
175 int i, j, c;
176
177 for (i = 0; i < 45; i++) {
178 //cout << i << " / " << 45 << ":" << endl;
179 for (j = 0; j < 6; j++) {
180 Surf->P2->unrank_point(pt_vec, arc6[j]);
182 Web_of_cubic_curves + i * 10, pt_vec);
183 if (c) {
184 cout << "web_of_cubic_curves::init "
185 "the cubic curve does not "
186 "pass through the arc" << endl;
187 exit(1);
188 }
189 }
190 }
191 if (f_v) {
192 cout << "web_of_cubic_curves::init The cubic curves all pass "
193 "through the arc" << endl;
194 }
195
196 if (f_v) {
197 cout << "web_of_cubic_curves::init "
198 "Computing the ranks of 4-subsets:" << endl;
199 }
200
201 int *Rk;
202 int N;
203
204 rank_of_foursubsets(Rk, N, 0 /*verbose_level*/);
205 {
207 C.init(Rk, N, FALSE, 0 /* verbose_level */);
208 cout << "web_of_cubic_curves::init "
209 "classification of ranks of 4-subsets:" << endl;
210 C.print_naked_tex(cout, TRUE /* f_backwards */);
211 cout << endl;
212 }
213
214 FREE_int(Rk);
215
216 if (f_v) {
217 cout << "web_of_cubic_curves::init "
218 "Web_of_cubic_curves:" << endl;
220 }
221
222 if (f_v) {
223 cout << "web_of_cubic_curves::init "
224 "base_curves4=";
225 Int_vec_print(cout, base_curves4, 4);
226 cout << endl;
227 }
228
229 base_curves = NEW_int(4 * 10);
230 for (i = 0; i < 4; i++) {
232 base_curves + i * 10, 10);
233 }
234 if (f_v) {
235 cout << "web_of_cubic_curves::init "
236 "base_curves:" << endl;
238 }
239
240
241
242 if (f_v) {
243 cout << "web_of_cubic_curves::init "
244 "Tritangent_plane_equations:" << endl;
246 }
247
250
252
253 int Basis[16];
254 for (i = 0; i < 45; i++) {
255 Int_vec_copy(Tritangent_plane_equations + i * 4, Basis, 4);
256 Surf->F->Linear_algebra->RREF_and_kernel(4, 1, Basis, 0 /* verbose_level */);
257 The_plane_rank[i] = Surf->rank_plane(Basis + 4);
258 }
259 if (f_v) {
260 cout << "web_of_cubic_curves::init "
261 "The_plane_ranks:" << endl;
263 The_plane_rank, 45, 1, TRUE /* f_tex */);
264 }
265
266 for (i = 0; i < 45; i++) {
269 }
270
272
273 cout << "web_of_cubic_curves::init "
274 "computing Dual_point_ranks:" << endl;
275 for (i = 0; i < nb_T; i++) {
276 //cout << "trihedral pair " << i << " / "
277 //<< Surf->nb_trihedral_pairs << endl;
278
279 long int e[6];
280
282 for (j = 0; j < 6; j++) {
283 Dual_point_ranks[i * 6 + j] = The_plane_duals[e[j]];
284 }
285 }
286
287 if (f_v) {
288 cout << "web_of_cubic_curves::init "
289 "Dual_point_ranks:" << endl;
291 }
292
293
294 if (f_v) {
295 cout << "web_of_cubic_curves::init before "
296 "Surf->create_lines_from_plane_equations" << endl;
297 }
299 Tritangent_plane_equations, Lines27, verbose_level);
300 if (f_v) {
301 cout << "web_of_cubic_curves::init after "
302 "Surf->create_lines_from_plane_equations" << endl;
303 }
304
305
306
307
308 if (f_v) {
309 cout << "web_of_cubic_curves::init done" << endl;
310 }
311}
312
313
314void web_of_cubic_curves::compute_web_of_cubic_curves(long int *arc6, int verbose_level)
315// curves[45 * 10]
316{
317 int f_v = (verbose_level >= 1);
318 int *bisecants;
319 int *conics;
320 int ten_coeff[10];
321 int a, rk, i, j, k, l, m, n;
322 int ij, kl, mn;
324
325 if (f_v) {
326 cout << "web_of_cubic_curves::compute_web_of_cubic_curves" << endl;
327 }
329 bisecants, conics, verbose_level);
330
331 Web_of_cubic_curves = NEW_int(45 * 10);
332
333
334 a = 0;
335
336 // the first 30 curves:
337 for (rk = 0; rk < 30; rk++, a++) {
338 Combi.ordered_pair_unrank(rk, i, j, 6);
339 ij = Combi.ij2k(i, j, 6);
340 Surf->multiply_conic_times_linear(conics + j * 6,
341 bisecants + ij * 3,
342 ten_coeff,
343 0 /* verbose_level */);
344 Int_vec_copy(ten_coeff, Web_of_cubic_curves + a * 10, 10);
345 }
346
347 // the next 15 curves:
348 for (rk = 0; rk < 15; rk++, a++) {
349 Combi.unordered_triple_pair_unrank(rk, i, j, k, l, m, n);
350 ij = Combi.ij2k(i, j, 6);
351 kl = Combi.ij2k(k, l, 6);
352 mn = Combi.ij2k(m, n, 6);
354 bisecants + ij * 3,
355 bisecants + kl * 3,
356 bisecants + mn * 3,
357 ten_coeff,
358 0 /* verbose_level */);
359 Int_vec_copy(ten_coeff, Web_of_cubic_curves + a * 10, 10);
360 }
361
362 if (a != 45) {
363 cout << "web_of_cubic_curves::compute_web_of_cubic_curves a != 45" << endl;
364 exit(1);
365 }
366
367 if (f_v) {
368 cout << "The web of cubic curves is:" << endl;
370 }
371
372 FREE_int(bisecants);
373 FREE_int(conics);
374
375 if (f_v) {
376 cout << "web_of_cubic_curves::compute_web_of_cubic_curves done" << endl;
377 }
378}
379
381 int *&rk, int &N, int verbose_level)
382{
383 int f_v = (verbose_level >= 1);
384 int set[4], i, j, a;
385 int B[4 * 10];
387
388 if (f_v) {
389 cout << "web_of_cubic_curves::rank_of_foursubsets" << endl;
390 }
391 if (f_v) {
392 cout << "web of cubic curves:" << endl;
394 }
395 N = Combi.int_n_choose_k(45, 4);
396 rk = NEW_int(N);
397 for (i = 0; i < N; i++) {
398 Combi.unrank_k_subset(i, set, 45, 4);
399 if (f_v) {
400 cout << "subset " << i << " / " << N << " is ";
401 Int_vec_print(cout, set, 4);
402 cout << endl;
403 }
404 for (j = 0; j < 4; j++) {
405 a = set[j];
406 Int_vec_copy(Web_of_cubic_curves + a * 10, B + j * 10, 10);
407 }
409 4, 10, 0 /* verbose_level */);
410 }
411 if (f_v) {
412 cout << "web_of_cubic_curves::rank_of_foursubsets done" << endl;
413 }
414}
415
417 long int *arc6, int *base_curves4,
418 int verbose_level)
419// Web_of_cubic_curves[45 * 10]
420{
421 int f_v = (verbose_level >= 1);
422 int h, rk, idx;
423 int *base_curves;
424 int *curves;
425 int *curves_t;
427
428 if (f_v) {
429 cout << "web_of_cubic_curves::create_web_and_equations_based_on_four_tritangent_planes" << endl;
430 }
431
432 compute_web_of_cubic_curves(arc6, verbose_level);
433
434 base_curves = NEW_int(5 * 10);
435 curves = NEW_int(5 * 10);
436 curves_t = NEW_int(10 * 5);
437
438
439
440 for (h = 0; h < 4; h++) {
442 base_curves + h * 10, 10);
443 }
444
445 if (f_v) {
446 cout << "base_curves:" << endl;
448 }
449
450 // find the plane equations:
451
453
454 for (h = 0; h < 45; h++) {
455
456 if (f_v) {
457 cout << "h=" << h << " / " << 45 << ":" << endl;
458 }
459
460 if (Sorting.int_vec_search_linear(base_curves4, 4, h, idx)) {
462 Tritangent_plane_equations[h * 4 + idx] = 1;
463 }
464 else {
465 Int_vec_copy(base_curves, curves, 4 * 10);
466 Int_vec_copy(Web_of_cubic_curves + h * 10, curves + 4 * 10, 10);
467
468 if (f_v) {
469 cout << "h=" << h << " / " << 45
470 << " the system is:" << endl;
472 }
473
474 Surf->F->Linear_algebra->transpose_matrix(curves, curves_t, 5, 10);
475
476 if (f_v) {
477 cout << "after transpose:" << endl;
479 }
480
481 rk = Surf->F->Linear_algebra->RREF_and_kernel(5, 10, curves_t,
482 0 /* verbose_level */);
483 if (rk != 4) {
484 cout << "web_of_cubic_curves::create_web_and_equations_based_on_four_tritangent_planes "
485 "the rank of the "
486 "system is not equal to 4" << endl;
487 cout << "rk = " << rk << endl;
488 exit(1);
489 }
490 if (curves_t[4 * 5 + 4] != Surf->F->negate(1)) {
491 cout << "h=" << h << " / " << 2
492 << " curves_t[4 * 5 + 4] != -1" << endl;
493 exit(1);
494 }
495 Int_vec_copy(curves_t + 4 * 5,
496 Tritangent_plane_equations + h * 4, 4);
497
499 Tritangent_plane_equations + h * 4, 1, 4);
500
501 }
502 if (f_v) {
503 cout << "h=" << h << " / " << 45
504 << ": the plane equation is ";
506 cout << endl;
507 }
508
509
510 }
511 if (f_v) {
512 cout << "the plane equations are: " << endl;
514 cout << endl;
515 }
516
518 FREE_int(curves);
519 FREE_int(curves_t);
520
521 if (f_v) {
522 cout << "web_of_cubic_curves::create_web_and_equations_based_on_four_tritangent_planes done" << endl;
523 }
524}
525
526
527
528
530{
531 int f_v = (verbose_level >= 1);
532
533 if (f_v) {
534 cout << "web_of_cubic_curves::find_Eckardt_points" << endl;
535 }
536 int s;
538
539 if (f_v) {
540 cout << "web_of_cubic_curves::find_Eckardt_points "
541 "before Surf->P2->compute_eckardt_point_info" << endl;
542 }
543 E = Gg.compute_eckardt_point_info(Surf->P2, arc6, verbose_level);
544 if (f_v) {
545 cout << "web_of_cubic_curves::find_Eckardt_points "
546 "after Surf->P2->compute_eckardt_point_info" << endl;
547 }
548 if (f_v) {
549 cout << "web_of_cubic_curves::find_Eckardt_points We found " << E->nb_E
550 << " Eckardt points" << endl;
551 for (s = 0; s < E->nb_E; s++) {
552 cout << s << " / " << E->nb_E << " : ";
553 E->E[s].print();
554 cout << " = E_{" << s << "}";
555 cout << endl;
556 }
557 }
558
559
560 E_idx = NEW_int(E->nb_E);
561 for (s = 0; s < E->nb_E; s++) {
562 E_idx[s] = E->E[s].rank();
563 }
564 if (f_v) {
565 cout << "by rank: ";
566 Int_vec_print(cout, E_idx, E->nb_E);
567 cout << endl;
568 }
569 if (f_v) {
570 cout << "web_of_cubic_curves::find_Eckardt_points done" << endl;
571 }
572}
573
575{
576 int f_v = (verbose_level >= 1);
577 int i;
578
579 if (f_v) {
580 cout << "web_of_cubic_curves::find_trihedral_pairs" << endl;
581 }
582#if 0
583 Surf->find_trihedral_pairs_from_collinear_triples_of_Eckardt_points(
584 E_idx, nb_E,
585 T_idx, nb_T, verbose_level);
586#else
587 T_idx = NEW_int(120);
588 nb_T = 120;
589 for (i = 0; i < 120; i++) {
590 T_idx[i] = i;
591 }
592#endif
593
594 int t_idx;
595
596 if (nb_T == 0) {
597 cout << "nb_T == 0" << endl;
598 exit(1);
599 }
600
601
602 if (f_v) {
603 cout << "List of special trihedral pairs:" << endl;
604 for (i = 0; i < nb_T; i++) {
605 t_idx = T_idx[i];
606 cout << i << " / " << nb_T << ": T_{" << t_idx << "} = T_{"
607 << Surf->Schlaefli->Trihedral_pair_labels[t_idx] << "}" << endl;
608 }
609 }
610
611 if (f_v) {
612 cout << "web_of_cubic_curves::find_trihedral_pairs done" << endl;
613 }
614}
615
617 int t_idx, int *surface_equation,
618 int &lambda,
619 int verbose_level)
620{
621 int f_v = (verbose_level >= 1);
622 int *The_surface_equations;
623 long int row_col_Eckardt_points[6];
624 int The_six_plane_equations[6 * 4];
625 int lambda_rk;
626
627 if (f_v) {
628 cout << "web_of_cubic_curves::create_surface_equation_from_trihedral_pair "
629 "t_idx=" << t_idx << endl;
630 }
631
632
634
636 The_six_plane_equations, 4);
638 The_six_plane_equations + 4, 4);
640 The_six_plane_equations + 8, 4);
642 The_six_plane_equations + 12, 4);
644 The_six_plane_equations + 16, 4);
646 The_six_plane_equations + 20, 4);
647
648
649 The_surface_equations = NEW_int((Surf->q + 1) * 20);
650
652 The_six_plane_equations, The_surface_equations,
653 verbose_level - 2);
654
656 t_idx, lambda, lambda_rk,
657 verbose_level - 2);
658
659 Int_vec_copy(The_surface_equations + lambda_rk * 20,
660 surface_equation, 20);
661
662 FREE_int(The_surface_equations);
663
664 if (f_v) {
665 cout << "web_of_cubic_curves::create_surface_equation_from_trihedral_pair done" << endl;
666 }
667}
668
670 //int *row_col_Eckardt_points, int *six_curves,
671 int verbose_level)
672{
673 int f_v = (verbose_level >= 1);
674 int i;
675
676 if (f_v) {
677 cout << "web_of_cubic_curves::extract_six_curves_from_web" << endl;
678 }
679 for (i = 0; i < 6; i++) {
681 six_curves + i * 10, 10);
682 }
683
684 if (f_v) {
685 cout << "The six curves are:" << endl;
687 }
688 if (f_v) {
689 cout << "web_of_cubic_curves::extract_six_curves_from_web done" << endl;
690 }
691}
692
693
695 long int *arc6, int t_idx,
696 int &lambda, int &lambda_rk,
697 int verbose_level)
698{
699 int f_v = (verbose_level >= 1);
700 int i;
701 int pt, f_point_was_found;
702 int v[3];
703 int w[2];
704 int evals[6];
705 int evals_for_point[6];
706 int pt_on_surface[4];
707 int a, b, ma, bv;
708
709 if (f_v) {
710 cout << "web_of_cubic_curves::create_lambda_from_trihedral_pair_and_arc "
711 "t_idx=" << t_idx << endl;
712 }
713
714 if (f_v) {
715 cout << "Trihedral pair T_{" << Surf->Schlaefli->Trihedral_pair_labels[t_idx] << "}"
716 << endl;
717 }
718
720
721 if (f_v) {
722 cout << "row_col_Eckardt_points = ";
724 cout << endl;
725 }
726
727
728
729 extract_six_curves_from_web(/*row_col_Eckardt_points, six_curves,*/ verbose_level);
730
731 if (f_v) {
732 cout << "The six curves are:" << endl;
734 }
735
736
737
738 if (f_v) {
739 cout << "web_of_cubic_curves::create_lambda_from_trihedral_pair_and_arc "
740 "before find_point_not_on_six_curves" << endl;
741 }
742 find_point_not_on_six_curves(/*arc6,*/ /*six_curves,*/
743 pt, f_point_was_found, verbose_level);
744 if (!f_point_was_found) {
745 cout << "web_of_cubic_curves::create_lambda_from_trihedral_pair_and_arc did not find point not on any of the six curves, picking lambda = 1" << endl;
746 //exit(1);
747 lambda = 1;
748 }
749 else {
750 if (f_v) {
751 cout << "web_of_cubic_curves::create_lambda_from_trihedral_pair_and_arc "
752 "after find_point_not_on_six_curves" << endl;
753 cout << "pt=" << pt << endl;
754 }
755
756 Surf->Poly3->unrank_point(v, pt);
757 for (i = 0; i < 6; i++) {
758 evals[i] = Surf->Poly3->evaluate_at_a_point(six_curves + i * 10, v);
759 }
760
761 if (f_v) {
762 cout << "The point pt=" << pt << " = ";
763 Int_vec_print(cout, v, 3);
764 cout << " is nonzero on all plane sections of "
765 "the trihedral pair. The values are ";
766 Int_vec_print(cout, evals, 6);
767 cout << endl;
768 }
769
770 if (f_v) {
771 cout << "solving for lambda:" << endl;
772 }
773 a = Surf->F->mult3(evals[0], evals[1], evals[2]);
774 b = Surf->F->mult3(evals[3], evals[4], evals[5]);
775 ma = Surf->F->negate(a);
776 bv = Surf->F->inverse(b);
777 lambda = Surf->F->mult(ma, bv);
778
779#if 1
780 pt_on_surface[0] = evals[0];
781 pt_on_surface[1] = evals[1];
782 pt_on_surface[2] = evals[3];
783 pt_on_surface[3] = evals[4];
784#endif
785
786 if (FALSE) {
787 cout << "lambda = " << lambda << endl;
788 }
789
790
791
792 for (i = 0; i < 6; i++) {
793 evals_for_point[i] =
797 pt_on_surface);
798 }
799 a = Surf->F->mult3(evals_for_point[0],
800 evals_for_point[1],
801 evals_for_point[2]);
802 b = Surf->F->mult3(evals_for_point[3],
803 evals_for_point[4],
804 evals_for_point[5]);
805 lambda = Surf->F->mult(Surf->F->negate(a), Surf->F->inverse(b));
806 if (f_v) {
807 cout << "lambda = " << lambda << endl;
808 }
809 }
810 w[0] = 1;
811 w[1] = lambda;
812 Surf->F->PG_element_rank_modified(w, 1, 2, lambda_rk);
813
814 if (f_v) {
815 cout << "web_of_cubic_curves::create_lambda_from_trihedral_pair_and_arc done" << endl;
816 }
817}
818
820 //int *six_curves,
821 int &pt, int &f_point_was_found,
822 int verbose_level)
823{
824 int f_v = (verbose_level >= 1);
825 int v[3];
826 int i;
827 int idx, a;
829
830 if (f_v) {
831 cout << "web_of_cubic_curves::find_point_not_on_six_curves" << endl;
832 cout << "web_of_cubic_curves::find_point_not_on_six_curves "
833 "P2->N_points = " << Surf->P2->N_points << endl;
834 }
835 for (pt = 0; pt < Surf->P2->N_points; pt++) {
836 if (Sorting.lint_vec_search_linear(arc6, 6, pt, idx)) {
837 continue;
838 }
839 Surf->Poly3->unrank_point(v, pt);
840 for (i = 0; i < 6; i++) {
841 a = Surf->Poly3->evaluate_at_a_point(six_curves + i * 10, v);
842 if (a == 0) {
843 break;
844 }
845 }
846 if (i == 6) {
847 break;
848 }
849 }
850 if (pt == Surf->P2->N_points) {
851 cout << "web_of_cubic_curves::find_point_not_on_six_curves "
852 "could not find a point which is not on "
853 "any of the six curves" << endl;
854 f_point_was_found = FALSE;
855 pt = -1;
856 }
857 else {
858 f_point_was_found = TRUE;
859 }
860 if (f_v) {
861 cout << "web_of_cubic_curves::find_point_not_on_six_curves done" << endl;
862 }
863}
864
866{
867 int i, a;
868 int v[8];
869
870 ost << "The 27 lines:\\\\";
871 for (i = 0; i < 27; i++) {
872 a = Lines27[i];
873 ost << "$$" << endl;
874 ost << "\\ell_{" << i << "} = "
875 << Surf->Schlaefli->Labels->Line_label_tex[i] << " = " << a << " = ";
876 Surf->unrank_line(v, a);
877 //ost << "\\left[ " << endl;
879 //ost << "\\right] ";
880 ost << "$$" << endl;
881 }
882}
883
885{
887 int i;
888
889 ost << "The chosen abstract trihedral pair is no "
890 << t_idx0 << ":" << endl;
891 ost << "$$" << endl;
893 ost << "$$" << endl;
894 ost << "The six planes in the trihedral pair are:" << endl;
895 ost << "$$" << endl;
897 ost << "$$" << endl;
898
899
900 ost << "The six curves are:\\\\";
901 for (i = 0; i < 6; i++) {
902 ost << "$$" << endl;
904 ost << "}=\\Phi\\big(\\pi_{" << row_col_Eckardt_points[i]
905 << "}\\big) = \\Phi\\big(\\pi_{"
907 << "}\\big)=V\\Big(" << endl;
908 Surf->Poly3->print_equation(ost, six_curves + i * 10);
909 ost << "\\Big)" << endl;
910 ost << "$$" << endl;
911 }
912
913
914 ost << "The coefficients of the six curves are:\\\\";
915 ost << "$$" << endl;
917 six_curves, 6, 10, TRUE /* f_tex*/);
918 ost << "$$" << endl;
919
920
921
922 ost << endl << "\\bigskip" << endl << endl;
923 ost << "We choose planes $0,1,3,4$ for the base curves:" << endl;
924 ost << "$$" << endl;
926 ost << "$$" << endl;
927
928
929 ost << "The four base curves are:\\\\";
930 for (i = 0; i < 4; i++) {
931 ost << "$$" << endl;
932 ost << "W_{" << Surf->Schlaefli->Eckard_point_label[base_curves4[i]];
933 ost << "}=\\Phi\\big(\\pi_{" << base_curves4[i]
934 << "}\\big) = \\Phi\\big(\\pi_{"
936 << "}\\big)=V\\Big(" << endl;
937 Surf->Poly3->print_equation(ost, base_curves + i * 10);
938 ost << "\\Big)" << endl;
939 ost << "$$" << endl;
940 }
941
942 ost << "The coefficients of the four base curves are:\\\\";
943 ost << "$$" << endl;
945 base_curves, 4, 10, TRUE /* f_tex*/);
946 ost << "$$" << endl;
947
948 ost << "The resulting tritangent plane equations are:\\\\";
949 for (i = 0; i < 45; i++) {
950 ost << "$\\pi_{" << i << "}=\\pi_{"
951 << Surf->Schlaefli->Eckard_point_label[i] << "}=V\\Big(";
954 ost << "\\Big)$\\\\";
955 }
956
957 ost << "The dual coordinates of the plane equations are:\\\\";
958 ost << "$$" << endl;
960 Tritangent_plane_equations, 15, 4, TRUE /* f_tex*/);
961 ost << "\\;\\;" << endl;
963 Tritangent_plane_equations + 15 * 4, 15, 4, 15, 0, TRUE /* f_tex*/);
964 ost << "\\;\\;" << endl;
966 Tritangent_plane_equations + 30 * 4, 15, 4, 30, 0, TRUE /* f_tex*/);
967 ost << "$$" << endl;
968 ost << "The dual ranks are:\\\\";
969 ost << "$$" << endl;
971 The_plane_duals, 15, 1, TRUE /* f_tex*/);
972 ost << "\\;\\;" << endl;
974 The_plane_duals + 15 * 1, 15, 1, 15, 0, TRUE /* f_tex*/);
975 ost << "\\;\\;" << endl;
977 The_plane_duals + 30 * 1, 15, 1, 30, 0, TRUE /* f_tex*/);
978 ost << "$$" << endl;
979
980 print_lines(ost);
981}
982
984 int *The_six_plane_equations,
985 long int *plane6, ostream &ost)
986{
988 int i, h;
989
990 ost << "The six plane equations are:" << endl;
991 ost << "$$" << endl;
993 The_six_plane_equations, 6, 4, TRUE /* f_tex*/);
994 ost << "$$" << endl;
995
996 ost << "The six plane equations are:\\\\";
997 for (i = 0; i < 6; i++) {
999 ost << "$\\pi_{" << h << "}=\\pi_{"
1000 << Surf->Schlaefli->Eckard_point_label[h] << "}=V\\big(";
1002 ost << "\\big)$\\\\";
1003 }
1004}
1005
1007 int *The_surface_equations,
1008 int lambda, int lambda_rk, ostream &ost)
1009{
1011 int i;
1012 int v[2];
1013
1014 ost << "The $q+1$ equations on the line are:" << endl;
1015 ost << "$$" << endl;
1017 The_surface_equations, Surf->F->q + 1, 20, TRUE /* f_tex*/);
1018 ost << "$$" << endl;
1019 ost << "$$" << endl;
1020 ost << "\\lambda = " << lambda << ", \\; \\mbox{in row} \\; "
1021 << lambda_rk << endl;
1022 ost << "$$" << endl;
1023
1024 ost << "The $q+1$ equations on the line are:\\\\" << endl;
1025 for (i = 0; i < Surf->F->q + 1; i++) {
1026 ost << "Row " << i << " : ";
1027
1028 Surf->F->PG_element_unrank_modified(v, 1, 2, i);
1030
1031 ost << "$";
1032 ost << v[0] << " \\cdot ";
1033 ost << "\\big(";
1036 ost << "\\big)";
1037 ost << "\\big(";
1040 ost << "\\big)";
1041 ost << "\\big(";
1044 ost << "\\big)";
1045 ost << "+";
1046 ost << v[1] << " \\cdot ";
1047 ost << "\\big(";
1050 ost << "\\big)";
1051 ost << "\\big(";
1054 ost << "\\big)";
1055 ost << "\\big(";
1058 ost << "\\big)";
1059 ost << " = ";
1061 The_surface_equations + i * 20);
1062 ost << "$\\\\";
1063 }
1064}
1065
1067{
1069
1070 ost << "Dual point ranks:\\\\";
1071 ost << "$$" << endl;
1073 Dual_point_ranks, nb_T, 6, TRUE /* f_tex*/);
1074 ost << "$$" << endl;
1075}
1076
1077void web_of_cubic_curves::print_Eckardt_point_data(ostream &ost, int verbose_level)
1078{
1079 E->print_bisecants(ost, verbose_level);
1080 E->print_intersections(ost, verbose_level);
1081 E->print_conics(ost, verbose_level);
1082}
1083
1084void web_of_cubic_curves::report_basics(ostream &ost, int verbose_level)
1085{
1086 Surf->print_basics(ost);
1087#if 0
1089 Surf->print_Schlaefli_labelling(ost);
1090 Surf->print_Steiner_and_Eckardt(ost);
1091#endif
1092
1093}
1094
1095void web_of_cubic_curves::report(ostream &ost, int verbose_level)
1096{
1097 int f_v = (verbose_level >= 1);
1098
1099 if (f_v) {
1100 cout << "web_of_cubic_curves::report" << endl;
1101 }
1102
1103
1104 ost << "Web of cubic curves:\\\\" << endl << endl;
1105
1106 if (f_v) {
1107 cout << "web_of_cubic_curves::report before print_Eckardt_point_data" << endl;
1108 }
1109 print_Eckardt_point_data(ost, verbose_level);
1110 if (f_v) {
1111 cout << "web_of_cubic_curves::report after print_Eckardt_point_data" << endl;
1112 }
1113
1114 if (f_v) {
1115 cout << "web_of_cubic_curves::report before E->print_Eckardt_points" << endl;
1116 }
1117 E->print_Eckardt_points(ost, verbose_level);
1118 if (f_v) {
1119 cout << "web_of_cubic_curves::report before print_web_of_cubic_curves" << endl;
1120 }
1122
1123
1124 if (f_v) {
1125 cout << "web_of_cubic_curves::report before print_plane_equations" << endl;
1126 }
1128
1129
1130 //cout << "web_of_cubic_curves::report before print_dual_point_ranks" << endl;
1131 //print_dual_point_ranks(ost);
1132
1133 //ost << "Reporting web of cubic curves done.\\\\";
1134
1135
1136 if (f_v) {
1137 cout << "web_of_cubic_curves::report done" << endl;
1138 }
1139
1140}
1141
1142void web_of_cubic_curves::print_web_of_cubic_curves(long int *arc6, ostream &ost)
1143{
1146
1147 ost << "The web of cubic curves is:\\\\" << endl;
1148
1149#if 0
1150 ost << "$$" << endl;
1151 print_integer_matrix_with_standard_labels(ost,
1152 Web_of_cubic_curves, 15, 10, TRUE /* f_tex*/);
1153 ost << "$$" << endl;
1154 ost << "$$" << endl;
1155 print_integer_matrix_with_standard_labels_and_offset(ost,
1156 Web_of_cubic_curves + 15 * 10, 15, 10, 15, 0, TRUE /* f_tex*/);
1157 ost << "$$" << endl;
1158 ost << "$$" << endl;
1159 print_integer_matrix_with_standard_labels_and_offset(ost,
1160 Web_of_cubic_curves + 30 * 10, 15, 10, 30, 0, TRUE /* f_tex*/);
1161 ost << "$$" << endl;
1162#endif
1163
1164 int *bisecants;
1165 int *conics;
1166
1167 int labels[15];
1168 int row_fst[1];
1169 int row_len[1];
1170 int col_fst[1];
1171 int col_len[1];
1172 row_fst[0] = 0;
1173 row_len[0] = 15;
1174 col_fst[0] = 0;
1175 col_len[0] = 10;
1176 char str[1000];
1177 int i, j, k, l, m, n, h, ij, kl, mn;
1178
1180 bisecants, conics, 0 /*verbose_level*/);
1181
1182 for (h = 0; h < 45; h++) {
1183 ost << "$";
1184 snprintf(str, 1000, "W_{%s}=\\Phi\\big(\\pi_{%d}\\big) "
1185 "= \\Phi\\big(\\pi_{%s}\\big)",
1186 Surf->Schlaefli->Eckard_point_label[h].c_str(), h,
1187 Surf->Schlaefli->Eckard_point_label[h].c_str());
1188 ost << str;
1189 ost << " = ";
1190 if (h < 30) {
1191 Combi.ordered_pair_unrank(h, i, j, 6);
1192 ij = Combi.ij2k(i, j, 6);
1193 ost << "C_" << j + 1
1194 << "P_{" << i + 1 << "}P_{" << j + 1 << "} = ";
1195 ost << "\\big(";
1196 Surf->Poly2->print_equation(ost, conics + j * 6);
1197 ost << "\\big)";
1198 ost << "\\big(";
1199 Surf->Poly1->print_equation(ost, bisecants + ij * 3);
1200 ost << "\\big)";
1201 //multiply_conic_times_linear(conics + j * 6,
1202 //bisecants + ij * 3, ten_coeff, 0 /* verbose_level */);
1203 }
1204 else {
1205 Combi.unordered_triple_pair_unrank(h - 30, i, j, k, l, m, n);
1206 ij = Combi.ij2k(i, j, 6);
1207 kl = Combi.ij2k(k, l, 6);
1208 mn = Combi.ij2k(m, n, 6);
1209 ost << "P_{" << i + 1 << "}P_{" << j + 1 << "},P_{"
1210 << k + 1 << "}P_{" << l + 1 << "},P_{"
1211 << m + 1 << "}P_{" << n + 1 << "} = ";
1212 ost << "\\big(";
1213 Surf->Poly1->print_equation(ost, bisecants + ij * 3);
1214 ost << "\\big)";
1215 ost << "\\big(";
1216 Surf->Poly1->print_equation(ost, bisecants + kl * 3);
1217 ost << "\\big)";
1218 ost << "\\big(";
1219 Surf->Poly1->print_equation(ost, bisecants + mn * 3);
1220 ost << "\\big)";
1221 //multiply_linear_times_linear_times_linear(
1222 //bisecants + ij * 3, bisecants + kl * 3,
1223 //bisecants + mn * 3, ten_coeff, 0 /* verbose_level */);
1224 }
1225 ost << " = ";
1227 ost << "$\\\\";
1228 }
1229
1230 ost << "The coeffcients are:" << endl;
1231 for (i = 0; i < 15; i++) {
1232 labels[i] = i;
1233 }
1234 ost << "$$" << endl;
1236 Web_of_cubic_curves, 15, 10,
1237 labels, labels,
1238 row_fst, row_len, 1,
1239 col_fst, col_len, 1,
1240 Web_of_cubic_curves_entry_print, (void *) this,
1241 TRUE /* f_tex */);
1242 ost << "$$" << endl;
1243
1244 for (i = 0; i < 15; i++) {
1245 labels[i] = 15 + i;
1246 }
1247 ost << "$$" << endl;
1249 Web_of_cubic_curves, 15, 10,
1250 labels, labels,
1251 row_fst, row_len, 1,
1252 col_fst, col_len, 1,
1253 Web_of_cubic_curves_entry_print, (void *) this,
1254 TRUE /* f_tex */);
1255 ost << "$$" << endl;
1256
1257 for (i = 0; i < 15; i++) {
1258 labels[i] = 30 + i;
1259 }
1260 ost << "$$" << endl;
1262 Web_of_cubic_curves, 15, 10,
1263 labels, labels,
1264 row_fst, row_len, 1,
1265 col_fst, col_len, 1,
1266 Web_of_cubic_curves_entry_print, (void *) this,
1267 TRUE /* f_tex */);
1268 ost << "$$" << endl;
1269
1270 FREE_int(bisecants);
1271 FREE_int(conics);
1272
1273}
1274
1275static void Web_of_cubic_curves_entry_print(int *p,
1276 int m, int n, int i, int j, int val,
1277 std::string &output, void *data)
1278{
1280
1281 if (i == -1) {
1282 Web->Surf->Poly3->print_monomial_latex(output, j);
1283 }
1284 else if (j == -1) {
1285 char str[1000];
1286
1287 sprintf(str, "\\pi_{%d}", i);
1288 output.append(str);
1289 output.append(" = \\pi_{");
1290 output.append(Web->Surf->Schlaefli->Eckard_point_label[i]);
1291 output.append("}");
1292 //snprintf(output, 1000, "\\pi_{%d} = \\pi_{%s}", i,
1293 // Web->Surf->Schlaefli->Eckard_point_label[i].c_str());
1294 }
1295 else {
1296 char str[1000];
1297
1298 sprintf(str, "%d", i);
1299 output.append(str);
1300 //snprintf(output, 1000, "%d", val);
1301 }
1302}
1303
1304
1305
1306
1307}}}
1308
void latex_abstract_trihedral_pair(std::ostream &ost, int t_idx)
Definition: schlaefli.cpp:1925
ring_theory::homogeneous_polynomial_domain * Poly1_4
ring_theory::homogeneous_polynomial_domain * Poly3_4
void create_lines_from_plane_equations(int *The_plane_equations, long int *Lines, int verbose_level)
void multiply_linear_times_linear_times_linear(int *three_coeff1, int *three_coeff2, int *three_coeff3, int *ten_coeff, int verbose_level)
void create_equations_for_pencil_of_surfaces_from_trihedral_pair(int *The_six_plane_equations, int *The_surface_equations, int verbose_level)
void multiply_conic_times_linear(int *six_coeff, int *three_coeff, int *ten_coeff, int verbose_level)
a web of cubic curves which is used to create an algebraic variety
void create_web_and_equations_based_on_four_tritangent_planes(long int *arc6, int *base_curves4, int verbose_level)
void create_lambda_from_trihedral_pair_and_arc(long int *arc6, int t_idx, int &lambda, int &lambda_rk, int verbose_level)
void create_surface_equation_from_trihedral_pair(long int *arc6, int t_idx, int *surface_equation, int &lambda, int verbose_level)
void init(surface_domain *Surf, long int *arc6, int verbose_level)
void find_point_not_on_six_curves(int &pt, int &f_point_was_found, int verbose_level)
void print_surface_equations_on_line(int *The_surface_equations, int lambda, int lambda_rk, std::ostream &ost)
void print_the_six_plane_equations(int *The_six_plane_equations, long int *plane6, std::ostream &ost)
void unordered_triple_pair_unrank(int rk, int &i, int &j, int &k, int &l, int &m, int &n)
void matrix_print(long int *p, int m, int n)
Definition: lint_vec.cpp:203
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 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_naked_tex(std::ostream &ost, int f_backwards)
Definition: tally.cpp:413
void PG_element_rank_modified(int *v, int stride, int len, int &a)
void PG_element_unrank_modified(int *v, int stride, int len, int a)
void compute_bisecants_and_conics(long int *arc6, int *&bisecants, int *&conics, int verbose_level)
various functions related to geometries
Definition: geometry.h:721
algebraic_geometry::eckardt_point_info * compute_eckardt_point_info(projective_space *P2, long int *arc6, int verbose_level)
void print_single_generator_matrix_tex(std::ostream &ost, long int a)
Definition: grassmann.cpp:122
void transpose_matrix(int *A, int *At, int ma, int na)
int RREF_and_kernel(int n, int k, int *A, int verbose_level)
int rank_of_rectangular_matrix(int *A, int m, int n, int verbose_level)
void print_lint_matrix_with_standard_labels(std::ostream &ost, long int *p, int m, int n, int f_tex)
void print_lint_matrix_with_standard_labels_and_offset(std::ostream &ost, long int *p, int m, int n, int m_offset, int n_offset, int f_tex)
void int_matrix_print_with_labels_and_partition(std::ostream &ost, int *p, int m, int n, int *row_labels, int *col_labels, int *row_part_first, int *row_part_len, int nb_row_parts, int *col_part_first, int *col_part_len, int nb_col_parts, void(*process_function_or_NULL)(int *p, int m, int n, int i, int j, int val, std::string &output, void *data), void *data, 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_int(p)
Definition: foundations.h:640
#define Int_vec_zero(A, B)
Definition: foundations.h:713
#define Lint_vec_print(A, B, C)
Definition: foundations.h:686
#define FREE_OBJECT(p)
Definition: foundations.h:651
#define NEW_int(n)
Definition: foundations.h:625
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
#define 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