Orbiter 2022
Combinatorial Objects
interface_projective.cpp
Go to the documentation of this file.
1/*
2 * interface_projective.cpp
3 *
4 * Created on: Apr 14, 2020
5 * Author: betten
6 */
7
8
9
10
11
12
13#include "orbiter.h"
14
15using namespace std;
16
17namespace orbiter {
18namespace layer5_applications {
19namespace user_interface {
20
21
22
23
25{
26
27 f_create_points_on_quartic = FALSE;
28 desired_distance = 0;
29
30 f_create_points_on_parabola = FALSE;
31 parabola_N = 0;
32 parabola_a = 0;
33 parabola_b = 0.;
34 parabola_c = 0.;
35
36 f_smooth_curve = FALSE;
37 //smooth_curve_label;
38 smooth_curve_N = 0;
39 smooth_curve_t_min = 0;
40 smooth_curve_t_max = 0;
41 smooth_curve_boundary = 0;
42 //smooth_curve_Polish = NULL;
43 FP_descr = NULL;
44
45
46 f_create_spread = FALSE;
47 Spread_create_description = FALSE;
48
49
50 f_make_table_of_surfaces = FALSE;
51
52 f_create_surface_reports = FALSE;
53 //std::string create_surface_reports_field_orders_text;
54
55 f_create_surface_atlas = FALSE;
56 create_surface_atlas_q_max = 0;
57
58 f_create_dickson_atlas = FALSE;
59
60
61 //std::vector<std::string> transform_coeffs;
62 //std::vector<int> f_inverse_transform;
63
64}
65
66
68 std::string *argv, int i, int verbose_level)
69{
71
72 if (ST.stringcmp(argv[i], "-create_points_on_quartic") == 0) {
73 cout << "-create_points_on_quartic <double : desired_distance>" << endl;
74 }
75 else if (ST.stringcmp(argv[i], "-create_points_on_parabola") == 0) {
76 cout << "-create_points_on_parabola <double : desired_distance> <double : a> <double : b> <double : c>" << endl;
77 }
78 else if (ST.stringcmp(argv[i], "-smooth_curve") == 0) {
79 cout << "-smooth_curve <string : label> <double : desired_distance> <int : N> <double : boundary> <double : t_min> <double : t_max> <function>" << endl;
80 }
81 else if (ST.stringcmp(argv[i], "-create_spread") == 0) {
82 cout << "-create_spread <description>" << endl;
83 }
84 else if (ST.stringcmp(argv[i], "-make_table_of_surfaces") == 0) {
85 cout << "-make_table_of_surfaces " << endl;
86 }
87 else if (ST.stringcmp(argv[i], "-create_surface_reports") == 0) {
88 cout << "-create_surface_reports <string : field orders>" << endl;
89 }
90 else if (ST.stringcmp(argv[i], "-create_surface_atlas") == 0) {
91 cout << "-create_surface_atlas <int : q_max>" << endl;
92 }
93 else if (ST.stringcmp(argv[i], "-create_dickson_atlas") == 0) {
94 cout << "-create_dickson_atlas" << endl;
95 }
96}
97
98
99
101 std::string *argv, int i, int verbose_level)
102{
104
105 if (i >= argc) {
106 return false;
107 }
108 if (ST.stringcmp(argv[i], "-create_points_on_quartic") == 0) {
109 return true;
110 }
111 else if (ST.stringcmp(argv[i], "-create_points_on_parabola") == 0) {
112 return true;
113 }
114 else if (ST.stringcmp(argv[i], "-smooth_curve") == 0) {
115 return true;
116 }
117 else if (ST.stringcmp(argv[i], "-create_spread") == 0) {
118 return true;
119 }
120 else if (ST.stringcmp(argv[i], "-make_table_of_surfaces") == 0) {
121 return true;
122 }
123 else if (ST.stringcmp(argv[i], "-create_surface_reports") == 0) {
124 return true;
125 }
126 else if (ST.stringcmp(argv[i], "-create_surface_atlas") == 0) {
127 return true;
128 }
129 else if (ST.stringcmp(argv[i], "-create_dickson_atlas") == 0) {
130 return true;
131 }
132 return false;
133}
134
136 std::string *argv, int &i, int verbose_level)
137{
138 int f_v = (verbose_level >= 1);
140
141 if (f_v) {
142 cout << "interface_projective::read_arguments" << endl;
143 }
144 if (f_v) {
145 cout << "interface_projective::read_arguments the next argument is " << argv[i] << endl;
146 }
147 if (ST.stringcmp(argv[i], "-create_points_on_quartic") == 0) {
148 f_create_points_on_quartic = TRUE;
149 desired_distance = ST.strtof(argv[++i]);
150 if (f_v) {
151 cout << "-create_points_on_quartic " << desired_distance << endl;
152 }
153 }
154 else if (ST.stringcmp(argv[i], "-create_points_on_parabola") == 0) {
155 f_create_points_on_parabola = TRUE;
156 desired_distance = ST.strtof(argv[++i]);
157 parabola_N = ST.strtoi(argv[++i]);
158 parabola_a = ST.strtof(argv[++i]);
159 parabola_b = ST.strtof(argv[++i]);
160 parabola_c = ST.strtof(argv[++i]);
161 if (f_v) {
162 cout << "-create_points_on_parabola " << desired_distance << " "
163 << parabola_N << " " << parabola_a << " "
164 << parabola_b << " " << parabola_c << endl;
165 }
166 }
167 else if (ST.stringcmp(argv[i], "-smooth_curve") == 0) {
168 f_smooth_curve = TRUE;
169 smooth_curve_label.assign(argv[++i]);
170 desired_distance = ST.strtof(argv[++i]);
171 smooth_curve_N = ST.strtoi(argv[++i]);
172 smooth_curve_boundary = ST.strtof(argv[++i]);
173 smooth_curve_t_min = ST.strtof(argv[++i]);
174 smooth_curve_t_max = ST.strtof(argv[++i]);
175
177
178 i += FP_descr->read_arguments(argc - (i + 1),
179 argv + i + 1, verbose_level);
180
181 if (f_v) {
182 cout << "-smooth_curve "
183 << smooth_curve_label << " "
184 << desired_distance << " "
185 << smooth_curve_N << " "
186 << smooth_curve_boundary << " "
187 << smooth_curve_t_min << " "
188 << smooth_curve_t_max << " "
189 << endl;
190 }
191 }
192 else if (ST.stringcmp(argv[i], "-create_spread") == 0) {
193 f_create_spread = TRUE;
194 if (f_v) {
195 cout << "-create_spread" << endl;
196 }
197 Spread_create_description = NEW_OBJECT(spreads::spread_create_description);
198 i += Spread_create_description->read_arguments(
199 argc - (i - 1),
200 argv + i + 1, verbose_level);
201 if (f_v) {
202 cout << "interface_combinatorics::read_arguments finished "
203 "reading -create_spread" << endl;
204 cout << "i = " << i << endl;
205 cout << "argc = " << argc << endl;
206 if (i < argc) {
207 cout << "next argument is " << argv[i] << endl;
208 }
209 cout << "-create_spread" << endl;
210 Spread_create_description->print();
211 }
212 }
213 else if (ST.stringcmp(argv[i], "-transform") == 0) {
214
215 string s;
216
217 s.assign(argv[++i]);
218 transform_coeffs.push_back(s);
219 f_inverse_transform.push_back(FALSE);
220 if (f_v) {
221 cout << "-transform " << transform_coeffs[transform_coeffs.size() - 1] << endl;
222 }
223 }
224 else if (ST.stringcmp(argv[i], "-transform_inverse") == 0) {
225 string s;
226
227 s.assign(argv[++i]);
228 transform_coeffs.push_back(s);
229 f_inverse_transform.push_back(TRUE);
230 if (f_v) {
231 cout << "-transform_inverse " << transform_coeffs[transform_coeffs.size() - 1] << endl;
232 }
233 }
234 else if (ST.stringcmp(argv[i], "-make_table_of_surfaces") == 0) {
235 f_make_table_of_surfaces = TRUE;
236 if (f_v) {
237 cout << "-make_table_of_surfaces" << endl;
238 }
239 }
240 else if (ST.stringcmp(argv[i], "-create_surface_atlas") == 0) {
241 f_create_surface_atlas = TRUE;
242 create_surface_atlas_q_max = ST.strtoi(argv[++i]);
243 if (f_v) {
244 cout << "-create_surface_atlas " << create_surface_atlas_q_max << endl;
245 }
246 }
247 else if (ST.stringcmp(argv[i], "-create_surface_reports") == 0) {
248 f_create_surface_reports = TRUE;
249 create_surface_reports_field_orders_text.assign(argv[++i]);
250 if (f_v) {
251 cout << "-create_surface_reports " << create_surface_reports_field_orders_text << endl;
252 }
253 }
254 else if (ST.stringcmp(argv[i], "-create_dickson_atlas") == 0) {
255 f_create_dickson_atlas = TRUE;
256 if (f_v) {
257 cout << "-create_dickson_atlas " << endl;
258 }
259 }
260 if (f_v) {
261 cout << "interface_projective::read_arguments done" << endl;
262 }
263}
264
266{
267 if (f_create_points_on_quartic) {
268 cout << "-create_points_on_quartic " << desired_distance << endl;
269 }
270 if (f_create_points_on_parabola) {
271 cout << "-create_points_on_parabola " << desired_distance << " "
272 << parabola_N << " " << parabola_a << " "
273 << parabola_b << " " << parabola_c << endl;
274 }
275 if (f_smooth_curve) {
276 cout << "-smooth_curve "
277 << smooth_curve_label << " "
278 << desired_distance << " "
279 << smooth_curve_N << " "
280 << smooth_curve_boundary << " "
281 << smooth_curve_t_min << " "
282 << smooth_curve_t_max << " "
283 << endl;
284 FP_descr->print();
285 }
286 if (f_create_spread) {
287 cout << "-create_spread" << endl;
288 Spread_create_description->print();
289 }
290
291 int i;
292
293 for (i = 0; i < transform_coeffs.size(); i++) {
294 if (f_inverse_transform[i]) {
295 cout << "-transform_inverse " << transform_coeffs[i] << endl;
296 }
297 else {
298 cout << "-transform " << transform_coeffs[i] << endl;
299 }
300 }
301
302 if (f_make_table_of_surfaces) {
303 cout << "-make_table_of_surfaces" << endl;
304 }
305 if (f_create_surface_atlas) {
306 cout << "-create_surface_atlas " << create_surface_atlas_q_max << endl;
307 }
308 if (f_create_surface_reports) {
309 cout << "-create_surface_reports " << create_surface_reports_field_orders_text << endl;
310 }
311 if (f_create_dickson_atlas) {
312 cout << "-create_dickson_atlas " << endl;
313 }
314}
315
316
317
318void interface_projective::worker(int verbose_level)
319{
320 int f_v = (verbose_level >= 1);
321
322 if (f_v) {
323 cout << "interface_projective::worker" << endl;
324 }
325
326 if (f_create_points_on_quartic) {
327
329
330 GO.do_create_points_on_quartic(desired_distance, verbose_level);
331 }
332 else if (f_create_points_on_parabola) {
333
335
336 GO.do_create_points_on_parabola(desired_distance,
337 parabola_N, parabola_a, parabola_b, parabola_c, verbose_level);
338 }
339 else if (f_smooth_curve) {
340
342
343 GO.do_smooth_curve(smooth_curve_label,
344 desired_distance, smooth_curve_N,
345 smooth_curve_t_min, smooth_curve_t_max, smooth_curve_boundary,
346 FP_descr, verbose_level);
347 }
348 else if (f_create_spread) {
349
350 do_create_spread(Spread_create_description, verbose_level);
351
352 }
353
354
355 else if (f_make_table_of_surfaces) {
356
358
359 Surf.make_table_of_surfaces(verbose_level);
360 }
361
362 else if (f_create_surface_reports) {
363
365
366 SH.do_create_surface_reports(create_surface_reports_field_orders_text, verbose_level);
367
368 }
369
370 else if (f_create_surface_atlas) {
371
373
374 SH.do_create_surface_atlas(create_surface_atlas_q_max, verbose_level);
375
376 }
377
378 else if (f_create_dickson_atlas) {
379
381
382 SH.do_create_dickson_atlas(verbose_level);
383
384 }
385
386
387
388
389 if (f_v) {
390 cout << "interface_projective::worker done" << endl;
391 }
392}
393
394
395
396
397
399{
400 int f_v = (verbose_level >= 1);
401
402 if (f_v) {
403 cout << "interface_projective::do_create_spread" << endl;
404 }
405
406
408
410
411 if (f_v) {
412 cout << "before SC->init" << endl;
413 }
414 SC->init(Descr, verbose_level);
415 if (f_v) {
416 cout << "after SC->init" << endl;
417 }
418
419
420 if (f_v) {
421 cout << "before SC->apply_transformations" << endl;
422 }
423 SC->apply_transformations(transform_coeffs,
424 f_inverse_transform, verbose_level);
425 if (f_v) {
426 cout << "after SC->apply_transformations" << endl;
427 }
428
429
431 //int *Elt1;
432 int *Elt2;
433
434 A = SC->A;
435
436 Elt2 = NEW_int(A->elt_size_in_int);
437
439
440 if (f_v) {
441 cout << "We have created the following spread set:" << endl;
442 cout << "$$" << endl;
443 L.lint_set_print_tex(cout, SC->set, SC->sz);
444 cout << endl;
445 cout << "$$" << endl;
446
447 if (SC->f_has_group) {
448 cout << "The stabilizer is generated by:" << endl;
449 SC->Sg->print_generators_tex(cout);
450 }
451 }
452
453
454
455
456
457 FREE_int(Elt2);
458
459 FREE_OBJECT(SC);
460
461 if (f_v) {
462 cout << "interface_projective::do_create_spread done" << endl;
463 }
464
465}
466
467
468}}}
469
470
functions related to strings and character arrays
description of a function in reverse polish notation from the command line
Definition: globals.h:61
int read_arguments(int argc, std::string *argv, int verbose_level)
a catch-all class for things related to 2D graphics
Definition: graphics.h:411
void do_create_points_on_parabola(double desired_distance, int N, double a, double b, double c, int verbose_level)
void do_create_points_on_quartic(double desired_distance, int verbose_level)
void do_smooth_curve(std::string &curve_label, double desired_distance, int N, double t_min, double t_max, double boundary, function_polish_description *FP_descr, int verbose_level)
void lint_set_print_tex(std::ostream &ost, long int *v, int len)
a permutation group in a fixed action.
Definition: actions.h:99
to describe the construction of a known spread from the command line
Definition: spreads.h:264
int read_arguments(int argc, std::string *argv, int verbose_level)
to create a known spread using a description from class spread_create_description
Definition: spreads.h:296
void init(spread_create_description *Descr, int verbose_level)
void apply_transformations(std::vector< std::string > transform_coeffs, std::vector< int > f_inverse_transform, int verbose_level)
int recognize_keyword(int argc, std::string *argv, int i, int verbose_level)
void print_help(int argc, std::string *argv, int i, int verbose_level)
void do_create_spread(spreads::spread_create_description *Descr, int verbose_level)
void read_arguments(int argc, std::string *argv, int &i, int verbose_level)
#define FREE_int(p)
Definition: foundations.h:640
#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 TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
the orbiter library for the classification of combinatorial objects