Orbiter 2022
Combinatorial Objects
design_parameter_source.cpp
Go to the documentation of this file.
1// design_parameter_source.cpp
2//
3// Anton Betten
4// 18.09.2000
5// moved from D2 to ORBI Nov 15, 2007
6
8#include "discreta.h"
9
10using namespace std;
11
12
13namespace orbiter {
14namespace layer2_discreta {
15
16
18{
20}
21
23 // copy constructor: this := x
24{
25 cout << "design_parameter_source::copy constructor for object: "
26 << const_cast<discreta_base &>(x) << "\n";
27 const_cast<discreta_base &>(x).copyobject_to(*this);
28}
29
31 // copy assignment
32{
33 cout << "design_parameter_source::operator = (copy assignment)" << endl;
34 copyobject(const_cast<discreta_base &>(x));
35 return *this;
36}
37
39{
40 OBJECTSELF s;
41
42 s = self;
44 self = s;
46}
47
49{
51}
52
54{
55 // cout << "group_selection::freeself_design_parameter_source()\n";
57}
58
60{
62}
63
65{
66#ifdef COPY_VERBOSE
67 cout << "design_parameter_source::copyobject_to()\n";
68 print_as_vector(cout);
69#endif
72#ifdef COPY_VERBOSE
73 x.as_design_parameter_source().print_as_vector(cout);
74#endif
75}
76
77ostream& design_parameter_source::print(ostream& ost)
78{
79 hollerith h;
80
81 text(h);
82 ost << h.s();
83 return ost;
84}
85
87{
88 hollerith h;
89
90 text2(p, h);
91 ost << h.s();
92}
93
95{
96 m_l_n(4);
98 prev() = -1;
99 rule() = -1;
102 comment().init("");
103 references().m_l(0);
104}
105
106
108{
109 hollerith s0, s1, s2;
110
111 text012(s0, s1, s2);
112 h.init(s1.s());
113 h.append(" ");
114 if (prev() != -1) {
115 h.append_i(prev());
116 h.append(" ");
117 }
118 h.append(s2.s());
119}
120
122{
123 hollerith s0, s1, s2, hh;
124
125 text012_extended(p, s0, s1, s2);
126 h.init(s1.s());
127 h.append(" ");
128 if (prev() != -1) {
129 h.append_i(prev());
130 h.append(" ");
131 }
132 h.append(s2.s());
133}
134
136//special print function for the design construction strings:
137//three strings are generated which give parts of an english sentence.
138//The wholes between the strings may be filled with numbers (ids) of
139//parameter sets. In the html page writing routines, these numbers
140//are printed using htmls capability of including links directly to
141//the definition of the other parameter set.
142{
144
145 s0.init("");
146 s1.init("");
147 s2.init("");
148 if (strlen(comment().s()) > 0) {
149 s1.init(comment().s());
150 s1.append(" ");
151 }
152 r = (enum design_parameter_rule) rule();
153 if (r == rule_complementary) {
154 s1.append("complementary design of");
155 }
156 else if (r == rule_reduced_t) {
157 s1.append("design");
158 s2.init("with respect to smaller t");
159 }
160 else if (r == rule_derived) {
161 s1.append("derived from");
162 }
163 else if (r == rule_residual) {
164 s1.append("residual design of");
165 }
166 else if (r == rule_alltop) {
167 s1.append("Alltop construction for design");
168 }
169 else if (r == rule_supplementary) {
170 s1.append("supplementary design of");
171 }
172 else if (r == rule_trung_complementary) {
173 s1.append("Tran van Trung construction with complementary design for");
174 }
175 else if (r == rule_supplementary_reduced_t) {
176 s1.append("supplementary design of");
177 s2.init("with respect to smaller t");
178 }
179 else if (r == rule_supplementary_derived) {
180 s1.append("derived from supplementary of");
181 }
182 else if (r == rule_supplementary_residual) {
183 s1.append("residual design of supplementary of");
184 }
185 else if (r == rule_supplementary_alltop) {
186 s1.append("Alltop construction for supplementary design of");
187 }
188 else if (r == rule_trung_left) {
189 s1.append("Tran van Trung construction (left) for");
190 }
191 else if (r == rule_trung_right) {
192 s1.append("Tran van Trung construction (right) for");
193 }
194 else {
195 }
196}
197
198
200{
201 hollerith hh;
202
203 text012(s0, s1, s2);
204
205
207 r = (enum design_parameter_rule) rule();
208 if (r == rule_trung_left) {
209 design_parameter q, der, res;
210
211 if (!p.increased_t(q)) {
212 cout << "design_parameter_source::text012_extended() cannot increase t, error" << endl;
213 exit(1);
214 }
215 q.derived(der);
216 q.residual(res);
217 s2.init(": der= ");
218 s2.append_i(der.t());
219 s2.append("-(");
220 s2.append_i(der.v());
221 s2.append(",");
222 s2.append_i(der.K());
223 s2.append(",");
224 der.lambda().print_to_hollerith(hh);
225 s2.append(hh.s());
226 s2.append(") and res= ");
227 s2.append_i(res.t());
228 s2.append("-(");
229 s2.append_i(res.v());
230 s2.append(",");
231 s2.append_i(res.K());
232 s2.append(",");
233 res.lambda().print_to_hollerith(hh);
234 s2.append(hh.s());
235 s2.append(") - the given design is the residual.");
236 }
237 else if (r == rule_trung_right) {
238 design_parameter q, der, res;
239
240 if (!p.increased_t(q)) {
241 cout << "design_parameter_source::text012_extended() cannot increase t, error" << endl;
242 exit(1);
243 }
244 q.derived(der);
245 q.residual(res);
246 s2.init(": der= ");
247 s2.append_i(der.t());
248 s2.append("-(");
249 s2.append_i(der.v());
250 s2.append(",");
251 s2.append_i(der.K());
252 s2.append(",");
253 der.lambda().print_to_hollerith(hh);
254 s2.append(hh.s());
255 s2.append(") and res= ");
256 s2.append_i(res.t());
257 s2.append("-(");
258 s2.append_i(res.v());
259 s2.append(",");
260 s2.append_i(res.K());
261 s2.append(",");
262 res.lambda().print_to_hollerith(hh);
263 s2.append(hh.s());
264 s2.append(") - the given design is the derived.");
265 }
266}
267
268
269
270}}
271
272
273
274
275
276
277
278
DISCRETA vector class for vectors of DISCRETA objects.
Definition: discreta.h:797
discreta_base & s_i(int i)
Definition: vector.cpp:202
void copyobject_to(discreta_base &x)
Definition: vector.cpp:72
DISCRETA class for the design parameters database.
Definition: discreta.h:1887
void text012(hollerith &s0, hollerith &s1, hollerith &s2)
void print2(design_parameter &p, std::ostream &ost)
void text012_extended(design_parameter &p, hollerith &s0, hollerith &s1, hollerith &s2)
design_parameter_source & operator=(const discreta_base &x)
DISCRETA class for design parameters.
Definition: discreta.h:1958
DISCRETA base class. All DISCRETA classes are derived from this class.
Definition: discreta.h:382
design_parameter_source & as_design_parameter_source()
Definition: discreta.h:416
void copyobject(discreta_base &x)
Definition: base.cpp:194
void print_to_hollerith(hollerith &h)
Definition: base.cpp:231
DISCRETA string class.
Definition: discreta.h:626
@ DESIGN_PARAMETER_SOURCE
DESIGN_PARAMETER_SOURCE.
Definition: discreta.h:86
the orbiter library for the classification of combinatorial objects
DISCRETA internal class.
Definition: discreta.h:353