Orbiter 2022
Combinatorial Objects
delandtsheer_doyen_description.cpp
Go to the documentation of this file.
1/*
2 * delandtsheer_doyen_description.cpp
3 *
4 * Created on: May 24, 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 apps_combinatorics {
20
21
23{
24
25 f_depth = FALSE;
26 depth = 0;
27
28 f_d1 = FALSE;
29 d1 = 0;
30 f_d2 = FALSE;
31 d2 = 0;
32 f_q1 = FALSE;
33 q1 = 0;
34 f_q2 = FALSE;
35 q2 = 0;
36
38 //group_label = NULL;
39
41 //mask_label = NULL;
42
44 //std::string problem_label;
45
48 f_K = FALSE;
49 K = 0;
50
51
54
56 Search_control = NULL;
57
58 f_R = FALSE;
59 nb_row_types = 0;
60 row_type = NULL; // [nb_row_types + 1]
61
62 f_C = FALSE;
63 nb_col_types = 0;
64 col_type = NULL; // [nb_col_types + 1]
65
68
69 // mask related test:
70 nb_mask_tests = 0;
71
74 //subgroup_gens = NULL;
75 //subgroup_order = NULL;
76
78
79}
80
81
83{
84 if (row_type) {
86 }
87 if (col_type) {
89 }
92 }
93 if (Search_control) {
95 }
96}
97
98
100 int argc, std::string *argv,
101 int verbose_level)
102{
103 int i, j;
105
106 cout << "delandtsheer_doyen_description::read_arguments" << endl;
107
108
109 nb_mask_tests = 0;
110
111
112
113 for (i = 0; i < argc; i++) {
114
115
116 if (ST.stringcmp(argv[i], "-group_label") == 0) {
118 group_label.assign(argv[++i]);
119 cout << "-group_label " << group_label << endl;
120 }
121 else if (ST.stringcmp(argv[i], "-mask_label") == 0) {
123 mask_label.assign(argv[++i]);
124 cout << "-mask_label " << mask_label << endl;
125 }
126 else if (ST.stringcmp(argv[i], "-problem_label") == 0) {
128 problem_label.assign(argv[++i]);
129 cout << "-problem_label " << problem_label << endl;
130 }
131 else if (ST.stringcmp(argv[i], "-depth") == 0) {
132 f_depth = TRUE;
133 depth = ST.strtoi(argv[++i]);
134 cout << "-depth " << depth << endl;
135 }
136 else if (ST.stringcmp(argv[i], "-d1") == 0) {
137 f_d1 = TRUE;
138 d1 = ST.strtoi(argv[++i]);
139 cout << "-d1 " << d1 << endl;
140 }
141 else if (ST.stringcmp(argv[i], "-d2") == 0) {
142 f_d2 = TRUE;
143 d2 = ST.strtoi(argv[++i]);
144 cout << "-d2 " << d2 << endl;
145 }
146 else if (ST.stringcmp(argv[i], "-q1") == 0) {
147 f_q1 = TRUE;
148 q1 = ST.strtoi(argv[++i]);
149 cout << "-q1 " << q1 << endl;
150 }
151 else if (ST.stringcmp(argv[i], "-q2") == 0) {
152 f_q2 = TRUE;
153 q2 = ST.strtoi(argv[++i]);
154 cout << "-q2 " << q2 << endl;
155 }
156 else if (ST.stringcmp(argv[i], "-DDx") == 0) {
157 DELANDTSHEER_DOYEN_X = ST.strtoi(argv[++i]);
158 cout << "-DDx " << DELANDTSHEER_DOYEN_X << endl;
159 }
160 else if (ST.stringcmp(argv[i], "-DDy") == 0) {
161 DELANDTSHEER_DOYEN_Y = ST.strtoi(argv[++i]);
162 cout << "-DDy " << DELANDTSHEER_DOYEN_Y << endl;
163 }
164 else if (ST.stringcmp(argv[i], "-K") == 0) {
165 f_K = TRUE;
166 K = ST.strtoi(argv[++i]);
167 cout << "-K " << K << endl;
168 }
169 else if (ST.stringcmp(argv[i], "-R") == 0) {
170 f_R = TRUE;
171 nb_row_types = ST.strtoi(argv[++i]);
173 row_type[0] = 0;
174 for (j = 1; j <= nb_row_types; j++) {
175 row_type[j] = ST.strtoi(argv[++i]);
176 //row_type_cur[j] = 0;
177 }
178 cout << "-R ";
180 cout << endl;
181 }
182 else if (ST.stringcmp(argv[i], "-C") == 0) {
183 f_C = TRUE;
184 nb_col_types = ST.strtoi(argv[++i]);
186 col_type[0] = 0;
187 for (j = 1; j <= nb_col_types; j++) {
188 col_type[j] = ST.strtoi(argv[++i]);
189 //col_type_cur[j] = 0;
190 }
191 cout << "-C ";
193 cout << endl;
194 }
195 else if (ST.stringcmp(argv[i], "-nb_orbits_on_blocks") == 0) {
197 nb_orbits_on_blocks = ST.strtoi(argv[++i]);
198 cout << "-nb_orbits_on_blocks " << nb_orbits_on_blocks << endl;
199 }
200 else if (ST.stringcmp(argv[i], "-masktest") == 0) {
201 string who;
202 string what;
203
204 mask_test_level[nb_mask_tests] = ST.strtoi(argv[++i]);
205 who.assign(argv[++i]);
206 what.assign(argv[++i]);
207 mask_test_value[nb_mask_tests] = ST.strtoi(argv[++i]);
208
209 if (ST.stringcmp(who, "x") == 0)
211 else if (ST.stringcmp(who, "y") == 0)
213 else if (ST.stringcmp(who, "x+y") == 0)
215 else if (ST.stringcmp(who, "s") == 0)
217 else {
218 cout << "masktest: unknown 'who' option: " << who << endl;
219 cout << "must be one of 'x', 'y', 'x+y' or 's'" << endl;
220 exit(1);
221 }
222 if (ST.stringcmp(what, "eq") == 0)
224 else if (ST.stringcmp(what, "ge") == 0)
226 else if (ST.stringcmp(what, "le") == 0)
228 else {
229 cout << "masktest: unknown 'what' option: " << who << endl;
230 cout << "must be one of 'eq', 'ge' or 'le'" << endl;
231 exit(1);
232 }
233 cout << "-masktest "
237 << mask_test_value[nb_mask_tests] << endl;
239 cout << "nb_mask_tests=" << nb_mask_tests << endl;
240 }
241 else if (ST.stringcmp(argv[i], "-singletons") == 0) {
243 cout << "-singletons" << endl;
244 }
245 else if (ST.stringcmp(argv[i], "-subgroup") == 0) {
247 subgroup_gens.assign(argv[++i]);
248 subgroup_order.assign(argv[++i]);
249 cout << "-subgroup " << subgroup_gens << " " << subgroup_order << endl;
250 }
251 else if (ST.stringcmp(argv[i], "-pair_search_control") == 0) {
254 i += Pair_search_control->read_arguments(argc - (i + 1),
255 argv + i + 1, verbose_level);
256
257 cout << "-pair_search_control" << endl;
258 cout << "i = " << i << endl;
259 cout << "argc = " << argc << endl;
260 if (i < argc) {
261 cout << "next argument is " << argv[i] << endl;
262 }
263 }
264 else if (ST.stringcmp(argv[i], "-search_control") == 0) {
267 i += Search_control->read_arguments(argc - (i + 1),
268 argv + i + 1, verbose_level);
269
270 cout << "-search_control" << endl;
271 cout << "i = " << i << endl;
272 cout << "argc = " << argc << endl;
273 if (i < argc) {
274 cout << "next argument is " << argv[i] << endl;
275 }
276 }
277 else if (ST.stringcmp(argv[i], "-search_wrt_subgroup") == 0) {
279 cout << "-search_wrt_subgroup " << endl;
280 }
281
282 else if (ST.stringcmp(argv[i], "-end") == 0) {
283 cout << "-end" << endl;
284 break;
285 }
286 else {
287 cout << "delandtsheer_doyen_description::read_arguments "
288 "unrecognized option " << argv[i] << endl;
289 }
290 } // next i
291
294 }
295
296 if (!f_search_control) {
298 }
299 if (!f_group_label) {
300 cout << "please use -group_label <label> to specify a label for the group used";
301 exit(1);
302 }
303 if (!f_mask_label) {
304 cout << "please use -mask_label <label> to specify a label for the mask used";
305 exit(1);
306 }
307
308 cout << "delandtsheer_doyen_description::read_arguments done" << endl;
309 return i + 1;
310}
311
313{
314
315 if (f_group_label) {
316 cout << "-group_label " << group_label << endl;
317 }
318 if (f_mask_label) {
319 cout << "-mask_label " << mask_label << endl;
320 }
321 if (f_problem_label) {
322 cout << "-problem_label " << problem_label << endl;
323 }
324 if (f_depth) {
325 cout << "-depth " << depth << endl;
326 }
327 if (f_d1) {
328 cout << "-d1 " << d1 << endl;
329 }
330 if (f_d2) {
331 cout << "-d2 " << d2 << endl;
332 }
333 if (f_q1) {
334 cout << "-q1 " << q1 << endl;
335 }
336 if (f_q2) {
337 cout << "-q2 " << q2 << endl;
338 }
339 cout << "-DDx " << DELANDTSHEER_DOYEN_X << endl;
340 cout << "-DDy " << DELANDTSHEER_DOYEN_Y << endl;
341 if (f_K) {
342 cout << "-K " << K << endl;
343 }
344 if (f_R) {
345 cout << "-R ";
347 cout << endl;
348 }
349 if (f_C) {
350 cout << "-C ";
352 cout << endl;
353 }
355 cout << "-nb_orbits_on_blocks " << nb_orbits_on_blocks << endl;
356 }
357 for (int i = 0; i < nb_mask_tests; i++) {
358 cout << "-masktest "
359 << mask_test_level[i] << " "
360 << mask_test_who[i] << " "
361 << mask_test_what[i] << " "
362 << mask_test_value[i] << endl;
363
364 }
365 if (f_singletons) {
366 cout << "-singletons" << endl;
367 }
368 if (f_subgroup) {
369 cout << "-subgroup " << subgroup_gens << " " << subgroup_order << endl;
370 }
372 cout << "-pair_search_control" << endl;
374 }
375 if (f_search_control) {
376 cout << "-search_control" << endl;
378 }
380 cout << "-search_wrt_subgroup " << endl;
381 }
382
383}
384
385
386
387
388}}}
389
390
functions related to strings and character arrays
to control the behavior of the poset classification algorithm
poset_classification::poset_classification_control * Pair_search_control
poset_classification::poset_classification_control * Search_control
#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
#define Int_vec_print(A, B, C)
Definition: foundations.h:685
the orbiter library for the classification of combinatorial objects