[Ofer Meshi] Added a script to convert from FastInf fileformat to libDAI fileformat
[libdai.git] / tests / unit / smallset_test.cpp
1 /* This file is part of libDAI - http://www.libdai.org/
2 *
3 * libDAI is licensed under the terms of the GNU General Public License version
4 * 2, or (at your option) any later version. libDAI is distributed without any
5 * warranty. See the file COPYING for more details.
6 *
7 * Copyright (C) 2010 Joris Mooij [joris dot mooij at libdai dot org]
8 */
9
10
11 #include <dai/smallset.h>
12 #include <vector>
13
14
15 using namespace dai;
16
17
18 #define BOOST_TEST_MODULE SmallSetTest
19
20
21 #include <boost/test/unit_test.hpp>
22
23
24 BOOST_AUTO_TEST_CASE( ConstructorsTest ) {
25 // check constructors
26 SmallSet<int> x;
27 BOOST_CHECK( x.empty() );
28 BOOST_CHECK_EQUAL( x.size(), 0 );
29 BOOST_CHECK( !x.contains( 5 ) );
30
31 SmallSet<int> y( 1 );
32 BOOST_CHECK( !y.empty() );
33 BOOST_CHECK_EQUAL( y.size(), 1 );
34 BOOST_CHECK( !y.contains( 5 ) );
35 BOOST_CHECK( y.contains( 1 ) );
36
37 SmallSet<size_t> u( 0, 1 );
38 BOOST_CHECK( !u.empty() );
39 BOOST_CHECK_EQUAL( u.size(), 2 );
40 BOOST_CHECK( !u.contains( 2 ) );
41 BOOST_CHECK( u.contains( 1 ) );
42 BOOST_CHECK( u.contains( 0 ) );
43
44 SmallSet<double> z( 1.0, 2.0 );
45 BOOST_CHECK_EQUAL( z.size(), 2 );
46 BOOST_CHECK( !z.contains( 5.0 ) );
47 BOOST_CHECK( z.contains( 1.0 ) );
48 BOOST_CHECK( z.contains( 2.0 ) );
49
50 SmallSet<char> v( 'a', 'a' );
51 BOOST_CHECK_EQUAL( v.size(), 1 );
52 BOOST_CHECK( v.contains( 'a' ) );
53 BOOST_CHECK( !v.contains( 'b' ) );
54
55 std::vector<int> a;
56 a.push_back( 1 );
57 a.push_back( 3 );
58 a.push_back( 4 );
59 a.push_back( 3 );
60 a.push_back( 2 );
61 SmallSet<double> w( a.begin(), a.end(), a.size() );
62 BOOST_CHECK_EQUAL( w.size(), 4 );
63 BOOST_CHECK( w.contains( 1 ) );
64 BOOST_CHECK( w.contains( 2 ) );
65 BOOST_CHECK( w.contains( 3 ) );
66 BOOST_CHECK( w.contains( 4 ) );
67 BOOST_CHECK( !w.contains( 0 ) );
68
69 x = y;
70 BOOST_CHECK( x == y );
71 }
72
73
74 BOOST_AUTO_TEST_CASE( ComparisonTest ) {
75 // check comparison operators
76 SmallSet<int> x, y;
77 BOOST_CHECK( x == y );
78 BOOST_CHECK( !(x != y) );
79
80 SmallSet<int> z( 1 );
81 BOOST_CHECK( x != z );
82 BOOST_CHECK( !(x == z) );
83
84 BOOST_CHECK( x < z );
85
86 SmallSet<int> u( 2 );
87 BOOST_CHECK( x < u );
88 BOOST_CHECK( z < u );
89 BOOST_CHECK( !(u < z) );
90
91 SmallSet<int> v( 2, 1 );
92 BOOST_CHECK( x < v );
93 BOOST_CHECK( z < v );
94 BOOST_CHECK( !(v < z) );
95 BOOST_CHECK( v < u );
96 BOOST_CHECK( !(u < v) );
97
98 SmallSet<int> w( 1, 3 );
99 BOOST_CHECK( x < w );
100 BOOST_CHECK( v < w );
101 BOOST_CHECK( z < w );
102 BOOST_CHECK( w < u );
103 BOOST_CHECK( !(w < x) );
104 BOOST_CHECK( !(w < v) );
105 BOOST_CHECK( !(w < z) );
106 BOOST_CHECK( !(u < w) );
107 }
108
109
110 BOOST_AUTO_TEST_CASE( IteratorTest ) {
111 // check iterator interface
112 std::vector<int> v;
113 v.push_back( 3 );
114 v.push_back( 2 );
115 v.push_back( 2 );
116 v.push_back( 1 );
117 v.push_back( 3 );
118 SmallSet<int> x( v.begin(), v.end(), v.size() );
119
120 BOOST_CHECK( x.begin() != x.end() );
121 BOOST_CHECK( x.rbegin() != x.rend() );
122
123 BOOST_CHECK_EQUAL( x.front(), 1 );
124 BOOST_CHECK_EQUAL( x.back(), 3 );
125
126 SmallSet<int>::const_iterator j = x.begin();
127 SmallSet<int>::iterator k = x.begin();
128 for( size_t i = 1; i < 4; i++, j++, k++ ) {
129 BOOST_CHECK_EQUAL( i, *j );
130 BOOST_CHECK_EQUAL( i, *k );
131 }
132 BOOST_CHECK( j == x.end() );
133 BOOST_CHECK( k == x.end() );
134
135 SmallSet<int>::const_reverse_iterator rj = x.rbegin();
136 SmallSet<int>::reverse_iterator rk = x.rbegin();
137 for( size_t i = 3; i > 0; i--, rj++, rk++ ) {
138 BOOST_CHECK_EQUAL( i, *rj );
139 BOOST_CHECK_EQUAL( i, *rk );
140 }
141 BOOST_CHECK( rj == x.rend() );
142 BOOST_CHECK( rk == x.rend() );
143 }
144
145
146 BOOST_AUTO_TEST_CASE( QueriesTest ) {
147 // check queries
148 SmallSet<int> x( 2, 1 );
149 SmallSet<int> y( 2, 3 );
150 SmallSet<int> z( 4, 3 );
151
152 BOOST_CHECK( x.intersects( y ) );
153 BOOST_CHECK( !x.intersects( z ) );
154 BOOST_CHECK( y.intersects( x ) );
155 BOOST_CHECK( y.intersects( z ) );
156 BOOST_CHECK( !z.intersects( x ) );
157 BOOST_CHECK( z.intersects( y ) );
158
159 BOOST_CHECK( x.contains( 1 ) );
160 BOOST_CHECK( x.contains( 2 ) );
161 BOOST_CHECK( !x.contains( 3 ) );
162 BOOST_CHECK( !x.contains( 4 ) );
163 BOOST_CHECK( !y.contains( 1 ) );
164 BOOST_CHECK( y.contains( 2 ) );
165 BOOST_CHECK( y.contains( 3 ) );
166 BOOST_CHECK( !y.contains( 4 ) );
167 BOOST_CHECK( !z.contains( 1 ) );
168 BOOST_CHECK( !z.contains( 2 ) );
169 BOOST_CHECK( z.contains( 3 ) );
170 BOOST_CHECK( z.contains( 4 ) );
171
172 BOOST_CHECK_EQUAL( x.size(), 2 );
173
174 BOOST_CHECK( !x.empty() );
175
176 x.elements()[0] = 3;
177 x.elements()[1] = 4;
178 std::vector<int> v;
179 v.push_back( 3 );
180 v.push_back( 4 );
181 BOOST_CHECK( x.elements() == v );
182 }
183
184
185 BOOST_AUTO_TEST_CASE( OperatorTest ) {
186 // check operators
187 SmallSet<int> x;
188 SmallSet<int> x1( 1 );
189 SmallSet<int> x2( 2 );
190 SmallSet<int> x3( 3 );
191 SmallSet<int> x12( 2, 1 );
192 SmallSet<int> x23( 2, 3 );
193 SmallSet<int> x13( 1, 3 );
194 SmallSet<int> x123 = x12 | 3;
195 SmallSet<int> y;
196
197 // check operator/
198 BOOST_CHECK_EQUAL( x / x, x );
199 BOOST_CHECK_EQUAL( x / x1, x );
200 BOOST_CHECK_EQUAL( x / x2, x );
201 BOOST_CHECK_EQUAL( x / x3, x );
202 BOOST_CHECK_EQUAL( x / x12, x );
203 BOOST_CHECK_EQUAL( x / x23, x );
204 BOOST_CHECK_EQUAL( x / x13, x );
205 BOOST_CHECK_EQUAL( x / x123, x );
206 BOOST_CHECK_EQUAL( x1 / x, x1 );
207 BOOST_CHECK_EQUAL( x1 / x1, x );
208 BOOST_CHECK_EQUAL( x1 / x2, x1 );
209 BOOST_CHECK_EQUAL( x1 / x3, x1 );
210 BOOST_CHECK_EQUAL( x1 / x12, x );
211 BOOST_CHECK_EQUAL( x1 / x23, x1 );
212 BOOST_CHECK_EQUAL( x1 / x13, x );
213 BOOST_CHECK_EQUAL( x1 / x123, x );
214 BOOST_CHECK_EQUAL( x2 / x, x2 );
215 BOOST_CHECK_EQUAL( x2 / x1, x2 );
216 BOOST_CHECK_EQUAL( x2 / x2, x );
217 BOOST_CHECK_EQUAL( x2 / x3, x2 );
218 BOOST_CHECK_EQUAL( x2 / x12, x );
219 BOOST_CHECK_EQUAL( x2 / x23, x );
220 BOOST_CHECK_EQUAL( x2 / x13, x2 );
221 BOOST_CHECK_EQUAL( x2 / x123, x );
222 BOOST_CHECK_EQUAL( x3 / x, x3 );
223 BOOST_CHECK_EQUAL( x3 / x1, x3 );
224 BOOST_CHECK_EQUAL( x3 / x2, x3 );
225 BOOST_CHECK_EQUAL( x3 / x3, x );
226 BOOST_CHECK_EQUAL( x3 / x12, x3 );
227 BOOST_CHECK_EQUAL( x3 / x23, x );
228 BOOST_CHECK_EQUAL( x3 / x13, x );
229 BOOST_CHECK_EQUAL( x3 / x123, x );
230 BOOST_CHECK_EQUAL( x12 / x, x12 );
231 BOOST_CHECK_EQUAL( x12 / x1, x2 );
232 BOOST_CHECK_EQUAL( x12 / x2, x1 );
233 BOOST_CHECK_EQUAL( x12 / x3, x12 );
234 BOOST_CHECK_EQUAL( x12 / x12, x );
235 BOOST_CHECK_EQUAL( x12 / x23, x1 );
236 BOOST_CHECK_EQUAL( x12 / x13, x2 );
237 BOOST_CHECK_EQUAL( x12 / x123, x );
238 BOOST_CHECK_EQUAL( x23 / x, x23 );
239 BOOST_CHECK_EQUAL( x23 / x1, x23 );
240 BOOST_CHECK_EQUAL( x23 / x2, x3 );
241 BOOST_CHECK_EQUAL( x23 / x3, x2 );
242 BOOST_CHECK_EQUAL( x23 / x12, x3 );
243 BOOST_CHECK_EQUAL( x23 / x23, x );
244 BOOST_CHECK_EQUAL( x23 / x13, x2 );
245 BOOST_CHECK_EQUAL( x23 / x123, x );
246 BOOST_CHECK_EQUAL( x13 / x, x13 );
247 BOOST_CHECK_EQUAL( x13 / x1, x3 );
248 BOOST_CHECK_EQUAL( x13 / x2, x13 );
249 BOOST_CHECK_EQUAL( x13 / x3, x1 );
250 BOOST_CHECK_EQUAL( x13 / x12, x3 );
251 BOOST_CHECK_EQUAL( x13 / x23, x1 );
252 BOOST_CHECK_EQUAL( x13 / x13, x );
253 BOOST_CHECK_EQUAL( x13 / x123, x );
254 BOOST_CHECK_EQUAL( x123 / x, x123 );
255 BOOST_CHECK_EQUAL( x123 / x1, x23 );
256 BOOST_CHECK_EQUAL( x123 / x2, x13 );
257 BOOST_CHECK_EQUAL( x123 / x3, x12 );
258 BOOST_CHECK_EQUAL( x123 / x12, x3 );
259 BOOST_CHECK_EQUAL( x123 / x23, x1 );
260 BOOST_CHECK_EQUAL( x123 / x13, x2 );
261 BOOST_CHECK_EQUAL( x123 / x123, x );
262
263 // check operator|
264 BOOST_CHECK_EQUAL( x | x, x );
265 BOOST_CHECK_EQUAL( x | x1, x1 );
266 BOOST_CHECK_EQUAL( x | x2, x2 );
267 BOOST_CHECK_EQUAL( x | x3, x3 );
268 BOOST_CHECK_EQUAL( x | x12, x12 );
269 BOOST_CHECK_EQUAL( x | x23, x23 );
270 BOOST_CHECK_EQUAL( x | x13, x13 );
271 BOOST_CHECK_EQUAL( x | x123, x123 );
272 BOOST_CHECK_EQUAL( x1 | x, x1 );
273 BOOST_CHECK_EQUAL( x1 | x1, x1 );
274 BOOST_CHECK_EQUAL( x1 | x2, x12 );
275 BOOST_CHECK_EQUAL( x1 | x3, x13 );
276 BOOST_CHECK_EQUAL( x1 | x12, x12 );
277 BOOST_CHECK_EQUAL( x1 | x23, x123 );
278 BOOST_CHECK_EQUAL( x1 | x13, x13 );
279 BOOST_CHECK_EQUAL( x1 | x123, x123 );
280 BOOST_CHECK_EQUAL( x2 | x, x2 );
281 BOOST_CHECK_EQUAL( x2 | x1, x12 );
282 BOOST_CHECK_EQUAL( x2 | x2, x2 );
283 BOOST_CHECK_EQUAL( x2 | x3, x23 );
284 BOOST_CHECK_EQUAL( x2 | x12, x12 );
285 BOOST_CHECK_EQUAL( x2 | x23, x23 );
286 BOOST_CHECK_EQUAL( x2 | x13, x123 );
287 BOOST_CHECK_EQUAL( x2 | x123, x123 );
288 BOOST_CHECK_EQUAL( x3 | x, x3 );
289 BOOST_CHECK_EQUAL( x3 | x1, x13 );
290 BOOST_CHECK_EQUAL( x3 | x2, x23 );
291 BOOST_CHECK_EQUAL( x3 | x3, x3 );
292 BOOST_CHECK_EQUAL( x3 | x12, x123 );
293 BOOST_CHECK_EQUAL( x3 | x23, x23 );
294 BOOST_CHECK_EQUAL( x3 | x13, x13 );
295 BOOST_CHECK_EQUAL( x3 | x123, x123 );
296 BOOST_CHECK_EQUAL( x12 | x, x12 );
297 BOOST_CHECK_EQUAL( x12 | x1, x12 );
298 BOOST_CHECK_EQUAL( x12 | x2, x12 );
299 BOOST_CHECK_EQUAL( x12 | x3, x123 );
300 BOOST_CHECK_EQUAL( x12 | x12, x12 );
301 BOOST_CHECK_EQUAL( x12 | x23, x123 );
302 BOOST_CHECK_EQUAL( x12 | x13, x123 );
303 BOOST_CHECK_EQUAL( x12 | x123, x123 );
304 BOOST_CHECK_EQUAL( x23 | x, x23 );
305 BOOST_CHECK_EQUAL( x23 | x1, x123 );
306 BOOST_CHECK_EQUAL( x23 | x2, x23 );
307 BOOST_CHECK_EQUAL( x23 | x3, x23 );
308 BOOST_CHECK_EQUAL( x23 | x12, x123 );
309 BOOST_CHECK_EQUAL( x23 | x23, x23 );
310 BOOST_CHECK_EQUAL( x23 | x13, x123 );
311 BOOST_CHECK_EQUAL( x23 | x123, x123 );
312 BOOST_CHECK_EQUAL( x13 | x, x13 );
313 BOOST_CHECK_EQUAL( x13 | x1, x13 );
314 BOOST_CHECK_EQUAL( x13 | x2, x123 );
315 BOOST_CHECK_EQUAL( x13 | x3, x13 );
316 BOOST_CHECK_EQUAL( x13 | x12, x123 );
317 BOOST_CHECK_EQUAL( x13 | x23, x123 );
318 BOOST_CHECK_EQUAL( x13 | x13, x13 );
319 BOOST_CHECK_EQUAL( x13 | x123, x123 );
320 BOOST_CHECK_EQUAL( x123 | x, x123 );
321 BOOST_CHECK_EQUAL( x123 | x1, x123 );
322 BOOST_CHECK_EQUAL( x123 | x2, x123 );
323 BOOST_CHECK_EQUAL( x123 | x3, x123 );
324 BOOST_CHECK_EQUAL( x123 | x12, x123 );
325 BOOST_CHECK_EQUAL( x123 | x23, x123 );
326 BOOST_CHECK_EQUAL( x123 | x13, x123 );
327 BOOST_CHECK_EQUAL( x123 | x123, x123 );
328
329 // check operator&
330 BOOST_CHECK_EQUAL( x & x, x );
331 BOOST_CHECK_EQUAL( x & x1, x );
332 BOOST_CHECK_EQUAL( x & x2, x );
333 BOOST_CHECK_EQUAL( x & x3, x );
334 BOOST_CHECK_EQUAL( x & x12, x );
335 BOOST_CHECK_EQUAL( x & x23, x );
336 BOOST_CHECK_EQUAL( x & x13, x );
337 BOOST_CHECK_EQUAL( x & x123, x );
338 BOOST_CHECK_EQUAL( x1 & x, x );
339 BOOST_CHECK_EQUAL( x1 & x1, x1 );
340 BOOST_CHECK_EQUAL( x1 & x2, x );
341 BOOST_CHECK_EQUAL( x1 & x3, x );
342 BOOST_CHECK_EQUAL( x1 & x12, x1 );
343 BOOST_CHECK_EQUAL( x1 & x23, x );
344 BOOST_CHECK_EQUAL( x1 & x13, x1 );
345 BOOST_CHECK_EQUAL( x1 & x123, x1 );
346 BOOST_CHECK_EQUAL( x2 & x, x );
347 BOOST_CHECK_EQUAL( x2 & x1, x );
348 BOOST_CHECK_EQUAL( x2 & x2, x2 );
349 BOOST_CHECK_EQUAL( x2 & x3, x );
350 BOOST_CHECK_EQUAL( x2 & x12, x2 );
351 BOOST_CHECK_EQUAL( x2 & x23, x2 );
352 BOOST_CHECK_EQUAL( x2 & x13, x );
353 BOOST_CHECK_EQUAL( x2 & x123, x2 );
354 BOOST_CHECK_EQUAL( x3 & x, x );
355 BOOST_CHECK_EQUAL( x3 & x1, x );
356 BOOST_CHECK_EQUAL( x3 & x2, x );
357 BOOST_CHECK_EQUAL( x3 & x3, x3 );
358 BOOST_CHECK_EQUAL( x3 & x12, x );
359 BOOST_CHECK_EQUAL( x3 & x23, x3 );
360 BOOST_CHECK_EQUAL( x3 & x13, x3 );
361 BOOST_CHECK_EQUAL( x3 & x123, x3 );
362 BOOST_CHECK_EQUAL( x12 & x, x );
363 BOOST_CHECK_EQUAL( x12 & x1, x1 );
364 BOOST_CHECK_EQUAL( x12 & x2, x2 );
365 BOOST_CHECK_EQUAL( x12 & x3, x );
366 BOOST_CHECK_EQUAL( x12 & x12, x12 );
367 BOOST_CHECK_EQUAL( x12 & x23, x2 );
368 BOOST_CHECK_EQUAL( x12 & x13, x1 );
369 BOOST_CHECK_EQUAL( x12 & x123, x12 );
370 BOOST_CHECK_EQUAL( x23 & x, x );
371 BOOST_CHECK_EQUAL( x23 & x1, x );
372 BOOST_CHECK_EQUAL( x23 & x2, x2 );
373 BOOST_CHECK_EQUAL( x23 & x3, x3 );
374 BOOST_CHECK_EQUAL( x23 & x12, x2 );
375 BOOST_CHECK_EQUAL( x23 & x23, x23 );
376 BOOST_CHECK_EQUAL( x23 & x13, x3 );
377 BOOST_CHECK_EQUAL( x23 & x123, x23 );
378 BOOST_CHECK_EQUAL( x13 & x, x );
379 BOOST_CHECK_EQUAL( x13 & x1, x1 );
380 BOOST_CHECK_EQUAL( x13 & x2, x );
381 BOOST_CHECK_EQUAL( x13 & x3, x3 );
382 BOOST_CHECK_EQUAL( x13 & x12, x1 );
383 BOOST_CHECK_EQUAL( x13 & x23, x3 );
384 BOOST_CHECK_EQUAL( x13 & x13, x13 );
385 BOOST_CHECK_EQUAL( x13 & x123, x13 );
386 BOOST_CHECK_EQUAL( x123 & x, x );
387 BOOST_CHECK_EQUAL( x123 & x1, x1 );
388 BOOST_CHECK_EQUAL( x123 & x2, x2 );
389 BOOST_CHECK_EQUAL( x123 & x3, x3 );
390 BOOST_CHECK_EQUAL( x123 & x12, x12 );
391 BOOST_CHECK_EQUAL( x123 & x23, x23 );
392 BOOST_CHECK_EQUAL( x123 & x13, x13 );
393 BOOST_CHECK_EQUAL( x123 & x123, x123 );
394
395 // check operator/=
396 y = x ; y /= x; BOOST_CHECK_EQUAL( y, x );
397 y = x ; y /= x1; BOOST_CHECK_EQUAL( y, x );
398 y = x ; y /= x2; BOOST_CHECK_EQUAL( y, x );
399 y = x ; y /= x3; BOOST_CHECK_EQUAL( y, x );
400 y = x ; y /= x12; BOOST_CHECK_EQUAL( y, x );
401 y = x ; y /= x23; BOOST_CHECK_EQUAL( y, x );
402 y = x ; y /= x13; BOOST_CHECK_EQUAL( y, x );
403 y = x ; y /= x123; BOOST_CHECK_EQUAL( y, x );
404 y = x1 ; y /= x; BOOST_CHECK_EQUAL( y, x1 );
405 y = x1 ; y /= x1; BOOST_CHECK_EQUAL( y, x );
406 y = x1 ; y /= x2; BOOST_CHECK_EQUAL( y, x1 );
407 y = x1 ; y /= x3; BOOST_CHECK_EQUAL( y, x1 );
408 y = x1 ; y /= x12; BOOST_CHECK_EQUAL( y, x );
409 y = x1 ; y /= x23; BOOST_CHECK_EQUAL( y, x1 );
410 y = x1 ; y /= x13; BOOST_CHECK_EQUAL( y, x );
411 y = x1 ; y /= x123; BOOST_CHECK_EQUAL( y, x );
412 y = x2 ; y /= x; BOOST_CHECK_EQUAL( y, x2 );
413 y = x2 ; y /= x1; BOOST_CHECK_EQUAL( y, x2 );
414 y = x2 ; y /= x2; BOOST_CHECK_EQUAL( y, x );
415 y = x2 ; y /= x3; BOOST_CHECK_EQUAL( y, x2 );
416 y = x2 ; y /= x12; BOOST_CHECK_EQUAL( y, x );
417 y = x2 ; y /= x23; BOOST_CHECK_EQUAL( y, x );
418 y = x2 ; y /= x13; BOOST_CHECK_EQUAL( y, x2 );
419 y = x2 ; y /= x123; BOOST_CHECK_EQUAL( y, x );
420 y = x3 ; y /= x; BOOST_CHECK_EQUAL( y, x3 );
421 y = x3 ; y /= x1; BOOST_CHECK_EQUAL( y, x3 );
422 y = x3 ; y /= x2; BOOST_CHECK_EQUAL( y, x3 );
423 y = x3 ; y /= x3; BOOST_CHECK_EQUAL( y, x );
424 y = x3 ; y /= x12; BOOST_CHECK_EQUAL( y, x3 );
425 y = x3 ; y /= x23; BOOST_CHECK_EQUAL( y, x );
426 y = x3 ; y /= x13; BOOST_CHECK_EQUAL( y, x );
427 y = x3 ; y /= x123; BOOST_CHECK_EQUAL( y, x );
428 y = x12 ; y /= x; BOOST_CHECK_EQUAL( y, x12 );
429 y = x12 ; y /= x1; BOOST_CHECK_EQUAL( y, x2 );
430 y = x12 ; y /= x2; BOOST_CHECK_EQUAL( y, x1 );
431 y = x12 ; y /= x3; BOOST_CHECK_EQUAL( y, x12 );
432 y = x12 ; y /= x12; BOOST_CHECK_EQUAL( y, x );
433 y = x12 ; y /= x23; BOOST_CHECK_EQUAL( y, x1 );
434 y = x12 ; y /= x13; BOOST_CHECK_EQUAL( y, x2 );
435 y = x12 ; y /= x123; BOOST_CHECK_EQUAL( y, x );
436 y = x23 ; y /= x; BOOST_CHECK_EQUAL( y, x23 );
437 y = x23 ; y /= x1; BOOST_CHECK_EQUAL( y, x23 );
438 y = x23 ; y /= x2; BOOST_CHECK_EQUAL( y, x3 );
439 y = x23 ; y /= x3; BOOST_CHECK_EQUAL( y, x2 );
440 y = x23 ; y /= x12; BOOST_CHECK_EQUAL( y, x3 );
441 y = x23 ; y /= x23; BOOST_CHECK_EQUAL( y, x );
442 y = x23 ; y /= x13; BOOST_CHECK_EQUAL( y, x2 );
443 y = x23 ; y /= x123; BOOST_CHECK_EQUAL( y, x );
444 y = x13 ; y /= x; BOOST_CHECK_EQUAL( y, x13 );
445 y = x13 ; y /= x1; BOOST_CHECK_EQUAL( y, x3 );
446 y = x13 ; y /= x2; BOOST_CHECK_EQUAL( y, x13 );
447 y = x13 ; y /= x3; BOOST_CHECK_EQUAL( y, x1 );
448 y = x13 ; y /= x12; BOOST_CHECK_EQUAL( y, x3 );
449 y = x13 ; y /= x23; BOOST_CHECK_EQUAL( y, x1 );
450 y = x13 ; y /= x13; BOOST_CHECK_EQUAL( y, x );
451 y = x13 ; y /= x123; BOOST_CHECK_EQUAL( y, x );
452 y = x123; y /= x; BOOST_CHECK_EQUAL( y, x123 );
453 y = x123; y /= x1; BOOST_CHECK_EQUAL( y, x23 );
454 y = x123; y /= x2; BOOST_CHECK_EQUAL( y, x13 );
455 y = x123; y /= x3; BOOST_CHECK_EQUAL( y, x12 );
456 y = x123; y /= x12; BOOST_CHECK_EQUAL( y, x3 );
457 y = x123; y /= x23; BOOST_CHECK_EQUAL( y, x1 );
458 y = x123; y /= x13; BOOST_CHECK_EQUAL( y, x2 );
459 y = x123; y /= x123; BOOST_CHECK_EQUAL( y, x );
460
461 // check insert
462 y = x ; y.insert( 1 ); BOOST_CHECK_EQUAL( y, x1 );
463 y = x ; y.insert( 2 ); BOOST_CHECK_EQUAL( y, x2 );
464 y = x ; y.insert( 3 ); BOOST_CHECK_EQUAL( y, x3 );
465 y = x1 ; y.insert( 1 ); BOOST_CHECK_EQUAL( y, x1 );
466 y = x1 ; y.insert( 2 ); BOOST_CHECK_EQUAL( y, x12 );
467 y = x1 ; y.insert( 3 ); BOOST_CHECK_EQUAL( y, x13 );
468 y = x2 ; y.insert( 1 ); BOOST_CHECK_EQUAL( y, x12 );
469 y = x2 ; y.insert( 2 ); BOOST_CHECK_EQUAL( y, x2 );
470 y = x2 ; y.insert( 3 ); BOOST_CHECK_EQUAL( y, x23 );
471 y = x3 ; y.insert( 1 ); BOOST_CHECK_EQUAL( y, x13 );
472 y = x3 ; y.insert( 2 ); BOOST_CHECK_EQUAL( y, x23 );
473 y = x3 ; y.insert( 3 ); BOOST_CHECK_EQUAL( y, x3 );
474 y = x12 ; y.insert( 1 ); BOOST_CHECK_EQUAL( y, x12 );
475 y = x12 ; y.insert( 2 ); BOOST_CHECK_EQUAL( y, x12 );
476 y = x12 ; y.insert( 3 ); BOOST_CHECK_EQUAL( y, x123 );
477 y = x23 ; y.insert( 1 ); BOOST_CHECK_EQUAL( y, x123 );
478 y = x23 ; y.insert( 2 ); BOOST_CHECK_EQUAL( y, x23 );
479 y = x23 ; y.insert( 3 ); BOOST_CHECK_EQUAL( y, x23 );
480 y = x13 ; y.insert( 1 ); BOOST_CHECK_EQUAL( y, x13 );
481 y = x13 ; y.insert( 2 ); BOOST_CHECK_EQUAL( y, x123 );
482 y = x13 ; y.insert( 3 ); BOOST_CHECK_EQUAL( y, x13 );
483 y = x123; y.insert( 1 ); BOOST_CHECK_EQUAL( y, x123 );
484 y = x123; y.insert( 2 ); BOOST_CHECK_EQUAL( y, x123 );
485 y = x123; y.insert( 3 ); BOOST_CHECK_EQUAL( y, x123 );
486
487 // check operator|=
488 y = x ; y |= x; BOOST_CHECK_EQUAL( y, x );
489 y = x ; y |= x1; BOOST_CHECK_EQUAL( y, x1 );
490 y = x ; y |= x2; BOOST_CHECK_EQUAL( y, x2 );
491 y = x ; y |= x3; BOOST_CHECK_EQUAL( y, x3 );
492 y = x ; y |= x12; BOOST_CHECK_EQUAL( y, x12 );
493 y = x ; y |= x23; BOOST_CHECK_EQUAL( y, x23 );
494 y = x ; y |= x13; BOOST_CHECK_EQUAL( y, x13 );
495 y = x ; y |= x123; BOOST_CHECK_EQUAL( y, x123 );
496 y = x1 ; y |= x; BOOST_CHECK_EQUAL( y, x1 );
497 y = x1 ; y |= x1; BOOST_CHECK_EQUAL( y, x1 );
498 y = x1 ; y |= x2; BOOST_CHECK_EQUAL( y, x12 );
499 y = x1 ; y |= x3; BOOST_CHECK_EQUAL( y, x13 );
500 y = x1 ; y |= x12; BOOST_CHECK_EQUAL( y, x12 );
501 y = x1 ; y |= x23; BOOST_CHECK_EQUAL( y, x123 );
502 y = x1 ; y |= x13; BOOST_CHECK_EQUAL( y, x13 );
503 y = x1 ; y |= x123; BOOST_CHECK_EQUAL( y, x123 );
504 y = x2 ; y |= x; BOOST_CHECK_EQUAL( y, x2 );
505 y = x2 ; y |= x1; BOOST_CHECK_EQUAL( y, x12 );
506 y = x2 ; y |= x2; BOOST_CHECK_EQUAL( y, x2 );
507 y = x2 ; y |= x3; BOOST_CHECK_EQUAL( y, x23 );
508 y = x2 ; y |= x12; BOOST_CHECK_EQUAL( y, x12 );
509 y = x2 ; y |= x23; BOOST_CHECK_EQUAL( y, x23 );
510 y = x2 ; y |= x13; BOOST_CHECK_EQUAL( y, x123 );
511 y = x2 ; y |= x123; BOOST_CHECK_EQUAL( y, x123 );
512 y = x3 ; y |= x; BOOST_CHECK_EQUAL( y, x3 );
513 y = x3 ; y |= x1; BOOST_CHECK_EQUAL( y, x13 );
514 y = x3 ; y |= x2; BOOST_CHECK_EQUAL( y, x23 );
515 y = x3 ; y |= x3; BOOST_CHECK_EQUAL( y, x3 );
516 y = x3 ; y |= x12; BOOST_CHECK_EQUAL( y, x123 );
517 y = x3 ; y |= x23; BOOST_CHECK_EQUAL( y, x23 );
518 y = x3 ; y |= x13; BOOST_CHECK_EQUAL( y, x13 );
519 y = x3 ; y |= x123; BOOST_CHECK_EQUAL( y, x123 );
520 y = x12 ; y |= x; BOOST_CHECK_EQUAL( y, x12 );
521 y = x12 ; y |= x1; BOOST_CHECK_EQUAL( y, x12 );
522 y = x12 ; y |= x2; BOOST_CHECK_EQUAL( y, x12 );
523 y = x12 ; y |= x3; BOOST_CHECK_EQUAL( y, x123 );
524 y = x12 ; y |= x12; BOOST_CHECK_EQUAL( y, x12 );
525 y = x12 ; y |= x23; BOOST_CHECK_EQUAL( y, x123 );
526 y = x12 ; y |= x13; BOOST_CHECK_EQUAL( y, x123 );
527 y = x12 ; y |= x123; BOOST_CHECK_EQUAL( y, x123 );
528 y = x23 ; y |= x; BOOST_CHECK_EQUAL( y, x23 );
529 y = x23 ; y |= x1; BOOST_CHECK_EQUAL( y, x123 );
530 y = x23 ; y |= x2; BOOST_CHECK_EQUAL( y, x23 );
531 y = x23 ; y |= x3; BOOST_CHECK_EQUAL( y, x23 );
532 y = x23 ; y |= x12; BOOST_CHECK_EQUAL( y, x123 );
533 y = x23 ; y |= x23; BOOST_CHECK_EQUAL( y, x23 );
534 y = x23 ; y |= x13; BOOST_CHECK_EQUAL( y, x123 );
535 y = x23 ; y |= x123; BOOST_CHECK_EQUAL( y, x123 );
536 y = x13 ; y |= x; BOOST_CHECK_EQUAL( y, x13 );
537 y = x13 ; y |= x1; BOOST_CHECK_EQUAL( y, x13 );
538 y = x13 ; y |= x2; BOOST_CHECK_EQUAL( y, x123 );
539 y = x13 ; y |= x3; BOOST_CHECK_EQUAL( y, x13 );
540 y = x13 ; y |= x12; BOOST_CHECK_EQUAL( y, x123 );
541 y = x13 ; y |= x23; BOOST_CHECK_EQUAL( y, x123 );
542 y = x13 ; y |= x13; BOOST_CHECK_EQUAL( y, x13 );
543 y = x13 ; y |= x123; BOOST_CHECK_EQUAL( y, x123 );
544 y = x123; y |= x; BOOST_CHECK_EQUAL( y, x123 );
545 y = x123; y |= x1; BOOST_CHECK_EQUAL( y, x123 );
546 y = x123; y |= x2; BOOST_CHECK_EQUAL( y, x123 );
547 y = x123; y |= x3; BOOST_CHECK_EQUAL( y, x123 );
548 y = x123; y |= x12; BOOST_CHECK_EQUAL( y, x123 );
549 y = x123; y |= x23; BOOST_CHECK_EQUAL( y, x123 );
550 y = x123; y |= x13; BOOST_CHECK_EQUAL( y, x123 );
551 y = x123; y |= x123; BOOST_CHECK_EQUAL( y, x123 );
552
553 // check operator&=
554 y = x ; y &= x; BOOST_CHECK_EQUAL( y, x );
555 y = x ; y &= x1; BOOST_CHECK_EQUAL( y, x );
556 y = x ; y &= x2; BOOST_CHECK_EQUAL( y, x );
557 y = x ; y &= x3; BOOST_CHECK_EQUAL( y, x );
558 y = x ; y &= x12; BOOST_CHECK_EQUAL( y, x );
559 y = x ; y &= x23; BOOST_CHECK_EQUAL( y, x );
560 y = x ; y &= x13; BOOST_CHECK_EQUAL( y, x );
561 y = x ; y &= x123; BOOST_CHECK_EQUAL( y, x );
562 y = x1 ; y &= x; BOOST_CHECK_EQUAL( y, x );
563 y = x1 ; y &= x1; BOOST_CHECK_EQUAL( y, x1 );
564 y = x1 ; y &= x2; BOOST_CHECK_EQUAL( y, x );
565 y = x1 ; y &= x3; BOOST_CHECK_EQUAL( y, x );
566 y = x1 ; y &= x12; BOOST_CHECK_EQUAL( y, x1 );
567 y = x1 ; y &= x23; BOOST_CHECK_EQUAL( y, x );
568 y = x1 ; y &= x13; BOOST_CHECK_EQUAL( y, x1 );
569 y = x1 ; y &= x123; BOOST_CHECK_EQUAL( y, x1 );
570 y = x2 ; y &= x; BOOST_CHECK_EQUAL( y, x );
571 y = x2 ; y &= x1; BOOST_CHECK_EQUAL( y, x );
572 y = x2 ; y &= x2; BOOST_CHECK_EQUAL( y, x2 );
573 y = x2 ; y &= x3; BOOST_CHECK_EQUAL( y, x );
574 y = x2 ; y &= x12; BOOST_CHECK_EQUAL( y, x2 );
575 y = x2 ; y &= x23; BOOST_CHECK_EQUAL( y, x2 );
576 y = x2 ; y &= x13; BOOST_CHECK_EQUAL( y, x );
577 y = x2 ; y &= x123; BOOST_CHECK_EQUAL( y, x2 );
578 y = x3 ; y &= x; BOOST_CHECK_EQUAL( y, x );
579 y = x3 ; y &= x1; BOOST_CHECK_EQUAL( y, x );
580 y = x3 ; y &= x2; BOOST_CHECK_EQUAL( y, x );
581 y = x3 ; y &= x3; BOOST_CHECK_EQUAL( y, x3 );
582 y = x3 ; y &= x12; BOOST_CHECK_EQUAL( y, x );
583 y = x3 ; y &= x23; BOOST_CHECK_EQUAL( y, x3 );
584 y = x3 ; y &= x13; BOOST_CHECK_EQUAL( y, x3 );
585 y = x3 ; y &= x123; BOOST_CHECK_EQUAL( y, x3 );
586 y = x12 ; y &= x; BOOST_CHECK_EQUAL( y, x );
587 y = x12 ; y &= x1; BOOST_CHECK_EQUAL( y, x1 );
588 y = x12 ; y &= x2; BOOST_CHECK_EQUAL( y, x2 );
589 y = x12 ; y &= x3; BOOST_CHECK_EQUAL( y, x );
590 y = x12 ; y &= x12; BOOST_CHECK_EQUAL( y, x12 );
591 y = x12 ; y &= x23; BOOST_CHECK_EQUAL( y, x2 );
592 y = x12 ; y &= x13; BOOST_CHECK_EQUAL( y, x1 );
593 y = x12 ; y &= x123; BOOST_CHECK_EQUAL( y, x12 );
594 y = x23 ; y &= x; BOOST_CHECK_EQUAL( y, x );
595 y = x23 ; y &= x1; BOOST_CHECK_EQUAL( y, x );
596 y = x23 ; y &= x2; BOOST_CHECK_EQUAL( y, x2 );
597 y = x23 ; y &= x3; BOOST_CHECK_EQUAL( y, x3 );
598 y = x23 ; y &= x12; BOOST_CHECK_EQUAL( y, x2 );
599 y = x23 ; y &= x23; BOOST_CHECK_EQUAL( y, x23 );
600 y = x23 ; y &= x13; BOOST_CHECK_EQUAL( y, x3 );
601 y = x23 ; y &= x123; BOOST_CHECK_EQUAL( y, x23 );
602 y = x13 ; y &= x; BOOST_CHECK_EQUAL( y, x );
603 y = x13 ; y &= x1; BOOST_CHECK_EQUAL( y, x1 );
604 y = x13 ; y &= x2; BOOST_CHECK_EQUAL( y, x );
605 y = x13 ; y &= x3; BOOST_CHECK_EQUAL( y, x3 );
606 y = x13 ; y &= x12; BOOST_CHECK_EQUAL( y, x1 );
607 y = x13 ; y &= x23; BOOST_CHECK_EQUAL( y, x3 );
608 y = x13 ; y &= x13; BOOST_CHECK_EQUAL( y, x13 );
609 y = x13 ; y &= x123; BOOST_CHECK_EQUAL( y, x13 );
610 y = x123; y &= x; BOOST_CHECK_EQUAL( y, x );
611 y = x123; y &= x1; BOOST_CHECK_EQUAL( y, x1 );
612 y = x123; y &= x2; BOOST_CHECK_EQUAL( y, x2 );
613 y = x123; y &= x3; BOOST_CHECK_EQUAL( y, x3 );
614 y = x123; y &= x12; BOOST_CHECK_EQUAL( y, x12 );
615 y = x123; y &= x23; BOOST_CHECK_EQUAL( y, x23 );
616 y = x123; y &= x13; BOOST_CHECK_EQUAL( y, x13 );
617 y = x123; y &= x123; BOOST_CHECK_EQUAL( y, x123 );
618
619 // check operator/=
620 y = x ; y /= 1; BOOST_CHECK_EQUAL( y, x );
621 y = x ; y /= 2; BOOST_CHECK_EQUAL( y, x );
622 y = x ; y /= 3; BOOST_CHECK_EQUAL( y, x );
623 y = x1 ; y /= 1; BOOST_CHECK_EQUAL( y, x );
624 y = x1 ; y /= 2; BOOST_CHECK_EQUAL( y, x1 );
625 y = x1 ; y /= 3; BOOST_CHECK_EQUAL( y, x1 );
626 y = x2 ; y /= 1; BOOST_CHECK_EQUAL( y, x2 );
627 y = x2 ; y /= 2; BOOST_CHECK_EQUAL( y, x );
628 y = x2 ; y /= 3; BOOST_CHECK_EQUAL( y, x2 );
629 y = x3 ; y /= 1; BOOST_CHECK_EQUAL( y, x3 );
630 y = x3 ; y /= 2; BOOST_CHECK_EQUAL( y, x3 );
631 y = x3 ; y /= 3; BOOST_CHECK_EQUAL( y, x );
632 y = x12 ; y /= 1; BOOST_CHECK_EQUAL( y, x2 );
633 y = x12 ; y /= 2; BOOST_CHECK_EQUAL( y, x1 );
634 y = x12 ; y /= 3; BOOST_CHECK_EQUAL( y, x12 );
635 y = x13 ; y /= 1; BOOST_CHECK_EQUAL( y, x3 );
636 y = x13 ; y /= 2; BOOST_CHECK_EQUAL( y, x13 );
637 y = x13 ; y /= 3; BOOST_CHECK_EQUAL( y, x1 );
638 y = x23 ; y /= 1; BOOST_CHECK_EQUAL( y, x23 );
639 y = x23 ; y /= 2; BOOST_CHECK_EQUAL( y, x3 );
640 y = x23 ; y /= 3; BOOST_CHECK_EQUAL( y, x2 );
641 y = x123; y /= 1; BOOST_CHECK_EQUAL( y, x23 );
642 y = x123; y /= 2; BOOST_CHECK_EQUAL( y, x13 );
643 y = x123; y /= 3; BOOST_CHECK_EQUAL( y, x12 );
644
645 // check operator|=
646 y = x ; y |= 1; BOOST_CHECK_EQUAL( y, x1 );
647 y = x ; y |= 2; BOOST_CHECK_EQUAL( y, x2 );
648 y = x ; y |= 3; BOOST_CHECK_EQUAL( y, x3 );
649 y = x1 ; y |= 1; BOOST_CHECK_EQUAL( y, x1 );
650 y = x1 ; y |= 2; BOOST_CHECK_EQUAL( y, x12 );
651 y = x1 ; y |= 3; BOOST_CHECK_EQUAL( y, x13 );
652 y = x2 ; y |= 1; BOOST_CHECK_EQUAL( y, x12 );
653 y = x2 ; y |= 2; BOOST_CHECK_EQUAL( y, x2 );
654 y = x2 ; y |= 3; BOOST_CHECK_EQUAL( y, x23 );
655 y = x3 ; y |= 1; BOOST_CHECK_EQUAL( y, x13 );
656 y = x3 ; y |= 2; BOOST_CHECK_EQUAL( y, x23 );
657 y = x3 ; y |= 3; BOOST_CHECK_EQUAL( y, x3 );
658 y = x12 ; y |= 1; BOOST_CHECK_EQUAL( y, x12 );
659 y = x12 ; y |= 2; BOOST_CHECK_EQUAL( y, x12 );
660 y = x12 ; y |= 3; BOOST_CHECK_EQUAL( y, x123 );
661 y = x13 ; y |= 1; BOOST_CHECK_EQUAL( y, x13 );
662 y = x13 ; y |= 2; BOOST_CHECK_EQUAL( y, x123 );
663 y = x13 ; y |= 3; BOOST_CHECK_EQUAL( y, x13 );
664 y = x23 ; y |= 1; BOOST_CHECK_EQUAL( y, x123 );
665 y = x23 ; y |= 2; BOOST_CHECK_EQUAL( y, x23 );
666 y = x23 ; y |= 3; BOOST_CHECK_EQUAL( y, x23 );
667 y = x123; y |= 1; BOOST_CHECK_EQUAL( y, x123 );
668 y = x123; y |= 2; BOOST_CHECK_EQUAL( y, x123 );
669 y = x123; y |= 3; BOOST_CHECK_EQUAL( y, x123 );
670
671 // check operator<<
672 BOOST_CHECK( (x << x ) );
673 BOOST_CHECK( (x << x1 ) );
674 BOOST_CHECK( (x << x2 ) );
675 BOOST_CHECK( (x << x3 ) );
676 BOOST_CHECK( (x << x12 ) );
677 BOOST_CHECK( (x << x13 ) );
678 BOOST_CHECK( (x << x23 ) );
679 BOOST_CHECK( (x << x123) );
680 BOOST_CHECK( !(x1 << x ) );
681 BOOST_CHECK( (x1 << x1 ) );
682 BOOST_CHECK( !(x1 << x2 ) );
683 BOOST_CHECK( !(x1 << x3 ) );
684 BOOST_CHECK( (x1 << x12 ) );
685 BOOST_CHECK( (x1 << x13 ) );
686 BOOST_CHECK( !(x1 << x23 ) );
687 BOOST_CHECK( (x1 << x123) );
688 BOOST_CHECK( !(x2 << x ) );
689 BOOST_CHECK( !(x2 << x1 ) );
690 BOOST_CHECK( (x2 << x2 ) );
691 BOOST_CHECK( !(x2 << x3 ) );
692 BOOST_CHECK( (x2 << x12 ) );
693 BOOST_CHECK( !(x2 << x13 ) );
694 BOOST_CHECK( (x2 << x23 ) );
695 BOOST_CHECK( (x2 << x123) );
696 BOOST_CHECK( !(x3 << x ) );
697 BOOST_CHECK( !(x3 << x1 ) );
698 BOOST_CHECK( !(x3 << x2 ) );
699 BOOST_CHECK( (x3 << x3 ) );
700 BOOST_CHECK( !(x3 << x12 ) );
701 BOOST_CHECK( (x3 << x13 ) );
702 BOOST_CHECK( (x3 << x23 ) );
703 BOOST_CHECK( (x3 << x123) );
704 BOOST_CHECK( !(x12 << x ) );
705 BOOST_CHECK( !(x12 << x1 ) );
706 BOOST_CHECK( !(x12 << x2 ) );
707 BOOST_CHECK( !(x12 << x3 ) );
708 BOOST_CHECK( (x12 << x12 ) );
709 BOOST_CHECK( !(x12 << x13 ) );
710 BOOST_CHECK( !(x12 << x23 ) );
711 BOOST_CHECK( (x12 << x123) );
712 BOOST_CHECK( !(x13 << x ) );
713 BOOST_CHECK( !(x13 << x1 ) );
714 BOOST_CHECK( !(x13 << x2 ) );
715 BOOST_CHECK( !(x13 << x3 ) );
716 BOOST_CHECK( !(x13 << x12 ) );
717 BOOST_CHECK( (x13 << x13 ) );
718 BOOST_CHECK( !(x13 << x23 ) );
719 BOOST_CHECK( (x13 << x123) );
720 BOOST_CHECK( !(x23 << x ) );
721 BOOST_CHECK( !(x23 << x1 ) );
722 BOOST_CHECK( !(x23 << x2 ) );
723 BOOST_CHECK( !(x23 << x3 ) );
724 BOOST_CHECK( !(x23 << x12 ) );
725 BOOST_CHECK( !(x23 << x13 ) );
726 BOOST_CHECK( (x23 << x23 ) );
727 BOOST_CHECK( (x23 << x123) );
728 BOOST_CHECK( !(x123 << x ) );
729 BOOST_CHECK( !(x123 << x1 ) );
730 BOOST_CHECK( !(x123 << x2 ) );
731 BOOST_CHECK( !(x123 << x3 ) );
732 BOOST_CHECK( !(x123 << x12 ) );
733 BOOST_CHECK( !(x123 << x13 ) );
734 BOOST_CHECK( !(x123 << x23 ) );
735 BOOST_CHECK( (x123 << x123) );
736
737 // check operator>>
738 BOOST_CHECK( (x >> x ) );
739 BOOST_CHECK( !(x >> x1 ) );
740 BOOST_CHECK( !(x >> x2 ) );
741 BOOST_CHECK( !(x >> x3 ) );
742 BOOST_CHECK( !(x >> x12 ) );
743 BOOST_CHECK( !(x >> x13 ) );
744 BOOST_CHECK( !(x >> x23 ) );
745 BOOST_CHECK( !(x >> x123) );
746 BOOST_CHECK( (x1 >> x ) );
747 BOOST_CHECK( (x1 >> x1 ) );
748 BOOST_CHECK( !(x1 >> x2 ) );
749 BOOST_CHECK( !(x1 >> x3 ) );
750 BOOST_CHECK( !(x1 >> x12 ) );
751 BOOST_CHECK( !(x1 >> x13 ) );
752 BOOST_CHECK( !(x1 >> x23 ) );
753 BOOST_CHECK( !(x1 >> x123) );
754 BOOST_CHECK( (x2 >> x ) );
755 BOOST_CHECK( !(x2 >> x1 ) );
756 BOOST_CHECK( (x2 >> x2 ) );
757 BOOST_CHECK( !(x2 >> x3 ) );
758 BOOST_CHECK( !(x2 >> x12 ) );
759 BOOST_CHECK( !(x2 >> x13 ) );
760 BOOST_CHECK( !(x2 >> x23 ) );
761 BOOST_CHECK( !(x2 >> x123) );
762 BOOST_CHECK( (x3 >> x ) );
763 BOOST_CHECK( !(x3 >> x1 ) );
764 BOOST_CHECK( !(x3 >> x2 ) );
765 BOOST_CHECK( (x3 >> x3 ) );
766 BOOST_CHECK( !(x3 >> x12 ) );
767 BOOST_CHECK( !(x3 >> x13 ) );
768 BOOST_CHECK( !(x3 >> x23 ) );
769 BOOST_CHECK( !(x3 >> x123) );
770 BOOST_CHECK( (x12 >> x ) );
771 BOOST_CHECK( (x12 >> x1 ) );
772 BOOST_CHECK( (x12 >> x2 ) );
773 BOOST_CHECK( !(x12 >> x3 ) );
774 BOOST_CHECK( (x12 >> x12 ) );
775 BOOST_CHECK( !(x12 >> x13 ) );
776 BOOST_CHECK( !(x12 >> x23 ) );
777 BOOST_CHECK( !(x12 >> x123) );
778 BOOST_CHECK( (x13 >> x ) );
779 BOOST_CHECK( (x13 >> x1 ) );
780 BOOST_CHECK( !(x13 >> x2 ) );
781 BOOST_CHECK( (x13 >> x3 ) );
782 BOOST_CHECK( !(x13 >> x12 ) );
783 BOOST_CHECK( (x13 >> x13 ) );
784 BOOST_CHECK( !(x13 >> x23 ) );
785 BOOST_CHECK( !(x13 >> x123) );
786 BOOST_CHECK( (x23 >> x ) );
787 BOOST_CHECK( !(x23 >> x1 ) );
788 BOOST_CHECK( (x23 >> x2 ) );
789 BOOST_CHECK( (x23 >> x3 ) );
790 BOOST_CHECK( !(x23 >> x12 ) );
791 BOOST_CHECK( !(x23 >> x13 ) );
792 BOOST_CHECK( (x23 >> x23 ) );
793 BOOST_CHECK( !(x23 >> x123) );
794 BOOST_CHECK( (x123 >> x ) );
795 BOOST_CHECK( (x123 >> x1 ) );
796 BOOST_CHECK( (x123 >> x2 ) );
797 BOOST_CHECK( (x123 >> x3 ) );
798 BOOST_CHECK( (x123 >> x12 ) );
799 BOOST_CHECK( (x123 >> x13 ) );
800 BOOST_CHECK( (x123 >> x23 ) );
801 BOOST_CHECK( (x123 >> x123) );
802 }