Orbiter 2022
Combinatorial Objects
surface_classify_using_arc.cpp
Go to the documentation of this file.
1/*
2 * surface_classify_using_arc.cpp
3 *
4 * Created on: Jul 16, 2020
5 * Author: betten
6 */
7
8
9
10
11#include "orbiter.h"
12
13using namespace std;
14
15namespace orbiter {
16namespace layer5_applications {
17namespace applications_in_algebraic_geometry {
18namespace cubic_surfaces_and_arcs {
19
20
21
23{
24 Surf_A = NULL;
25
26 //A = NULL;
27 //nice_gens = NULL;
28
29 Six_arcs = NULL;
30 Descr = NULL;
31
32 transporter = NULL;
33
34
35 nb_surfaces = 0;
36 SCAL = NULL;
37
39 Arc_identify = NULL;
40 f_deleted = NULL;
41 Decomp = NULL;
42
43}
44
45
46
48{
49#if 0
50 if (nice_gens) {
51 FREE_OBJECT(nice_gens);
52 }
53#endif
54 if (transporter) {
56 }
57 if (SCAL) {
59 }
60
61 if (Decomp) {
63 }
64 if (f_deleted) {
66 }
67 if (Arc_identify) {
69 }
70 if (Arc_identify_nb) {
72 }
73
74}
75
76
80 int f_test_nb_Eckardt_points, int nb_E,
81 int verbose_level)
82{
83 int f_v = (verbose_level >= 1);
86 int i, j, arc_idx;
88
89
91
92
93 if (f_v) {
94 cout << "surface_classify_using_arc::classify_surfaces_through_arcs_and_trihedral_pairs" << endl;
95 }
96
97 F = Surf_A->PA->F;
98 Surf = Surf_A->Surf;
99
100
101
103 Descr->f_d = TRUE;
104 Descr->d = 2;
106 Descr->target_size = 6;
107 Descr->Control = Control_six_arcs;
108
109
110
111 // classify six arcs not on a conic:
112
113 if (f_v) {
114 cout << "surface_classify_using_arc::classify_surfaces_through_arcs_and_trihedral_pairs "
115 "before Six_arcs->init" << endl;
116 }
118 Six_arcs->init(
119 Descr,
120 Surf_A->PA,
121 f_test_nb_Eckardt_points, nb_E, //Surf,
122 verbose_level - 2);
123 if (f_v) {
124 cout << "surface_classify_using_arc::classify_surfaces_through_arcs_and_trihedral_pairs "
125 "after Six_arcs->init" << endl;
126 }
127
128
129
130 if (f_v) {
131 cout << "surface_classify_using_arc::classify_surfaces_through_arcs_and_trihedral_pairs "
132 "before extending the arcs" << endl;
133 }
134
135
136 nb_surfaces = 0;
137
142
145
147
148
149
151
152
153 for (arc_idx = 0;
155 arc_idx++) {
156
157
158 if (f_deleted[arc_idx]) {
159 continue;
160 }
161
162 if (f_v) {
163 cout << "surface_classify_using_arc::classify_surfaces_through_arcs_and_trihedral_pairs "
164 "before SCAL[nb_surfaces].init, nb_surfaces = " << nb_surfaces << endl;
165 }
166
167 SCAL[nb_surfaces].init(arc_idx, this, verbose_level);
168
169 if (f_v) {
170 cout << "surface_classify_using_arc::classify_surfaces_through_arcs_and_trihedral_pairs "
171 "after SCAL[nb_surfaces].init nb_surfaces = " << nb_surfaces << endl;
172 }
173
174 nb_surfaces++;
175
176 } // next arc_idx
177
178 if (f_v) {
179 cout << "surface_classify_using_arc::classify_surfaces_through_arcs_and_trihedral_pairs "
180 "after extending the arcs" << endl;
181
182 cout << "surface_classify_using_arc::classify_surfaces_through_arcs_and_trihedral_pairs "
183 "We found " << nb_surfaces << " surfaces" << endl;
184
185
186 cout << "surface_classify_using_arc::classify_surfaces_through_arcs_and_trihedral_pairs "
187 "decomposition matrix:" << endl;
188 for (i = 0; i < nb_surfaces; i++) {
189 for (j = 0; j < Arc_identify_nb[i]; j++) {
191 if (j < Arc_identify_nb[i] - 1) {
192 cout << ", ";
193 }
194 }
195 cout << endl;
196 }
197 }
198
199 int a;
200
203 for (i = 0; i < nb_surfaces; i++) {
204 for (j = 0; j < Arc_identify_nb[i]; j++) {
206 Decomp[a * nb_surfaces + i]++;
207 }
208 }
209
210
211
212 if (f_v) {
213 cout << "surface_classify_using_arc::classify_surfaces_through_arcs_and_trihedral_pairs done" << endl;
214 }
215}
216
217
220 int verbose_level)
221{
222 int f_v = (verbose_level >= 1);
223
224 if (f_v) {
225 cout << "surface_classify_using_arc::report" << endl;
226 }
227
228 //surface_domain *Surf;
230
231
232
233 F = Surf_A->PA->F;
234 //Surf = Surf_A->Surf;
235
236 string fname_arc_lifting;
237 char str[1000];
238
239 sprintf(str, "%d", F->q);
240 fname_arc_lifting.assign("arc_lifting_q");
241 fname_arc_lifting.append(str);
242 fname_arc_lifting.append(".tex");
243
244 {
245 char title[1000];
246 char author[1000];
247 snprintf(title, 1000, "Arc lifting over GF(%d) ", F->q);
248 strcpy(author, "");
249
250
251 ofstream fp(fname_arc_lifting);
253
254
255 L.head(fp,
256 FALSE /* f_book */,
257 TRUE /* f_title */,
258 title, author,
259 FALSE /*f_toc */,
260 FALSE /* f_landscape */,
261 FALSE /* f_12pt */,
262 TRUE /*f_enlarged_page */,
263 TRUE /* f_pagenumbers*/,
264 NULL /* extra_praeamble */);
265
266
267 report2(fp, Opt, verbose_level);
268
269
270 L.foot(fp);
271
272 } // fp
273
275
276 cout << "Written file " << fname_arc_lifting << " of size "
277 << Fio.file_size(fname_arc_lifting) << endl;
278
279
280 if (f_v) {
281 cout << "surface_classify_using_arc::report done" << endl;
282 }
283}
284
285
288 int verbose_level)
289{
290 int f_v = (verbose_level >= 1);
291
292 if (f_v) {
293 cout << "surface_classify_using_arc::report2" << endl;
294 }
295
296 //surface_domain *Surf;
298
299 F = Surf_A->PA->F;
300 //Surf = Surf_A->Surf;
301
302 if (f_v) {
303 cout << "surface_classify_using_arc::report2 q=" << F->q << endl;
304 }
305
306
307
308 report_decomposition_matrix(ost, verbose_level);
309
310
311 int surface_idx;
312
313 for (surface_idx = 0;
314 surface_idx < nb_surfaces;
315 surface_idx++) {
316
317
318
319 ost << "Surface $" << surface_idx << "$ is associated with the following arcs: $";
320 Int_vec_print(ost,
322 Arc_identify_nb[surface_idx]);
323 ost << "$\\\\" << endl;
324
325
326
327 }
328
329
330 //fp << "\\clearpage" << endl << endl;
331
332
333
334 ost << "\\section*{Six-Arcs}" << endl << endl;
335
336
337 if (f_v) {
338 cout << "surface_classify_using_arc::report2 before Six_arcs->report_latex" << endl;
339 }
341 if (f_v) {
342 cout << "surface_classify_using_arc::report2 after Six_arcs->report_latex" << endl;
343 }
344
345#if 0
346 char fname_base[1000];
347 snprintf(fname_base, 1000, "arcs_q%d", F->q);
348
349 if (F->q < 20) {
350 cout << "before Gen->gen->draw_poset_full" << endl;
352 fname_base,
353 6 /* depth */, 0 /* data */,
354 TRUE /* f_embedded */,
355 FALSE /* f_sideways */,
356 100 /* rad */,
357 verbose_level);
358 }
359#endif
360
361
362 ost << "\\section*{Double Triplets}" << endl << endl;
363
364 if (f_v) {
365 cout << "surface_classify_using_arc::report2 before Surf_A->report_double_triplets" << endl;
366 }
367 if (f_v) {
369 }
370 if (f_v) {
371 cout << "surface_classify_using_arc::report2 after Surf_A->report_double_triplets" << endl;
372 }
373
374
375
376
377 ost << "\\section*{Summary of Surfaces}" << endl << endl;
378
379
380
381
382 for (surface_idx = 0;
383 surface_idx < nb_surfaces;
384 surface_idx++) {
385
386
387
388 ost << "\\subsection*{Surface $" << surface_idx << "$ of " << nb_surfaces << "}" << endl << endl;
389
390
391 if (f_v) {
392 cout << "surface_classify_using_arc::report2 before SCAL[" << surface_idx << "].report_summary" << endl;
393 }
394 SCAL[surface_idx].report_summary(ost, verbose_level);
395 if (f_v) {
396 cout << "surface_classify_using_arc::report2 after SCAL[" << surface_idx << "].report_summary" << endl;
397 }
398
399
400 ost << "The following " << Arc_identify_nb[surface_idx]
401 << " arcs are involved with surface " << nb_surfaces << ": $";
402 Int_vec_print(ost,
404 Arc_identify_nb[surface_idx]);
405 ost << "$\\\\" << endl;
406
407
408
409 }
410
411
412
413 ost << "\\section*{List of Surfaces}" << endl << endl;
414
415
416
417
418 for (surface_idx = 0;
419 surface_idx < nb_surfaces;
420 surface_idx++) {
421
422
423
424 ost << "\\subsection*{Surface $" << surface_idx << "$ of " << nb_surfaces << "}" << endl << endl;
425
426
427 if (f_v) {
428 cout << "surface_classify_using_arc::report2 before SCAL[" << surface_idx << "].report" << endl;
429 }
430 SCAL[surface_idx].report(ost, Opt, verbose_level);
431 if (f_v) {
432 cout << "surface_classify_using_arc::report2 after SCAL[" << surface_idx << "].report" << endl;
433 }
434
435
436 ost << "The following " << Arc_identify_nb[surface_idx]
437 << " arcs are involved with surface " << nb_surfaces << ": $";
438 Int_vec_print(ost,
440 Arc_identify_nb[surface_idx]);
441 ost << "$\\\\" << endl;
442
443
444
445 }
446
447
448 ost << "\\section*{Double Triplets: Details}" << endl << endl;
449 if (f_v) {
450 cout << "surface_classify_using_arc::report2 before Surf_A->report_double_triplets_detailed" << endl;
451 }
452 if (f_v) {
454 }
455 if (f_v) {
456 cout << "surface_classify_using_arc::report2 after Surf_A->report_double_triplets_detailed" << endl;
457 }
458
459
460 ost << "\\section*{Basics}" << endl << endl;
461
462 if (f_v) {
463 cout << "surface_classify_using_arc::report2 before Surf_A->report_basics_and_trihedral_pair" << endl;
464 }
465 if (f_v) {
466 Surf_A->report_basics(ost);
467 }
468 if (f_v) {
469 cout << "surface_classify_using_arc::report2 after Surf_A->report_basics_and_trihedral_pair" << endl;
470 }
471
472}
473
474
476{
477 int f_v = (verbose_level >= 1);
479
480 if (f_v) {
481 cout << "surface_classify_using_arc::report_decomposition_matrix" << endl;
482 }
483
484 ost << "\\section*{Decomposition Matrix Arcs vs Surfaces}" << endl << endl;
485
486
487
488 cout << "surface_classify_using_arc::report_decomposition_matrix "
489 "decomposition matrix:" << endl;
490 cout << "$$" << endl;
493 TRUE /* f_tex */);
494 cout << "$$" << endl;
495
496 ost << "Decomposition matrix:" << endl;
497 //fp << "$$" << endl;
498 //print_integer_matrix_with_standard_labels(fp, Decomp,
499 //nb_arcs_not_on_conic, nb_surfaces, TRUE /* f_tex */);
502 //fp << "$$" << endl;
503
505 char str[1000];
506 string fname_decomposition;
507
508 sprintf(str, "surfaces_q%d_decomposition_matrix.csv", Surf_A->PA->F->q);
509 fname_decomposition.assign(str);
510
511 Fio.int_matrix_write_csv(fname_decomposition, Decomp,
513 cout << "Written file " << fname_decomposition << " of size "
514 << Fio.file_size(fname_decomposition) << endl;
515
516 if (f_v) {
517 cout << "surface_classify_using_arc::report_decomposition_matrix done" << endl;
518 }
519
520}
521
522}}}}
523
524
options for drawing an object of type layered_graph
Definition: graphics.h:457
void int_matrix_write_csv(std::string &fname, int *M, int m, int n)
Definition: file_io.cpp:1300
void print_integer_matrix_tex_block_by_block(std::ostream &ost, int *p, int m, int n, int block_width)
void head(std::ostream &ost, int f_book, int f_title, const char *title, const char *author, int f_toc, int f_landscape, int f_12pt, int f_enlarged_page, int f_pagenumbers, const char *extras_for_preamble)
void print_integer_matrix_with_standard_labels(std::ostream &ost, int *p, int m, int n, int f_tex)
to control the behavior of the poset classification algorithm
void draw_poset(std::string &fname_base, int depth, int data, graphics::layered_graph_draw_options *LG_Draw_options, int verbose_level)
void classify_surfaces_through_arcs_and_trihedral_pairs(poset_classification::poset_classification_control *Control_six_arcs, cubic_surfaces_in_general::surface_with_action *Surf_A, int f_test_nb_Eckardt_points, int nb_E, int verbose_level)
void init(apps_geometry::arc_generator_description *Descr, projective_geometry::projective_space_with_action *PA, int f_test_nb_Eckardt_points, int nb_E, int verbose_level)
description of a classification problem of arcs in a geometry
Definition: tl_geometry.h:27
poset_classification::poset_classification_control * Control
Definition: tl_geometry.h:32
poset_classification::poset_classification * gen
Definition: tl_geometry.h:104
#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_print(A, B, C)
Definition: foundations.h:685
the orbiter library for the classification of combinatorial objects