Orbiter 2022
Combinatorial Objects
diophant_description.cpp
Go to the documentation of this file.
1/*
2 * diophant_description.cpp
3 *
4 * Created on: May 28, 2020
5 * Author: betten
6 */
7
8
9
10#include "foundations.h"
11
12
13using namespace std;
14
15namespace orbiter {
16namespace layer1_foundations {
17namespace solvers {
18
19
20
22{
23 f_q = FALSE;
24 input_q = 0;
26 //override_polynomial;
27 //F = NULL;
28
31 maximal_arc_d = 0;
32 //maximal_arc_secants_text;
33 //external_lines_as_subset_of_secants_text;
34
35 f_label = FALSE;
36 //label = NULL;
37 //from_scratch_m = 0;
38 //from_scratch_n = 0;
39
43 //coefficient_matrix_text;
44
47 //std::string problem_of_Steiner_type_covering_matrix_fname;
48
50 //coefficient_matrix_csv;
51
53 //RHS_constant_text;
54
55
56 f_RHS = FALSE;
57 //RHS_text;
58
60 //RHS_csv_text;
61
63 x_max_global = 0;
64
66 x_min_global = 0;
67
69 //x_bounds_text;
70
72 //x_bounds_csv;
73
75 has_sum = 0;
76}
77
78
80{
81}
82
84 int argc, std::string *argv,
85 int verbose_level)
86{
87 int f_v = (verbose_level >= 1);
88 int i;
90
91 if (f_v) {
92 cout << "diophant_description::read_arguments" << endl;
93 }
94 for (i = 0; i < argc; i++) {
95
96
97 if (ST.stringcmp(argv[i], "-maximal_arc") == 0) {
99 maximal_arc_sz = ST.strtoi(argv[++i]);
100 maximal_arc_d = ST.strtoi(argv[++i]);
101 maximal_arc_secants_text.assign(argv[++i]);
103 if (f_v) {
104 cout << "-maximal_arc " << maximal_arc_sz << " " << maximal_arc_d
107 }
108 }
109 else if (ST.stringcmp(argv[i], "-label") == 0) {
110 f_label = TRUE;
111 label.assign(argv[++i]);
112 if (f_v) {
113 cout << "-label " << label << endl;
114 }
115 }
116 else if (ST.stringcmp(argv[i], "-coefficient_matrix") == 0) {
118 coefficient_matrix_m = ST.strtoi(argv[++i]);
119 coefficient_matrix_n = ST.strtoi(argv[++i]);
120 coefficient_matrix_text.assign(argv[++i]);
121 if (f_v) {
122 cout << "-coefficient_matrix " << coefficient_matrix_m << " "
124 }
125 }
126 else if (ST.stringcmp(argv[i], "-problem_of_Steiner_type") == 0) {
130 if (f_v) {
131 cout << "-problem_of_Steiner_type " << problem_of_Steiner_type_nb_t_orbits
133 }
134 }
135
136 else if (ST.stringcmp(argv[i], "-coefficient_matrix_csv") == 0) {
138 coefficient_matrix_csv.assign(argv[++i]);
139 if (f_v) {
140 cout << "-coefficient_matrix_csv " << coefficient_matrix_csv << endl;
141 }
142 }
143 else if (ST.stringcmp(argv[i], "-RHS") == 0) {
144 f_RHS = TRUE;
145 RHS_text.assign(argv[++i]);
146 if (f_v) {
147 cout << "-RHS " << RHS_text << endl;
148 }
149 }
150 else if (ST.stringcmp(argv[i], "-RHS_csv") == 0) {
151 f_RHS_csv = TRUE;
152 RHS_csv_text.assign(argv[++i]);
153 if (f_v) {
154 cout << "-RHS_csv " << RHS_csv_text << endl;
155 }
156 }
157 else if (ST.stringcmp(argv[i], "-RHS_constant") == 0) {
159 RHS_constant_text.assign(argv[++i]);
160 if (f_v) {
161 cout << "-RHS_constant " << RHS_constant_text << endl;
162 }
163 }
164 else if (ST.stringcmp(argv[i], "-x_max_global") == 0) {
166 x_max_global = ST.strtoi(argv[++i]);
167 if (f_v) {
168 cout << "-x_max_global " << x_max_global << endl;
169 }
170 }
171 else if (ST.stringcmp(argv[i], "-x_min_global") == 0) {
173 x_min_global = ST.strtoi(argv[++i]);
174 if (f_v) {
175 cout << "-x_min_global " << x_min_global << endl;
176 }
177 }
178 else if (ST.stringcmp(argv[i], "-x_bounds") == 0) {
180 x_bounds_text.assign(argv[++i]);
181 if (f_v) {
182 cout << "-x_bounds " << x_bounds_text << endl;
183 }
184 }
185 else if (ST.stringcmp(argv[i], "-x_bounds_csv") == 0) {
187 x_bounds_csv.assign(argv[++i]);
188 if (f_v) {
189 cout << "-x_bounds_csv " << x_bounds_csv << endl;
190 }
191 }
192 else if (ST.stringcmp(argv[i], "-has_sum") == 0) {
193 f_has_sum = TRUE;
194 has_sum = ST.strtoi(argv[++i]);
195 if (f_v) {
196 cout << "-has_sum " << has_sum << endl;
197 }
198 }
199 else if (ST.stringcmp(argv[i], "-q") == 0) {
200 f_q = TRUE;
201 input_q = ST.strtoi(argv[++i]);
202 if (f_v) {
203 cout << "-q" << input_q << endl;
204 }
205 }
206 else if (ST.stringcmp(argv[i], "-override_polynomial") == 0) {
208 override_polynomial.assign(argv[++i]);
209 if (f_v) {
210 cout << "-override_polynomial" << override_polynomial << endl;
211 }
212 }
213 else if (ST.stringcmp(argv[i], "-end") == 0) {
214 if (f_v) {
215 cout << "-end" << endl;
216 }
217 break;
218 }
219 else {
220 cout << "diophant_description::read_arguments "
221 "unrecognized option " << argv[i] << endl;
222 exit(1);
223 }
224 } // next i
225 if (f_v) {
226 cout << "diophant_description::read_arguments done" << endl;
227 }
228 return i + 1;
229}
230
231
233{
234 if (f_maximal_arc) {
235 cout << "-maximal_arc " << maximal_arc_sz << " " << maximal_arc_d
238 }
239 if (f_label) {
240 cout << "-label " << label << endl;
241 }
243 cout << "-coefficient_matrix " << coefficient_matrix_m << " "
245 }
247 cout << "-problem_of_Steiner_type " << problem_of_Steiner_type_nb_t_orbits
249 }
250
252 cout << "-coefficient_matrix_csv " << coefficient_matrix_csv << endl;
253 }
254 if (f_RHS) {
255 cout << "-RHS " << RHS_text << endl;
256 }
257 if (f_RHS_csv) {
258 cout << "-RHS_csv " << RHS_csv_text << endl;
259 }
260 if (f_RHS_constant) {
261 cout << "-RHS_constant " << RHS_constant_text << endl;
262 }
263 if (f_x_max_global) {
264 cout << "-x_max_global " << x_max_global << endl;
265 }
266 if (f_x_min_global) {
267 cout << "-x_min_global " << x_min_global << endl;
268 }
269 if (f_x_bounds) {
270 cout << "-x_bounds " << x_bounds_text << endl;
271 }
272 if (f_x_bounds_csv) {
273 cout << "-x_bounds_csv " << x_bounds_csv << endl;
274 }
275 if (f_has_sum) {
276 cout << "-has_sum " << has_sum << endl;
277 }
278 if (f_q) {
279 cout << "-q" << input_q << endl;
280 }
282 cout << "-override_polynomial" << override_polynomial << endl;
283 }
284}
285
286
287}}}
288
functions related to strings and character arrays
int read_arguments(int argc, std::string *argv, int verbose_level)
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
the orbiter library for the classification of combinatorial objects