Orbiter 2022
Combinatorial Objects
quartic_curve_domain.cpp
Go to the documentation of this file.
1/*
2 * quartic_curve_domain.cpp
3 *
4 * Created on: May 21, 2021
5 * Author: betten
6 */
7
8
9
10#include "foundations.h"
11
12
13using namespace std;
14
15
16namespace orbiter {
17namespace layer1_foundations {
18namespace algebraic_geometry {
19
20
22{
23 F = NULL;
24 P = NULL;
25 Poly1_3 = NULL;
26 Poly2_3 = NULL;
27 Poly3_3 = NULL;
28 Poly4_3 = NULL;
29 Poly3_4 = NULL;
30 Partials = NULL;
31 Schlaefli = NULL;
32}
33
34
36{
37 if (Schlaefli) {
39 }
40}
41
42
44{
45 int f_v = (verbose_level >= 1);
46
47 if (f_v) {
48 cout << "quartic_curve_domain::init" << endl;
49 }
50
52
54 if (f_v) {
55 cout << "quartic_curve_domain::init before P->projective_space_init" << endl;
56 }
58 TRUE /*f_init_incidence_structure */,
59 verbose_level - 2);
60 if (f_v) {
61 cout << "quartic_curve_domain::init after P->projective_space_init" << endl;
62 }
63
64
65
66 if (f_v) {
67 cout << "quartic_curve_domain::init before init_polynomial_domains" << endl;
68 }
69 init_polynomial_domains(verbose_level);
70 if (f_v) {
71 cout << "quartic_curve_domain::init after init_polynomial_domains" << endl;
72 }
73
74
76 Schlaefli->init(verbose_level);
77
78 if (f_v) {
79 cout << "quartic_curve_domain::init done" << endl;
80 }
81}
82
84{
85 int f_v = (verbose_level >= 1);
86
87 if (f_v) {
88 cout << "quartic_curve_domain::init_polynomial_domains" << endl;
89 }
90
91
93 if (f_v) {
94 cout << "surface_domain::init_polynomial_domains before Poly1_3->init" << endl;
95 }
96 Poly1_3->init(F,
97 3 /* nb_vars */, 1 /* degree */,
98 FALSE /* f_init_incidence_structure */,
99 t_PART,
100 verbose_level);
101 if (f_v) {
102 cout << "surface_domain::init_polynomial_domains after Poly1_3->init" << endl;
103 }
104
105
106
108 if (f_v) {
109 cout << "surface_domain::init_polynomial_domains before Poly2_3->init" << endl;
110 }
111 Poly2_3->init(F,
112 3 /* nb_vars */, 2 /* degree */,
113 FALSE /* f_init_incidence_structure */,
114 t_PART,
115 verbose_level);
116 if (f_v) {
117 cout << "surface_domain::init_polynomial_domains after Poly2_3->init" << endl;
118 }
119
120
121
123 if (f_v) {
124 cout << "surface_domain::init_polynomial_domains before Poly3_3->init" << endl;
125 }
126 Poly3_3->init(F,
127 3 /* nb_vars */, 3 /* degree */,
128 FALSE /* f_init_incidence_structure */,
129 t_PART,
130 verbose_level);
131 if (f_v) {
132 cout << "surface_domain::init_polynomial_domains after Poly3_3->init" << endl;
133 }
134
135
137 if (f_v) {
138 cout << "surface_domain::init_polynomial_domains before Poly4_3->init" << endl;
139 }
140 Poly4_3->init(F,
141 3 /* nb_vars */, 4 /* degree */,
142 FALSE /* f_init_incidence_structure */,
143 t_PART,
144 verbose_level);
145 if (f_v) {
146 cout << "surface_domain::init_polynomial_domains after Poly4_3->init" << endl;
147 }
148
150 if (f_v) {
151 cout << "surface_domain::init_polynomial_domains before Poly3_4->init" << endl;
152 }
153 Poly3_4->init(F,
154 4 /* nb_vars */, 3 /* degree */,
155 FALSE /* f_init_incidence_structure */,
156 t_PART,
157 verbose_level);
158 if (f_v) {
159 cout << "surface_domain::init_polynomial_domains after Poly3_4->init" << endl;
160 }
161
163
164 int i;
165
166 if (f_v) {
167 cout << "surface_domain::init_polynomial_domains initializing partials" << endl;
168 }
169 for (i = 0; i < 3; i++) {
170 Partials[i].init(Poly4_3, Poly3_3, i, verbose_level);
171 }
172 if (f_v) {
173 cout << "surface_domain::init_polynomial_domains initializing partials done" << endl;
174 }
175
176
177 if (f_v) {
178 cout << "quartic_curve_domain::init_polynomial_domains done" << endl;
179 }
180
181}
182
183void quartic_curve_domain::print_equation_maple(std::stringstream &ost, int *coeffs)
184{
185 Poly4_3->print_equation_str(ost, coeffs);
186}
187
189{
191 ost, coeffs, 8 /* nb_terms_per_line*/,
192 "\\\\\n" /* const char *new_line_text*/);
193}
194
196{
198 ost, coeffs, 8 /* nb_terms_per_line*/,
199 "\\\\\n" /* const char *new_line_text*/);
200}
201
202void quartic_curve_domain::unrank_point(int *v, long int rk)
203{
204 P->unrank_point(v, rk);
205}
206
208{
209 long int rk;
210
211 rk = P->rank_point(v);
212 return rk;
213}
214
215
217{
218 int basis[9];
219 int r;
220
221 P->unrank_line(basis, rk);
222 r = F->Linear_algebra->RREF_and_kernel(3, 2, basis,
223 0 /* verbose_level */);
224 Int_vec_copy(basis + 6, v, 3);
225}
226
227void quartic_curve_domain::print_lines_tex(std::ostream &ost, long int *Lines, int nb_lines)
228{
229 int i;
231
232 ost << "The lines are:\\\\" << endl;
233 ost << "\\begin{multicols}{2}" << endl;
234
235 for (i = 0; i < nb_lines; i++) {
236 //fp << "Line " << i << " is " << v[i] << ":\\\\" << endl;
237 P->Grass_lines->unrank_lint(Lines[i], 0 /*verbose_level*/);
238 ost << "$$" << endl;
239
240 ost << Schlaefli->Line_label_tex[i];
241 //ost << "\\ell_{" << i << "}";
242
243#if 0
244 if (nb_lines == 27) {
245 ost << " = " << Schlaefli->Line_label_tex[i];
246 }
247#endif
248 ost << " = " << endl;
249 //print_integer_matrix_width(cout,
250 // P->Grass_lines->M, k, n, n, F->log10_of_q + 1);
252 //print_integer_matrix_tex(ost, P->Grass_lines->M, 2, 4);
253 //ost << "\\right]_{" << Lines[i] << "}" << endl;
254 ost << "_{" << Lines[i] << "}" << endl;
255
256 if (F->e > 1) {
257 ost << "=" << endl;
258 ost << "\\left[" << endl;
259 L.print_integer_matrix_tex(ost, P->Grass_lines->M, 2, 3);
260 ost << "\\right]_{" << Lines[i] << "}" << endl;
261 }
262
263 ost << "$$" << endl;
264 }
265 ost << "\\end{multicols}" << endl;
266 ost << "Rank of lines: ";
267 Lint_vec_print(ost, Lines, nb_lines);
268 ost << "\\\\" << endl;
269
270}
271
272
273
275 long int *Pts, int nb_points,
276 long int *Lines, int nb_lines,
277 data_structures::set_of_sets *&pts_on_lines,
278 int *&f_is_on_line,
279 int verbose_level)
280{
281 int f_v = (verbose_level >= 1);
282 int i, j, l, r;
283 int *pt_coords;
284 int Basis[6];
285 int Mtx[9];
286
287 if (f_v) {
288 cout << "quartic_curve_domain::compute_points_on_lines" << endl;
289 }
290 f_is_on_line = NEW_int(nb_points);
291 Int_vec_zero(f_is_on_line, nb_points);
292
294 pts_on_lines->init_basic_constant_size(nb_points,
295 nb_lines, F->q + 1, 0 /* verbose_level */);
296 pt_coords = NEW_int(nb_points * 3);
297 for (i = 0; i < nb_points; i++) {
298 P->unrank_point(pt_coords + i * 3, Pts[i]);
299 }
300
301 orbiter_kernel_system::Orbiter->Lint_vec->zero(pts_on_lines->Set_size, nb_lines);
302 for (i = 0; i < nb_lines; i++) {
303 l = Lines[i];
304 P->unrank_line(Basis, l);
305 for (j = 0; j < nb_points; j++) {
306 Int_vec_copy(Basis, Mtx, 6);
307 Int_vec_copy(pt_coords + j * 3, Mtx + 6, 3);
308 r = F->Linear_algebra->Gauss_easy(Mtx, 3, 3);
309 if (r == 2) {
310 pts_on_lines->add_element(i, j);
311 f_is_on_line[j] = TRUE;
312 }
313 }
314 }
315
316 FREE_int(pt_coords);
317
318 if (f_v) {
319 cout << "quartic_curve_domain::compute_points_on_lines done" << endl;
320 }
321}
322
323
324
326 int *six_coeff_b, int *fifteen_coeff,
327 int verbose_level)
328{
329 int f_v = (verbose_level >= 1);
330 int i, j, a, b, c, idx, u;
331 int M[3];
332
333 if (f_v) {
334 cout << "quartic_curve_domain::multiply_conic_times_conic" << endl;
335 }
336
337
338 Int_vec_zero(fifteen_coeff, 15);
339 for (i = 0; i < 6; i++) {
340 a = six_coeff_a[i];
341 if (a == 0) {
342 continue;
343 }
344 for (j = 0; j < 6; j++) {
345 b = six_coeff_b[j];
346 if (b == 0) {
347 continue;
348 }
349 c = F->mult(a, b);
350
351 for (u = 0; u < 3; u++) {
352 M[u] = Poly2_3->get_monomial(i, u) + Poly2_3->get_monomial(j, u);
353 }
354 idx = Poly4_3->index_of_monomial(M);
355 if (idx >= 15) {
356 cout << "quartic_curve_domain::multiply_conic_times_conic "
357 "idx >= 15" << endl;
358 exit(1);
359 }
360 fifteen_coeff[idx] = F->add(fifteen_coeff[idx], c);
361 }
362 }
363
364
365 if (f_v) {
366 cout << "quartic_curve_domain::multiply_conic_times_conic done" << endl;
367 }
368}
369
371 int *three_coeff, int *ten_coeff,
372 int verbose_level)
373{
374 int f_v = (verbose_level >= 1);
375 int i, j, a, b, c, idx, u;
376 int M[3];
377
378 if (f_v) {
379 cout << "quartic_curve_domain::multiply_conic_times_line" << endl;
380 }
381
382
383 Int_vec_zero(ten_coeff, 10);
384 for (i = 0; i < 6; i++) {
385 a = six_coeff[i];
386 if (a == 0) {
387 continue;
388 }
389 for (j = 0; j < 3; j++) {
390 b = three_coeff[j];
391 if (b == 0) {
392 continue;
393 }
394 c = F->mult(a, b);
395
396 for (u = 0; u < 3; u++) {
397 M[u] = Poly2_3->get_monomial(i, u) + Poly1_3->get_monomial(j, u);
398 }
399 idx = Poly3_3->index_of_monomial(M);
400 if (idx >= 10) {
401 cout << "quartic_curve_domain::multiply_conic_times_line "
402 "idx >= 10" << endl;
403 exit(1);
404 }
405 ten_coeff[idx] = F->add(ten_coeff[idx], c);
406 }
407 }
408
409
410 if (f_v) {
411 cout << "quartic_curve_domain::multiply_conic_times_line done" << endl;
412 }
413}
414
416 int *line2, int *six_coeff,
417 int verbose_level)
418{
419 int f_v = (verbose_level >= 1);
420 int i, j, a, b, c, idx, u;
421 int M[3];
422
423 if (f_v) {
424 cout << "quartic_curve_domain::multiply_line_times_line" << endl;
425 }
426
427
428 Int_vec_zero(six_coeff, 6);
429 for (i = 0; i < 3; i++) {
430 a = line1[i];
431 if (a == 0) {
432 continue;
433 }
434 for (j = 0; j < 3; j++) {
435 b = line2[j];
436 if (b == 0) {
437 continue;
438 }
439 c = F->mult(a, b);
440
441 for (u = 0; u < 3; u++) {
442 M[u] = Poly1_3->get_monomial(i, u) + Poly1_3->get_monomial(j, u);
443 }
444 idx = Poly2_3->index_of_monomial(M);
445 if (idx >= 15) {
446 cout << "quartic_curve_domain::multiply_line_times_line "
447 "idx >= 6" << endl;
448 exit(1);
449 }
450 six_coeff[idx] = F->add(six_coeff[idx], c);
451 }
452 }
453
454
455 if (f_v) {
456 cout << "quartic_curve_domain::multiply_line_times_line done" << endl;
457 }
458}
459
460void quartic_curve_domain::multiply_three_lines(int *line1, int *line2, int *line3,
461 int *ten_coeff,
462 int verbose_level)
463{
464 int f_v = (verbose_level >= 1);
465 int six[6];
466
467 if (f_v) {
468 cout << "quartic_curve_domain::multiply_three_lines" << endl;
469 }
470
471
472 multiply_line_times_line(line1, line2, six, verbose_level);
473 multiply_conic_times_line(six, line3, ten_coeff, verbose_level);
474
475
476 if (f_v) {
477 cout << "quartic_curve_domain::multiply_three_lines done" << endl;
478 }
479}
480
481
482void quartic_curve_domain::multiply_four_lines(int *line1, int *line2, int *line3, int *line4,
483 int *fifteen_coeff,
484 int verbose_level)
485{
486 int f_v = (verbose_level >= 1);
487 int six1[6];
488 int six2[6];
489
490 if (f_v) {
491 cout << "quartic_curve_domain::multiply_four_lines" << endl;
492 }
493
494
495 multiply_line_times_line(line1, line2, six1, verbose_level);
496 multiply_line_times_line(line3, line4, six2, verbose_level);
497 multiply_conic_times_conic(six1, six2, fifteen_coeff, verbose_level);
498
499
500 if (f_v) {
501 cout << "quartic_curve_domain::multiply_four_lines done" << endl;
502 }
503}
504
505
506
507void quartic_curve_domain::assemble_cubic_surface(int *f1, int *f2, int *f3, int *eqn20,
508 int verbose_level)
509{
510 int f_v = (verbose_level >= 1);
511
512
513 if (f_v) {
514 cout << "quartic_curve_domain::assemble_cubic_surface" << endl;
515 }
516
517 Int_vec_zero(eqn20, 20);
518
519 int i, a, idx;
520 int mon[4];
521
522
523 for (i = 0; i < Poly1_3->get_nb_monomials(); i++) {
524 a = f1[i];
525 if (a == 0) {
526 continue;
527 }
528 if (f_v) {
529 cout << "f1[" << i << "] = " << a << endl;
530 }
531 mon[0] = 2;
533
534 idx = Poly3_4->index_of_monomial(mon);
535 if (idx >= 20) {
536 cout << "quartic_curve_domain::assemble_cubic_surface "
537 "idx >= 20" << endl;
538 exit(1);
539 }
540 eqn20[idx] = F->add(eqn20[idx], a);
541 }
542
543 for (i = 0; i < Poly2_3->get_nb_monomials(); i++) {
544 a = f2[i];
545 if (a == 0) {
546 continue;
547 }
548 if (f_v) {
549 cout << "f2[" << i << "] = " << a << endl;
550 }
551 mon[0] = 1;
553
554 idx = Poly3_4->index_of_monomial(mon);
555 if (idx >= 20) {
556 cout << "quartic_curve_domain::assemble_cubic_surface "
557 "idx >= 20" << endl;
558 exit(1);
559 }
560 eqn20[idx] = F->add(eqn20[idx], a);
561 }
562
563 for (i = 0; i < Poly3_3->get_nb_monomials(); i++) {
564 a = f3[i];
565 if (a == 0) {
566 continue;
567 }
568 if (f_v) {
569 cout << "f3[" << i << "] = " << a << endl;
570 }
571 mon[0] = 0;
573
574 idx = Poly3_4->index_of_monomial(mon);
575 if (idx >= 20) {
576 cout << "quartic_curve_domain::assemble_cubic_surface "
577 "idx >= 20" << endl;
578 exit(1);
579 }
580 eqn20[idx] = F->add(eqn20[idx], a);
581 }
582
583
584
585
586 if (f_v) {
587 cout << "quartic_curve_domain::assemble_cubic_surface done" << endl;
588 }
589}
590
592 int *eqn20, int verbose_level)
593// Given a quartic Q in X1,X2,X3, compute an associated cubic surface
594// whose projection from (1,0,0,0) gives back the quartic Q.
595// Pick 4 bitangents L0,L1,L2,L3 so that the 8 points of tangency lie on a conic C.
596// Then, create the cubic surface with equation
597// (- lambda * mu) / 4 * X0^2 * L0 (the equation of the first of the four bitangents)
598// + X0 * lambda * C (the conic equation)
599// + L1 * L2 * L3 (the product of the equations of the last three bitangents)
600// Here 1, lambda, mu are the coefficients of a linear dependency between
601// Q (the quartic), C^2, L0*L1*L2*L3, so
602// Q + lambda * C^2 + mu * L0*L1*L2*L3 = 0.
603{
604 int f_v = (verbose_level >= 1);
605
606
607 if (f_v) {
608 cout << "quartic_curve_domain::create_surface" << endl;
609 }
610
611 if (Q->QP == NULL) {
612 cout << "quartic_curve_domain::create_surface, QP == NULL" << endl;
613 exit(1);
614 }
615
616 int *Bitangents;
617 int nb_bitangents;
618 int set[4];
619 int Idx[4];
620 int pt_idx[8];
621 long int Points[8];
622 long int Bitangents4[4];
623 int Bitangents_coeffs[16];
624 int six_coeffs_conic[6];
625 int i, r;
626 long int nCk, h;
628 int conic_squared_15[15];
629 int four_lines_15[15];
630 int M1[3 * 15];
631 int M2[15 * 3];
632
633 Q->QP->Bitangent_line_type->get_class_by_value(Bitangents, nb_bitangents, 2 /*value */,
634 verbose_level);
635
636 if (nb_bitangents < 4) {
637 cout << "quartic_curve_domain::create_surface, nb_bitangents < 4" << endl;
638 exit(1);
639 }
640
641
642 if (f_v) {
643 cout << "quartic_curve_domain::create_surface we found " << nb_bitangents << " bitangents" << endl;
644 Int_vec_print(cout, Bitangents, nb_bitangents);
645 cout << endl;
646 }
647
648 nCk = Combi.binomial_lint(nb_bitangents, 4);
649 for (h = 0; h < nCk; h++) {
650 Combi.unrank_k_subset(h, set, nb_bitangents, 4);
651 if (f_v) {
652 cout << "quartic_curve_domain::create_surface trying subset " << h << " / " << nCk << " which is ";
653 Int_vec_print(cout, set, 4);
654 cout << endl;
655 }
656 for (i = 0; i < 4; i++) {
657 Idx[i] = Bitangents[set[i]];
658 Bitangents4[i] = Q->bitangents28[Idx[i]];
659 }
660
661 for (i = 0; i < 4; i++) {
662
663 if (Q->QP->pts_on_lines->Set_size[Idx[i]] != 2) {
664 cout << "quartic_curve_domain::create_surface QP->pts_on_lines->Set_size[Idx[i]] != 2" << endl;
665 exit(1);
666 }
667 pt_idx[i * 2 + 0] = Q->QP->pts_on_lines->Sets[Idx[i]][0];
668 pt_idx[i * 2 + 1] = Q->QP->pts_on_lines->Sets[Idx[i]][1];
669
670 }
671 for (i = 0; i < 8; i++) {
672 Points[i] = Q->Pts[pt_idx[i]];
673 }
674 if (f_v) {
675 cout << "quartic_curve_domain::create_surface trying subset " << h << " / " << nCk << " Points = ";
676 Lint_vec_print(cout, Points, 8);
677 cout << endl;
678 }
679
681 Points, 8,
682 six_coeffs_conic,
683 verbose_level)) {
684 cout << "quartic_curve_domain::create_surface The four bitangents are syzygetic" << endl;
685 break;
686 }
687 }
688 if (h == nCk) {
689 cout << "quartic_curve_domain::create_surface, could not find a syzygetic set of bitangents" << endl;
690 exit(1);
691 }
692 if (f_v) {
693 cout << "quartic_curve_domain::create_surface trying subset " << h << " / " << nCk << " Bitangents4 = ";
694 Lint_vec_print(cout, Bitangents4, 4);
695 cout << endl;
696 }
697
698 multiply_conic_times_conic(six_coeffs_conic,
699 six_coeffs_conic, conic_squared_15,
700 verbose_level);
701
702 if (f_v) {
703 cout << "quartic_curve_domain::create_surface conic squared = ";
704 Int_vec_print(cout, conic_squared_15, 15);
705 cout << endl;
706 }
707
708 for (i = 0; i < 4; i++) {
709 unrank_line_in_dual_coordinates(Bitangents_coeffs + i * 3, Bitangents4[i]);
710 }
711
712 if (f_v) {
713 cout << "quartic_curve_domain::create_surface chosen bitangents in dual coordinates = ";
714 orbiter_kernel_system::Orbiter->Int_vec->matrix_print(Bitangents_coeffs, 4, 3);
715 }
716
717
718 multiply_four_lines(Bitangents_coeffs + 0 * 3,
719 Bitangents_coeffs + 1 * 3,
720 Bitangents_coeffs + 2 * 3,
721 Bitangents_coeffs + 3 * 3,
722 four_lines_15,
723 verbose_level);
724
725 if (f_v) {
726 cout << "quartic_curve_domain::create_surface product of 4 bitangents = ";
727 Int_vec_print(cout, four_lines_15, 15);
728 cout << endl;
729 }
730
731 Int_vec_copy(Q->eqn15, M1, 15);
732 Int_vec_copy(conic_squared_15, M1 + 15, 15);
733 Int_vec_copy(four_lines_15, M1 + 30, 15);
734
736
737 r = F->Linear_algebra->RREF_and_kernel(3, 15, M2, 0 /* verbose_level*/);
738
739 if (r != 2) {
740 cout << "quartic_curve_domain::create_surface r != 2" << endl;
741 exit(1);
742 }
743
744 F->PG_element_normalize_from_front(M2 + 6, 1, 3);
745 if (f_v) {
746 cout << "quartic_curve_domain::create_surface kernel = ";
747 Int_vec_print(cout, M2 + 6, 3);
748 cout << endl;
749 }
750 int lambda, mu;
751
752 lambda = M2[7];
753 mu = M2[8];
754 if (f_v) {
755 cout << "quartic_curve_domain::create_surface lambda = " << lambda << " mu = " << mu << endl;
756 }
757
758 int f1_three_coeff[3]; // - lambda * mu / 4 * the equation of the first of the four bitangents
759 int f2_six_coeff[6]; // lambda * conic equation
760 int f3_ten_coeff[10]; // the product of the last three bitangents
761
763 Bitangents_coeffs + 1 * 3,
764 Bitangents_coeffs + 2 * 3,
765 Bitangents_coeffs + 3 * 3,
766 f3_ten_coeff,
767 verbose_level);
768
769#if 0
770 int sqrt_lambda;
771
772 if (f_v) {
773 cout << "quartic_curve_domain::create_surface computing square root of lambda" << endl;
774 }
775 F->square_root(lambda, sqrt_lambda);
776 if (f_v) {
777 cout << "quartic_curve_domain::create_surface sqrt_lambda = " << sqrt_lambda << endl;
778 }
779#endif
780
782 six_coeffs_conic, lambda, f2_six_coeff,
783 verbose_level);
784
785 int half, fourth, a;
786
787 half = F->inverse(2);
788 fourth = F->mult(half, half);
789 a = F->mult(F->negate(F->mult(lambda, mu)), fourth);
790
792 Bitangents_coeffs + 0 * 3, a, f1_three_coeff,
793 verbose_level);
794
795
796 // and now, create the cubic with equation
797 // (- lambda * mu) / 4 * X0^2 * L0 (the equation of the first of the four bitangents)
798 // + X0 * lambda * conic equation
799 // + L1 * L2 * L3 (the product of the equations of the last three bitangents)
800
801 assemble_cubic_surface(f1_three_coeff, f2_six_coeff, f3_ten_coeff, eqn20,
802 verbose_level);
803
804 if (f_v) {
805 cout << "quartic_curve_domain::create_surface eqn20 = ";
806 Int_vec_print(cout, eqn20, 20);
807 cout << endl;
808 }
809
810 FREE_int(Bitangents);
811
812 if (f_v) {
813 cout << "quartic_curve_domain::create_surface done" << endl;
814 }
815}
816
817void quartic_curve_domain::compute_gradient(int *equation15, int *&gradient, int verbose_level)
818{
819 int f_v = (verbose_level >= 1);
820 int i;
821
822 if (f_v) {
823 cout << "quartic_curve_domain::compute_gradient" << endl;
824 }
825
826
827 if (f_v) {
828 cout << "quartic_curve_domain::compute_gradient Poly3_3->get_nb_monomials() = " << Poly3_3->get_nb_monomials() << endl;
829 }
830
831 gradient = NEW_int(3 * Poly3_3->get_nb_monomials());
832
833 for (i = 0; i < 3; i++) {
834 if (f_v) {
835 cout << "quartic_curve_domain::compute_gradient i=" << i << endl;
836 }
837 if (f_v) {
838 cout << "quartic_curve_domain::compute_gradient eqn_in=";
839 Int_vec_print(cout, equation15, 15);
840 cout << " = " << endl;
841 Poly4_3->print_equation(cout, equation15);
842 cout << endl;
843 }
844 Partials[i].apply(equation15,
845 gradient + i * Poly3_3->get_nb_monomials(),
846 verbose_level - 2);
847 if (f_v) {
848 cout << "quartic_curve_domain::compute_gradient "
849 "partial=";
850 Int_vec_print(cout, gradient + i * Poly3_3->get_nb_monomials(),
852 cout << " = ";
854 gradient + i * Poly3_3->get_nb_monomials());
855 cout << endl;
856 }
857 }
858
859
860 if (f_v) {
861 cout << "quartic_curve_domain::compute_gradient done" << endl;
862 }
863}
864
865
866
867}}}
868
869
void compute_points_on_lines(long int *Pts, int nb_points, long int *Lines, int nb_lines, data_structures::set_of_sets *&pts_on_lines, int *&f_is_on_line, int verbose_level)
void print_lines_tex(std::ostream &ost, long int *Lines, int nb_lines)
void multiply_conic_times_line(int *six_coeff, int *three_coeff, int *ten_coeff, int verbose_level)
void multiply_four_lines(int *line1, int *line2, int *line3, int *line4, int *fifteen_coeff, int verbose_level)
void multiply_line_times_line(int *line1, int *line2, int *six_coeff, int verbose_level)
void init(field_theory::finite_field *F, int verbose_level)
void assemble_cubic_surface(int *f1, int *f2, int *f3, int *eqn20, int verbose_level)
void multiply_three_lines(int *line1, int *line2, int *line3, int *ten_coeff, int verbose_level)
void create_surface(quartic_curve_object *Q, int *eqn20, int verbose_level)
void compute_gradient(int *equation15, int *&gradient, int verbose_level)
void multiply_conic_times_conic(int *six_coeff_a, int *six_coeff_b, int *fifteen_coeff, int verbose_level)
a particular quartic curve in PG(2,q), given by its equation
schlaefli labeling of objects in cubic surfaces with 27 lines
void transpose(int *M, int m, int n, int *Mt)
Definition: int_vec.cpp:1104
void init_basic_constant_size(int underlying_set_size, int nb_sets, int constant_size, int verbose_level)
void get_class_by_value(int *&Pts, int &nb_pts, int value, int verbose_level)
Definition: tally.cpp:644
void unrank_lint(long int rk, int verbose_level)
Definition: grassmann.cpp:343
void latex_matrix(std::ostream &ost, int *p)
Definition: grassmann.cpp:1200
projective space PG(n,q) of dimension n over Fq
Definition: geometry.h:1916
int determine_conic_in_plane(long int *input_pts, int nb_pts, int *six_coeffs, int verbose_level)
void projective_space_init(int n, field_theory::finite_field *F, int f_init_incidence_structure, int verbose_level)
int RREF_and_kernel(int n, int k, int *A, int verbose_level)
void print_integer_matrix_tex(std::ostream &ost, int *p, int m, int n)
homogeneous polynomials of a given degree in a given number of variables over a finite field GF(q)
Definition: ring_theory.h:88
void init(field_theory::finite_field *F, int nb_vars, int degree, int f_init_incidence_structure, monomial_ordering_type Monomial_ordering_type, int verbose_level)
void multiply_by_scalar(int *coeff_in, int scalar, int *coeff_out, int verbose_level)
void print_equation_with_line_breaks_tex(std::ostream &ost, int *coeffs, int nb_terms_per_line, const char *new_line_text)
partial derivative connects two homogeneous polynomial domains
Definition: ring_theory.h:432
void apply(int *eqn_in, int *eqn_out, int verbose_level)
void init(homogeneous_polynomial_domain *H, homogeneous_polynomial_domain *Hd, int variable_idx, int verbose_level)
#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 Lint_vec_print(A, B, C)
Definition: foundations.h:686
#define FREE_OBJECT(p)
Definition: foundations.h:651
#define NEW_int(n)
Definition: foundations.h:625
#define NEW_OBJECTS(type, n)
Definition: foundations.h:639
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
#define Int_vec_copy(A, B, C)
Definition: foundations.h:693
#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