Orbiter 2022
Combinatorial Objects
set_builder_description.cpp
Go to the documentation of this file.
1/*
2 * set_builder_description.cpp
3 *
4 * Created on: Nov 7, 2020
5 * Author: betten
6 */
7
8
9#include "foundations.h"
10
11using namespace std;
12
13
14
15namespace orbiter {
16namespace layer1_foundations {
17namespace data_structures {
18
19
21{
26
30
34
36 Descr = NULL;
37
38 f_here = FALSE;
39 //std::string here_text;
40
41 f_file = FALSE;
42 //std::string file_name;
43
44}
45
47{
48 if (Descr) {
50 }
51}
52
53
55 int argc, std::string *argv,
56 int verbose_level)
57{
58 int i;
59 string_tools ST;
60
61 cout << "set_builder_description::read_arguments" << endl;
62 for (i = 0; i < argc; i++) {
63 if (ST.stringcmp(argv[i], "-loop") == 0) {
65 index_set_loop_low = ST.strtoi(argv[++i]);
66 index_set_loop_upper_bound = ST.strtoi(argv[++i]);
67 index_set_loop_increment = ST.strtoi(argv[++i]);
68 cout << "-loop " << index_set_loop_low << " "
70 << index_set_loop_increment << endl;
71 }
72 else if (ST.stringcmp(argv[i], "-affine_function") == 0) {
74 affine_function_a = ST.strtoi(argv[++i]);
75 affine_function_b = ST.strtoi(argv[++i]);
76 cout << "-affine_function " << affine_function_a << " " << affine_function_b << endl;
77 }
78 else if (ST.stringcmp(argv[i], "-clone_with_affine_function") == 0) {
82 cout << "-clone_with_affine_function " << clone_with_affine_function_a << " " << clone_with_affine_function_b << endl;
83 }
84 else if (ST.stringcmp(argv[i], "-set_builder") == 0) {
87 cout << "reading -set_builder" << endl;
88 i += Descr->read_arguments(argc - (i + 1),
89 argv + i + 1, verbose_level);
90
91 cout << "-set_builder" << endl;
92 cout << "i = " << i << endl;
93 cout << "argc = " << argc << endl;
94 if (i < argc) {
95 cout << "next argument is " << argv[i] << endl;
96 }
97 cout << "-set_builder " << endl;
98 Descr->print();
99 }
100 else if (ST.stringcmp(argv[i], "-here") == 0) {
101 f_here = TRUE;
102 here_text.assign(argv[++i]);
103 cout << "-here " << here_text << endl;
104 }
105 else if (ST.stringcmp(argv[i], "-file") == 0) {
106 f_file = TRUE;
107 file_name.assign(argv[++i]);
108 cout << "-file " << file_name << endl;
109 }
110
111 else if (ST.stringcmp(argv[i], "-end") == 0) {
112 cout << "-end" << endl;
113 break;
114 }
115 else {
116 cout << "set_builder_description::read_arguments "
117 "unrecognized option " << argv[i] << endl;
118 }
119 } // next i
120 cout << "set_builder_description::read_arguments done" << endl;
121 return i + 1;
122}
123
125{
126 cout << "set_builder_description:" << endl;
127 if (f_index_set_loop) {
128 cout << "-index_set_loop " << index_set_loop_low << " "
130 }
131 if (f_affine_function) {
132 cout << "-affine_function " << affine_function_a << " " << affine_function_b << endl;
133 }
135 cout << "-clone_with_affine_function " << clone_with_affine_function_a << " " << clone_with_affine_function_b << endl;
136 }
137 if (f_set_builder) {
138 cout << "-set_builder" << endl;
139 Descr->print();
140 cout << "-end" << endl;
141 }
142 if (f_here) {
143 cout << "-here" << here_text << endl;
144 }
145 if (f_file) {
146 cout << "-file " << file_name << endl;
147 }
148}
149
150
151
152
153}}}
154
155
156
to define a set of integers for class set_builder
int read_arguments(int argc, std::string *argv, int verbose_level)
functions related to strings and character arrays
#define NEW_OBJECT(type)
Definition: foundations.h:638
#define FREE_OBJECT(p)
Definition: foundations.h:651
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
the orbiter library for the classification of combinatorial objects