Orbiter 2022
Combinatorial Objects
BLT_set_create.cpp
Go to the documentation of this file.
1// BLT_set_create.cpp
2//
3// Anton Betten
4//
5// March 17, 2018
6//
7//
8//
9//
10//
11
12#include "orbiter.h"
13
14using namespace std;
15
16namespace orbiter {
17namespace layer5_applications {
18namespace orthogonal_geometry_applications {
19
20
22{
23 OA = NULL;
24 set = NULL;
25 ABC = NULL;
27 Sg = NULL;
28 Blt_set_domain = NULL;
29 BA = NULL;
30 null();
31}
32
34{
35 freeself();
36}
37
39{
40}
41
43{
44 if (set) {
46 }
47 if (ABC) {
49 }
50 if (Sg) {
52 }
53 if (Blt_set_domain) {
55 }
56 if (BA) {
58 }
59 null();
60}
61
66 int verbose_level)
67{
68 int f_v = (verbose_level >= 1);
71
72 if (f_v) {
73 cout << "BLT_set_create::init" << endl;
74 }
77
78 if (OA->Descr->n != 5) {
79 cout << "BLT_set_create::init OA->Descr->n != 5" << endl;
80 exit(1);
81 }
82
83
84
85 if (Descr->f_family) {
86 if (f_v) {
87 cout << "BLT_set_create::init family_name=" << Descr->family_name << endl;
88 }
89
90 char str[1000];
91 char str_q[1000];
93
94 if (ST.stringcmp(Descr->family_name, "Linear") == 0) {
95 if (f_v) {
96 cout << "BLT_set_create::init creating object of family Linear" << endl;
97 }
98 set = NEW_lint(OA->Descr->F->q + 1);
99 ABC = NEW_int(3 * (OA->Descr->F->q + 1));
100
103 int q, Q;
104
106 q = OA->Descr->F->q;
107 Q = q * q;
108 FQ->finite_field_init(Q, FALSE /* f_without_tables */, 0 /* verbose_level */);
110 FQ, OA->Descr->F, verbose_level);
111
112 FREE_OBJECT(FQ);
113 sprintf(str, "Linear");
114 sprintf(str_q, "q%d", OA->Descr->F->q);
115
116 }
117
118 else if (ST.stringcmp(Descr->family_name, "Fisher") == 0) {
119 if (f_v) {
120 cout << "BLT_set_create::init creating object of family Fisher" << endl;
121 }
122 set = NEW_lint(OA->Descr->F->q + 1);
123 ABC = NEW_int(3 * (OA->Descr->F->q + 1));
124
127 int q, Q;
128
130 q = OA->Descr->F->q;
131 Q = q * q;
132 FQ->finite_field_init(Q, FALSE /* f_without_tables */, 0 /* verbose_level */);
134 FQ, OA->Descr->F, verbose_level);
135
136 FREE_OBJECT(FQ);
137 sprintf(str, "Fisher");
138 sprintf(str_q, "q%d", OA->Descr->F->q);
139
140 }
141
142 else if (ST.stringcmp(Descr->family_name, "Mondello") == 0) {
143 if (f_v) {
144 cout << "BLT_set_create::init creating object of family Mondello" << endl;
145 }
146 set = NEW_lint(OA->Descr->F->q + 1);
147 ABC = NEW_int(3 * (OA->Descr->F->q + 1));
148
151 int q, Q;
152
154 q = OA->Descr->F->q;
155 Q = q * q;
156 FQ->finite_field_init(Q, FALSE /* f_without_tables */, 0 /* verbose_level */);
158 FQ, OA->Descr->F, verbose_level);
159
160 FREE_OBJECT(FQ);
161 sprintf(str, "Mondello");
162 sprintf(str_q, "q%d", OA->Descr->F->q);
163
164 }
165
166
167 else if (ST.stringcmp(Descr->family_name, "FTWKB") == 0) {
168 if (f_v) {
169 cout << "BLT_set_create::init creating object of family FTWKB" << endl;
170 }
171 set = NEW_lint(OA->Descr->F->q + 1);
172 ABC = NEW_int(3 * (OA->Descr->F->q + 1));
173 OA->O->create_FTWKB_BLT_set(set, ABC, verbose_level);
174 // for q congruent 2 mod 3
175 // a(t)= t, b(t) = 3*t^2, c(t) = 3*t^3, all t \in GF(q)
176 // together with the point (0, 0, 0, 1, 0)
177 sprintf(str, "FTWKB");
178 sprintf(str_q, "q%d", OA->Descr->F->q);
179
180 }
181 else if (ST.stringcmp(Descr->family_name, "Kantor1") == 0) {
182 if (f_v) {
183 cout << "BLT_set_create::init creating object of family Kantor1" << endl;
184 }
185 set = NEW_lint(OA->Descr->F->q + 1);
186 ABC = NEW_int(3 * (OA->Descr->F->q + 1));
187 OA->O->create_K1_BLT_set(set, ABC, verbose_level);
188 // for a non-square m, and q=p^e
189 // a(t)= t, b(t) = 0, c(t) = -m*t^p, all t \in GF(q)
190 // together with the point (0, 0, 0, 1, 0)
191 sprintf(str, "K1");
192 sprintf(str_q, "q%d", OA->Descr->F->q);
193 }
194 else if (ST.stringcmp(Descr->family_name, "Kantor2") == 0) {
195 if (f_v) {
196 cout << "BLT_set_create::init creating object of family Kantor2" << endl;
197 }
198 set = NEW_lint(OA->Descr->F->q + 1);
199 ABC = NEW_int(3 * (OA->Descr->F->q + 1));
200 OA->O->create_K2_BLT_set(set, ABC, verbose_level);
201 // for q congruent 2 or 3 mod 5
202 // a(t)= t, b(t) = 5*t^3, c(t) = 5*t^5, all t \in GF(q)
203 // together with the point (0, 0, 0, 1, 0)
204 sprintf(str, "K2");
205 sprintf(str_q, "q%d", OA->Descr->F->q);
206 }
207 else if (ST.stringcmp(Descr->family_name, "LP_37_72") == 0) {
208 if (f_v) {
209 cout << "BLT_set_create::init creating object LP_37_72" << endl;
210 }
211 set = NEW_lint(OA->Descr->F->q + 1);
212 OA->O->create_LP_37_72_BLT_set(set, verbose_level);
213 sprintf(str, "LP_ago72");
214 sprintf(str_q, "q%d", OA->Descr->F->q);
215 }
216 else if (ST.stringcmp(Descr->family_name, "LP_37_4a") == 0) {
217 if (f_v) {
218 cout << "BLT_set_create::init creating object LP_37_4a" << endl;
219 }
220 set = NEW_lint(OA->Descr->F->q + 1);
221 OA->O->create_LP_37_4a_BLT_set(set, verbose_level);
222 sprintf(str, "LP_ago4a");
223 sprintf(str_q, "q%d", OA->Descr->F->q);
224 }
225 else if (ST.stringcmp(Descr->family_name, "LP_37_4b") == 0) {
226 if (f_v) {
227 cout << "BLT_set_create::init creating object LP_37_4b" << endl;
228 }
229 set = NEW_lint(OA->Descr->F->q + 1);
230 OA->O->create_LP_37_4b_BLT_set(set, verbose_level);
231 sprintf(str, "LP_ago4b");
232 sprintf(str_q, "q%d", OA->Descr->F->q);
233 }
234 else if (ST.stringcmp(Descr->family_name, "LP_71") == 0) {
235 if (f_v) {
236 cout << "BLT_set_create::init creating object LP_71" << endl;
237 }
238 set = NEW_lint(OA->Descr->F->q + 1);
239 OA->O->create_Law_71_BLT_set(set, verbose_level);
240 sprintf(str, "LP");
241 sprintf(str_q, "q%d", OA->Descr->F->q);
242 }
243 else {
244 cout << "BLT_set_create::init family name not recognized" << endl;
245 exit(1);
246 }
247
248 prefix.assign(str);
249
250 label_txt.assign(prefix);
251 label_txt.append("_");
252 label_txt.append(str_q);
253
254 label_tex.assign(prefix);
255 label_tex.append("\\_");
256 label_tex.append(str_q);
257
258 }
259
260
261 else if (Descr->f_catalogue) {
262
263 if (f_v) {
264 cout << "BLT_set_create::init BLT set from catalogue" << endl;
265 }
266 int nb_iso;
268
269 nb_iso = K.BLT_nb_reps(OA->Descr->F->q);
270 if (Descr->iso >= nb_iso) {
271 cout << "BLT_set_create::init iso >= nb_iso, "
272 "this BLT set does not exist" << endl;
273 exit(1);
274 }
275
276 set = NEW_lint(OA->Descr->F->q + 1);
278
280
281 if (f_v) {
282 cout << "BLT_set_create::init before "
283 "Sg->BLT_set_from_catalogue_stabilizer" << endl;
284 }
285
287 OA->Descr->F, Descr->iso,
288 verbose_level);
290
291 char str_q[1000];
292 char str_iso[1000];
293
294 sprintf(str_q, "%d", OA->Descr->F->q);
295 sprintf(str_iso, "%d", Descr->iso);
296
297 prefix.assign("catalogue_q");
298 prefix.append(str_q);
299 prefix.append("_iso");
300 prefix.append(str_iso);
301
302 label_txt.assign("catalogue_q");
303 label_txt.append(str_q);
304 label_txt.append("_iso");
305 label_txt.append(str_iso);
306
307 label_tex.assign("catalogue\\_q");
308 label_tex.append(str_q);
309 label_tex.append("\\_iso");
310 label_tex.append(str_iso);
311
312 if (f_v) {
313 cout << "BLT_set_create::init after "
314 "Sg->BLT_set_from_catalogue_stabilizer" << endl;
315 }
316 }
317 else {
318 cout << "BLT_set_create::init we do not recognize "
319 "the type of BLT-set" << endl;
320 exit(1);
321 }
322
323
324 if (f_v) {
325 cout << "BLT_set_create::init set = ";
326 Lint_vec_print(cout, set, OA->Descr->F->q + 1);
327 cout << endl;
328 }
329
330 if (f_has_group) {
331 cout << "BLT_set_create::init the stabilizer is:" << endl;
333 }
334
335
337
338 if (f_v) {
339 cout << "BLT_set_create::init before BA->init_set" << endl;
340 }
341 BA->init_set(
342 OA->A,
344 set,
345 Sg,
346 verbose_level);
347 if (f_v) {
348 cout << "BLT_set_create::init after BA->init_set" << endl;
349 }
350
351
352
353 if (f_v) {
354 cout << "BLT_set_create::init done" << endl;
355 }
356}
357
359 std::vector<std::string> transform_coeffs,
360 std::vector<int> f_inverse_transform, int verbose_level)
361{
362 int f_v = (verbose_level >= 1);
363
364 if (f_v) {
365 cout << "BLT_set_create::apply_transformations done" << endl;
366 }
367}
368
369void BLT_set_create::report(int verbose_level)
370{
371 int f_v = (verbose_level >= 1);
372
373 if (f_v) {
374 cout << "BLT_set_create::report" << endl;
375 }
376
377 string fname;
378
379 fname.assign("BLT_");
380 fname.append(label_txt);
381 fname.append(".tex");
382 ofstream ost(fname);
383
384 report2(ost, verbose_level);
385
386
387 if (f_v) {
388 cout << "BLT_set_create::report done" << endl;
389 }
390}
391
392void BLT_set_create::report2(std::ostream &ost, int verbose_level)
393{
394 int f_v = (verbose_level >= 1);
395
396 if (f_v) {
397 cout << "BLT_set_create::report2" << endl;
398 }
399
400 int f_book = FALSE;
401 int f_title = TRUE;
402 char title[1000];
403 const char *author = "Orbiter";
404 int f_toc = FALSE;
405 int f_landscape = FALSE;
406 int f_12pt = FALSE;
407 int f_enlarged_page = TRUE;
408 int f_pagenumbers = TRUE;
410
411 sprintf(title, "BLT-set %s", label_tex.c_str());
412
413 L.head(ost, f_book, f_title,
414 title,
415 author,
416 f_toc,
417 f_landscape,
418 f_12pt,
419 f_enlarged_page,
420 f_pagenumbers,
421 NULL /* extra_praeamble */);
422
423
424 OA->O->report_quadratic_form(ost, verbose_level - 1);
425
426 if (ABC) {
427 print_set_of_points_with_ABC(ost, set, OA->O->F->q + 1);
428 }
429 else {
430 print_set_of_points(ost, set, OA->O->F->q + 1);
431 }
432
433 BA->report(ost, verbose_level);
434
435 L.foot(ost);
436
437 if (f_v) {
438 cout << "BLT_set_create::report2 done" << endl;
439 }
440}
441
442void BLT_set_create::print_set_of_points(std::ostream &ost, long int *Pts, int nb_pts)
443{
444 int h, I;
445 int *v;
446 int n = 4;
447
448 v = NEW_int(n + 1);
449
450 ost << "The BLT-set is:\\\\" << endl;
451 for (I = 0; I < (nb_pts + 39) / 40; I++) {
452 ost << "$$" << endl;
453 ost << "\\begin{array}{|r|r|r|}" << endl;
454 ost << "\\hline" << endl;
455 ost << "i & \\mbox{Rank} & \\mbox{Point} \\\\" << endl;
456 ost << "\\hline" << endl;
457 ost << "\\hline" << endl;
458 for (h = 0; h < 40; h++) {
459 if (I * 40 + h < nb_pts) {
460
461 OA->O->unrank_point(v, 1, Pts[I * 40 + h], 0 /* verbose_level */);
462
463 ost << I * 40 + h << " & " << Pts[I * 40 + h] << " & ";
464 Int_vec_print(ost, v, n + 1);
465 ost << "\\\\" << endl;
466 }
467 }
468 ost << "\\hline" << endl;
469 ost << "\\end{array}" << endl;
470 ost << "$$" << endl;
471 }
472 FREE_int(v);
473}
474
475void BLT_set_create::print_set_of_points_with_ABC(std::ostream &ost, long int *Pts, int nb_pts)
476{
477 int h, I;
478 int *v;
479 int n = 4;
480 int a, b, c;
481
482 v = NEW_int(n + 1);
483
484 ost << "The BLT-set is:\\\\" << endl;
485 for (I = 0; I < (nb_pts + 39) / 40; I++) {
486 ost << "$$" << endl;
487 ost << "\\begin{array}{|r|r|r|r|}" << endl;
488 ost << "\\hline" << endl;
489 ost << "i & \\mbox{Rank} & \\mbox{Point} & (a,b,c) \\\\" << endl;
490 ost << "\\hline" << endl;
491 ost << "\\hline" << endl;
492 for (h = 0; h < 40; h++) {
493 if (I * 40 + h < nb_pts) {
494
495 OA->O->unrank_point(v, 1, Pts[I * 40 + h], 0 /* verbose_level */);
496
497 a = ABC[3 * (I * 40 + h) + 0];
498 b = ABC[3 * (I * 40 + h) + 1];
499 c = ABC[3 * (I * 40 + h) + 2];
500
501 ost << I * 40 + h << " & " << Pts[I * 40 + h] << " & ";
502 Int_vec_print(ost, v, n + 1);
503 ost << " & ";
504 ost << "(";
505 ost << a;
506 ost << ", ";
507 ost << b;
508 ost << ", ";
509 ost << c;
510 ost << ")";
511 ost << "\\\\" << endl;
512 }
513 }
514 ost << "\\hline" << endl;
515 ost << "\\end{array}" << endl;
516 ost << "$$" << endl;
517 }
518 FREE_int(v);
519}
520
521
522
523}}}
524
functions related to strings and character arrays
void finite_field_init(int q, int f_without_tables, int verbose_level)
various functions related to geometries
Definition: geometry.h:721
void create_Fisher_BLT_set(long int *Fisher_BLT, int *ABC, field_theory::finite_field *FQ, field_theory::finite_field *Fq, int verbose_level)
void create_Mondello_BLT_set(long int *BLT, int *ABC, field_theory::finite_field *FQ, field_theory::finite_field *Fq, int verbose_level)
void create_Linear_BLT_set(long int *BLT, int *ABC, field_theory::finite_field *FQ, field_theory::finite_field *Fq, int verbose_level)
provides access to pre-computed combinatorial data in encoded form
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 unrank_point(int *v, int stride, long int rk, int verbose_level)
void create_Law_71_BLT_set(long int *set, int verbose_level)
void create_FTWKB_BLT_set(long int *set, int *ABC, int verbose_level)
void create_LP_37_4a_BLT_set(long int *set, int verbose_level)
void create_LP_37_72_BLT_set(long int *set, int verbose_level)
void create_K2_BLT_set(long int *set, int *ABC, int verbose_level)
void create_K1_BLT_set(long int *set, int *ABC, int verbose_level)
void report_quadratic_form(std::ostream &ost, int verbose_level)
void create_LP_37_4b_BLT_set(long int *set, int verbose_level)
a strong generating set for a permutation group with respect to a fixed action
Definition: groups.h:1703
void BLT_set_from_catalogue_stabilizer(actions::action *A, field_theory::finite_field *F, int iso, int verbose_level)
void init(layer1_foundations::orthogonal_geometry::blt_set_domain *Blt_set_domain, BLT_set_create_description *Descr, orthogonal_space_with_action *OA, int verbose_level)
layer1_foundations::orthogonal_geometry::blt_set_domain * Blt_set_domain
void apply_transformations(std::vector< std::string > transform_coeffs, std::vector< int > f_inverse_transform, int verbose_level)
void print_set_of_points_with_ABC(std::ostream &ost, long int *Pts, int nb_pts)
void print_set_of_points(std::ostream &ost, long int *Pts, int nb_pts)
void init_set(actions::action *A, orthogonal_geometry::blt_set_domain *Blt_set_domain, long int *set, groups::strong_generators *Aut_gens, int verbose_level)
#define Lint_vec_copy(A, B, C)
Definition: foundations.h:694
#define FREE_int(p)
Definition: foundations.h:640
#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 TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
#define FREE_lint(p)
Definition: foundations.h:642
#define NEW_lint(n)
Definition: foundations.h:628
#define Int_vec_print(A, B, C)
Definition: foundations.h:685
the orbiter library for the classification of combinatorial objects