Orbiter 2022
Combinatorial Objects
dlx_problem_description.cpp
Go to the documentation of this file.
1/*
2 * dlx_problem_description.cpp
3 *
4 * Created on: Jan 12, 2022
5 * Author: betten
6 */
7
8
9
10
11#include "foundations.h"
12
13
14using namespace std;
15
16namespace orbiter {
17namespace layer1_foundations {
18namespace solvers {
19
20
22{
24 //std::string label_txt;
26 //std::string label_tex;
27
29 //std::string data_label;
30
32 data_matrix = NULL;
33 data_matrix_m = 0;
34 data_matrix_n = 0;
35
36
39
42
43}
44
46{
47}
48
50 int argc, std::string *argv,
51 int verbose_level)
52{
53 int f_v = (verbose_level >= 1);
54 int i;
56
57 if (f_v) {
58 cout << "dlx_problem_description::read_arguments" << endl;
59 }
60 for (i = 0; i < argc; i++) {
61
62 if (ST.stringcmp(argv[i], "-label_txt") == 0) {
64 label_txt.assign(argv[++i]);
65 if (f_v) {
66 cout << "-label_txt " << label_txt << endl;
67 }
68 }
69 else if (ST.stringcmp(argv[i], "-label_tex") == 0) {
71 label_tex.assign(argv[++i]);
72 if (f_v) {
73 cout << "-label_tex " << label_tex << endl;
74 }
75 }
76 else if (ST.stringcmp(argv[i], "-data_label") == 0) {
78 data_label.assign(argv[++i]);
79 if (f_v) {
80 cout << "-data_label " << data_label << endl;
81 }
82 }
83 else if (ST.stringcmp(argv[i], "-write_solutions") == 0) {
85 if (f_v) {
86 cout << "-write_solutions " << endl;
87 }
88 }
89 else if (ST.stringcmp(argv[i], "-write_tree") == 0) {
91 if (f_v) {
92 cout << "-write_tree " << endl;
93 }
94 }
95 else if (ST.stringcmp(argv[i], "-tracking_depth") == 0) {
97 tracking_depth = ST.strtoi(argv[++i]);
98 if (f_v) {
99 cout << "-tracking_depth " << tracking_depth << endl;
100 }
101 }
102 else if (ST.stringcmp(argv[i], "-end") == 0) {
103 break;
104 }
105 else {
106 cout << "dlx_problem_description::read_arguments "
107 "unrecognized option " << argv[i] << endl;
108 exit(1);
109 }
110 } // next i
111 if (f_v) {
112 cout << "dlx_problem_description::read_arguments done" << endl;
113 }
114 return i + 1;
115}
116
118{
119 if (f_label_txt) {
120 cout << "-label_txt " << label_txt << endl;
121 }
122 if (f_label_tex) {
123 cout << "-label_tex " << label_tex << endl;
124 }
125 if (f_data_label) {
126 cout << "-data_label " << data_label << endl;
127 }
128 if (f_data_matrix) {
129 cout << "-data_matrix of size " << data_matrix_m << " x " << data_matrix_n << endl;
130 }
131 if (f_write_solutions) {
132 cout << "-write_solutions " << endl;
133 }
134 if (f_write_tree) {
135 cout << "-write_tree " << endl;
136 }
137 if (f_tracking_depth) {
138 cout << "-tracking_depth " << tracking_depth << endl;
139 }
140}
141
142
143
144}}}
145
146
147
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