main page
modules
namespaces
classes
files
Gecode home
Generated on Tue Oct 22 2013 00:49:07 for Gecode by
doxygen
1.8.4
gecode
kernel
var-type.hpp
Go to the documentation of this file.
1
/*
2
* CAUTION:
3
* This file has been automatically generated. Do not edit,
4
* edit the following files instead:
5
* - ./gecode/int/var-imp/int.vis
6
* - ./gecode/int/var-imp/bool.vis
7
* - ./gecode/set/var-imp/set.vis
8
* - ./gecode/float/var-imp/float.vis
9
*
10
* This file contains generated code fragments which are
11
* copyrighted as follows:
12
*
13
* Main author:
14
* Christian Schulte <schulte@gecode.org>
15
*
16
* Copyright:
17
* Christian Schulte, 2007
18
*
19
* The generated code fragments are part of Gecode, the generic
20
* constraint development environment:
21
* http://www.gecode.org
22
*
23
* Permission is hereby granted, free of charge, to any person obtaining
24
* a copy of this software and associated documentation files (the
25
* "Software"), to deal in the Software without restriction, including
26
* without limitation the rights to use, copy, modify, merge, publish,
27
* distribute, sublicense, and/or sell copies of the Software, and to
28
* permit persons to whom the Software is furnished to do so, subject to
29
* the following conditions:
30
*
31
* The above copyright notice and this permission notice shall be
32
* included in all copies or substantial portions of the Software.
33
*
34
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
38
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
39
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
40
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41
*
42
*/
43
44
#ifdef GECODE_HAS_INT_VARS
45
namespace
Gecode {
namespace
Int {
51
const
Gecode::ModEvent
ME_INT_FAILED
=
Gecode::ME_GEN_FAILED
;
54
const
Gecode::ModEvent
ME_INT_NONE
=
Gecode::ME_GEN_NONE
;
56
const
Gecode::ModEvent
ME_INT_VAL
=
Gecode::ME_GEN_ASSIGNED
;
65
const
Gecode::ModEvent
ME_INT_BND
=
Gecode::ME_GEN_ASSIGNED
+ 1;
72
const
Gecode::ModEvent
ME_INT_DOM
=
Gecode::ME_GEN_ASSIGNED
+ 2;
74
const
Gecode::PropCond
PC_INT_NONE
=
Gecode::PC_GEN_NONE
;
82
const
Gecode::PropCond
PC_INT_VAL
=
Gecode::PC_GEN_ASSIGNED
;
91
const
Gecode::PropCond
PC_INT_BND
=
Gecode::PC_GEN_ASSIGNED
+ 1;
100
const
Gecode::PropCond
PC_INT_DOM
=
Gecode::PC_GEN_ASSIGNED
+ 2;
102
}}
103
#endif
104
#ifdef GECODE_HAS_INT_VARS
105
namespace
Gecode {
namespace
Int {
111
const
Gecode::ModEvent
ME_BOOL_FAILED
=
Gecode::ME_GEN_FAILED
;
114
const
Gecode::ModEvent
ME_BOOL_NONE
=
Gecode::ME_GEN_NONE
;
116
const
Gecode::ModEvent
ME_BOOL_VAL
=
Gecode::ME_GEN_ASSIGNED
;
118
const
Gecode::PropCond
PC_BOOL_NONE
=
Gecode::PC_GEN_NONE
;
126
const
Gecode::PropCond
PC_BOOL_VAL
=
Gecode::PC_GEN_ASSIGNED
;
128
}}
129
#endif
130
#ifdef GECODE_HAS_SET_VARS
131
namespace
Gecode {
namespace
Set {
137
const
Gecode::ModEvent
ME_SET_FAILED
=
Gecode::ME_GEN_FAILED
;
140
const
Gecode::ModEvent
ME_SET_NONE
=
Gecode::ME_GEN_NONE
;
142
const
Gecode::ModEvent
ME_SET_VAL
=
Gecode::ME_GEN_ASSIGNED
;
148
const
Gecode::ModEvent
ME_SET_CARD
=
Gecode::ME_GEN_ASSIGNED
+ 1;
156
const
Gecode::ModEvent
ME_SET_LUB
=
Gecode::ME_GEN_ASSIGNED
+ 2;
164
const
Gecode::ModEvent
ME_SET_GLB
=
Gecode::ME_GEN_ASSIGNED
+ 3;
172
const
Gecode::ModEvent
ME_SET_BB
=
Gecode::ME_GEN_ASSIGNED
+ 4;
179
const
Gecode::ModEvent
ME_SET_CLUB
=
Gecode::ME_GEN_ASSIGNED
+ 5;
186
const
Gecode::ModEvent
ME_SET_CGLB
=
Gecode::ME_GEN_ASSIGNED
+ 6;
197
const
Gecode::ModEvent
ME_SET_CBB
=
Gecode::ME_GEN_ASSIGNED
+ 7;
199
const
Gecode::PropCond
PC_SET_NONE
=
Gecode::PC_GEN_NONE
;
207
const
Gecode::PropCond
PC_SET_VAL
=
Gecode::PC_GEN_ASSIGNED
;
216
const
Gecode::PropCond
PC_SET_CARD
=
Gecode::PC_GEN_ASSIGNED
+ 1;
227
const
Gecode::PropCond
PC_SET_CLUB
=
Gecode::PC_GEN_ASSIGNED
+ 2;
238
const
Gecode::PropCond
PC_SET_CGLB
=
Gecode::PC_GEN_ASSIGNED
+ 3;
248
const
Gecode::PropCond
PC_SET_ANY
=
Gecode::PC_GEN_ASSIGNED
+ 4;
250
}}
251
#endif
252
#ifdef GECODE_HAS_FLOAT_VARS
253
namespace
Gecode {
namespace
Float {
259
const
Gecode::ModEvent
ME_FLOAT_FAILED
=
Gecode::ME_GEN_FAILED
;
262
const
Gecode::ModEvent
ME_FLOAT_NONE
=
Gecode::ME_GEN_NONE
;
264
const
Gecode::ModEvent
ME_FLOAT_VAL
=
Gecode::ME_GEN_ASSIGNED
;
273
const
Gecode::ModEvent
ME_FLOAT_BND
=
Gecode::ME_GEN_ASSIGNED
+ 1;
275
const
Gecode::PropCond
PC_FLOAT_NONE
=
Gecode::PC_GEN_NONE
;
283
const
Gecode::PropCond
PC_FLOAT_VAL
=
Gecode::PC_GEN_ASSIGNED
;
292
const
Gecode::PropCond
PC_FLOAT_BND
=
Gecode::PC_GEN_ASSIGNED
+ 1;
294
}}
295
#endif
296
#ifdef GECODE_HAS_INT_VARS
297
namespace
Gecode {
namespace
Int {
299
class
IntVarImpConf
{
300
public
:
302
static
const
int
idx_c
= 0;
304
static
const
int
idx_d
= -1;
306
static
const
Gecode::PropCond
pc_max
=
PC_INT_DOM
;
308
static
const
int
free_bits
= 0;
310
static
const
int
med_fst
= 0;
312
static
const
int
med_lst
=
med_fst
+ 2;
314
static
const
int
med_mask
= ((1 << 2) - 1) <<
med_fst
;
316
static
Gecode::ModEvent
me_combine
(
Gecode::ModEvent
me1,
Gecode::ModEvent
me2);
318
static
bool
med_update
(
Gecode::ModEventDelta
& med,
Gecode::ModEvent
me);
319
};
320
}}
321
#else
322
namespace
Gecode {
namespace
Int {
324
class
IntVarImpConf {
325
public
:
327
static
const
int
idx_c
= -1;
329
static
const
int
idx_d
= -1;
331
static
const
int
med_lst
= 0;
332
};
333
}}
334
#endif
335
#ifdef GECODE_HAS_INT_VARS
336
namespace
Gecode {
namespace
Int {
338
class
BoolVarImpConf
{
339
public
:
341
static
const
int
idx_c
=
Gecode::Int::IntVarImpConf::idx_c
+1;
343
static
const
int
idx_d
=
Gecode::Int::IntVarImpConf::idx_d
;
345
static
const
Gecode::PropCond
pc_max
=
PC_BOOL_VAL
;
347
static
const
int
free_bits
= 2;
349
static
const
int
med_fst
=
Gecode::Int::IntVarImpConf::med_lst
;
351
static
const
int
med_lst
=
med_fst
+ 1;
353
static
const
int
med_mask
= ((1 << 1) - 1) <<
med_fst
;
355
static
Gecode::ModEvent
me_combine
(
Gecode::ModEvent
me1,
Gecode::ModEvent
me2);
357
static
bool
med_update
(
Gecode::ModEventDelta
& med,
Gecode::ModEvent
me);
358
};
359
}}
360
#else
361
namespace
Gecode {
namespace
Int {
363
class
BoolVarImpConf {
364
public
:
366
static
const
int
idx_c
=
Gecode::Int::IntVarImpConf::idx_c
;
368
static
const
int
idx_d
=
Gecode::Int::IntVarImpConf::idx_d
;
370
static
const
int
med_lst
=
Gecode::Int::IntVarImpConf::med_lst
;
371
};
372
}}
373
#endif
374
#ifdef GECODE_HAS_SET_VARS
375
namespace
Gecode {
namespace
Set {
377
class
SetVarImpConf
{
378
public
:
380
static
const
int
idx_c
=
Gecode::Int::BoolVarImpConf::idx_c
+1;
382
static
const
int
idx_d
=
Gecode::Int::BoolVarImpConf::idx_d
;
384
static
const
Gecode::PropCond
pc_max
=
PC_SET_ANY
;
386
static
const
int
free_bits
= 0;
388
static
const
int
med_fst
=
Gecode::Int::BoolVarImpConf::med_lst
;
390
static
const
int
med_lst
=
med_fst
+ 4;
392
static
const
int
med_mask
= ((1 << 4) - 1) <<
med_fst
;
394
static
Gecode::ModEvent
me_combine
(
Gecode::ModEvent
me1,
Gecode::ModEvent
me2);
396
static
bool
med_update
(
Gecode::ModEventDelta
& med,
Gecode::ModEvent
me);
397
};
398
}}
399
#else
400
namespace
Gecode {
namespace
Set {
402
class
SetVarImpConf {
403
public
:
405
static
const
int
idx_c
=
Gecode::Int::BoolVarImpConf::idx_c
;
407
static
const
int
idx_d
=
Gecode::Int::BoolVarImpConf::idx_d
;
409
static
const
int
med_lst
=
Gecode::Int::BoolVarImpConf::med_lst
;
410
};
411
}}
412
#endif
413
#ifdef GECODE_HAS_FLOAT_VARS
414
namespace
Gecode {
namespace
Float {
416
class
FloatVarImpConf
{
417
public
:
419
static
const
int
idx_c
=
Gecode::Set::SetVarImpConf::idx_c
+1;
421
static
const
int
idx_d
=
Gecode::Set::SetVarImpConf::idx_d
;
423
static
const
Gecode::PropCond
pc_max
=
PC_FLOAT_BND
;
425
static
const
int
free_bits
= 0;
427
static
const
int
med_fst
=
Gecode::Set::SetVarImpConf::med_lst
;
429
static
const
int
med_lst
=
med_fst
+ 2;
431
static
const
int
med_mask
= ((1 << 2) - 1) <<
med_fst
;
433
static
Gecode::ModEvent
me_combine
(
Gecode::ModEvent
me1,
Gecode::ModEvent
me2);
435
static
bool
med_update
(
Gecode::ModEventDelta
& med,
Gecode::ModEvent
me);
436
};
437
}}
438
#else
439
namespace
Gecode {
namespace
Float {
441
class
FloatVarImpConf {
442
public
:
444
static
const
int
idx_c
=
Gecode::Set::SetVarImpConf::idx_c
;
446
static
const
int
idx_d
=
Gecode::Set::SetVarImpConf::idx_d
;
448
static
const
int
med_lst
=
Gecode::Set::SetVarImpConf::med_lst
;
449
};
450
}}
451
#endif
452
453
namespace
Gecode {
454
456
class
AllVarConf
{
457
public
:
459
static
const
int
idx_c
=
Gecode::Float::FloatVarImpConf::idx_c
+1;
461
static
const
int
idx_d
=
Gecode::Float::FloatVarImpConf::idx_d
+1;
463
static
ModEventDelta
med_combine
(
ModEventDelta
med1,
ModEventDelta
med2);
464
};
465
466
}
467
468
#ifdef GECODE_HAS_INT_VARS
469
namespace
Gecode {
namespace
Int {
470
forceinline
Gecode::ModEvent
471
IntVarImpConf::me_combine
(
Gecode::ModEvent
me1,
Gecode::ModEvent
me2) {
472
static
const
Gecode::ModEvent
me_c = (
473
(
474
(
ME_INT_NONE
<< 0) |
// [ME_INT_NONE][ME_INT_NONE]
475
(
ME_INT_VAL
<< 2) |
// [ME_INT_NONE][ME_INT_VAL ]
476
(
ME_INT_BND
<< 4) |
// [ME_INT_NONE][ME_INT_BND ]
477
(
ME_INT_DOM
<< 6)
// [ME_INT_NONE][ME_INT_DOM ]
478
) |
479
(
480
(
ME_INT_VAL
<< 8) |
// [ME_INT_VAL ][ME_INT_NONE]
481
(
ME_INT_VAL
<< 10) |
// [ME_INT_VAL ][ME_INT_VAL ]
482
(
ME_INT_VAL
<< 12) |
// [ME_INT_VAL ][ME_INT_BND ]
483
(
ME_INT_VAL
<< 14)
// [ME_INT_VAL ][ME_INT_DOM ]
484
) |
485
(
486
(
ME_INT_BND
<< 16) |
// [ME_INT_BND ][ME_INT_NONE]
487
(
ME_INT_VAL
<< 18) |
// [ME_INT_BND ][ME_INT_VAL ]
488
(
ME_INT_BND
<< 20) |
// [ME_INT_BND ][ME_INT_BND ]
489
(
ME_INT_BND
<< 22)
// [ME_INT_BND ][ME_INT_DOM ]
490
) |
491
(
492
(
ME_INT_DOM
<< 24) |
// [ME_INT_DOM ][ME_INT_NONE]
493
(
ME_INT_VAL
<< 26) |
// [ME_INT_DOM ][ME_INT_VAL ]
494
(
ME_INT_BND
<< 28) |
// [ME_INT_DOM ][ME_INT_BND ]
495
(
ME_INT_DOM
<< 30)
// [ME_INT_DOM ][ME_INT_DOM ]
496
)
497
);
498
return
((me_c >> (me2 << 3)) >> (me1 << 1)) & 3;
499
}
500
forceinline
bool
501
IntVarImpConf::med_update
(
Gecode::ModEventDelta
& med,
Gecode::ModEvent
me) {
502
switch
(me) {
503
case
ME_INT_NONE
:
504
return
false
;
505
case
ME_INT_VAL
:
506
{
507
Gecode::ModEventDelta
med_int = med &
med_mask
;
508
if
(med_int == (
ME_INT_VAL
<<
med_fst
))
509
return
false
;
510
med ^= med_int;
511
med ^=
ME_INT_VAL
<<
med_fst
;
512
break
;
513
}
514
case
ME_INT_BND
:
515
{
516
static
const
Gecode::ModEvent
me_c = (
517
((
ME_INT_NONE
^
ME_INT_BND
) << 0) |
518
((
ME_INT_VAL
^
ME_INT_VAL
) << 4) |
519
((
ME_INT_BND
^
ME_INT_BND
) << 8) |
520
((
ME_INT_DOM
^
ME_INT_BND
) << 12)
521
);
522
Gecode::ModEvent
me_o = (med &
med_mask
) >>
med_fst
;
523
Gecode::ModEvent
me_n = (me_c >> (me_o << 2)) & (med_mask >>
med_fst
);
524
if
(me_n == 0)
525
return
false
;
526
med ^= me_n <<
med_fst
;
527
break
;
528
}
529
case
ME_INT_DOM
:
530
{
531
Gecode::ModEventDelta
med_int = med &
med_mask
;
532
if
(med_int != 0)
533
return
false
;
534
med |=
ME_INT_DOM
<<
med_fst
;
535
break
;
536
}
537
default
:
GECODE_NEVER
;
538
}
539
return
true
;
540
}
541
542
}}
543
#endif
544
#ifdef GECODE_HAS_INT_VARS
545
namespace
Gecode {
namespace
Int {
546
forceinline
Gecode::ModEvent
547
BoolVarImpConf::me_combine
(
Gecode::ModEvent
me1,
Gecode::ModEvent
me2) {
548
return
me1 | me2;
549
}
550
forceinline
bool
551
BoolVarImpConf::med_update
(
Gecode::ModEventDelta
& med,
Gecode::ModEvent
me) {
552
switch
(me) {
553
case
ME_BOOL_NONE
:
554
return
false
;
555
case
ME_BOOL_VAL
:
556
if
((med & (
ME_BOOL_VAL
<<
med_fst
)) != 0)
557
return
false
;
558
med |=
ME_BOOL_VAL
<<
med_fst
;
559
break
;
560
default
:
GECODE_NEVER
;
561
}
562
return
true
;
563
}
564
565
}}
566
#endif
567
#ifdef GECODE_HAS_SET_VARS
568
namespace
Gecode {
namespace
Set {
569
forceinline
Gecode::ModEvent
570
SetVarImpConf::me_combine
(
Gecode::ModEvent
me1,
Gecode::ModEvent
me2) {
571
static
const
Gecode::ModEvent
me_c[
ME_SET_CBB
+1][
ME_SET_CBB
+1] = {
572
{
573
ME_SET_NONE
,
// [ME_SET_NONE][ME_SET_NONE]
574
ME_SET_VAL
,
// [ME_SET_NONE][ME_SET_VAL ]
575
ME_SET_CARD
,
// [ME_SET_NONE][ME_SET_CARD]
576
ME_SET_LUB
,
// [ME_SET_NONE][ME_SET_LUB ]
577
ME_SET_GLB
,
// [ME_SET_NONE][ME_SET_GLB ]
578
ME_SET_BB
,
// [ME_SET_NONE][ME_SET_BB ]
579
ME_SET_CLUB
,
// [ME_SET_NONE][ME_SET_CLUB]
580
ME_SET_CGLB
,
// [ME_SET_NONE][ME_SET_CGLB]
581
ME_SET_CBB
// [ME_SET_NONE][ME_SET_CBB ]
582
},
583
{
584
ME_SET_VAL
,
// [ME_SET_VAL ][ME_SET_NONE]
585
ME_SET_VAL
,
// [ME_SET_VAL ][ME_SET_VAL ]
586
ME_SET_VAL
,
// [ME_SET_VAL ][ME_SET_CARD]
587
ME_SET_VAL
,
// [ME_SET_VAL ][ME_SET_LUB ]
588
ME_SET_VAL
,
// [ME_SET_VAL ][ME_SET_GLB ]
589
ME_SET_VAL
,
// [ME_SET_VAL ][ME_SET_BB ]
590
ME_SET_VAL
,
// [ME_SET_VAL ][ME_SET_CLUB]
591
ME_SET_VAL
,
// [ME_SET_VAL ][ME_SET_CGLB]
592
ME_SET_VAL
// [ME_SET_VAL ][ME_SET_CBB ]
593
},
594
{
595
ME_SET_CARD
,
// [ME_SET_CARD][ME_SET_NONE]
596
ME_SET_VAL
,
// [ME_SET_CARD][ME_SET_VAL ]
597
ME_SET_CARD
,
// [ME_SET_CARD][ME_SET_CARD]
598
ME_SET_CLUB
,
// [ME_SET_CARD][ME_SET_LUB ]
599
ME_SET_CGLB
,
// [ME_SET_CARD][ME_SET_GLB ]
600
ME_SET_CBB
,
// [ME_SET_CARD][ME_SET_BB ]
601
ME_SET_CLUB
,
// [ME_SET_CARD][ME_SET_CLUB]
602
ME_SET_CGLB
,
// [ME_SET_CARD][ME_SET_CGLB]
603
ME_SET_CBB
// [ME_SET_CARD][ME_SET_CBB ]
604
},
605
{
606
ME_SET_LUB
,
// [ME_SET_LUB ][ME_SET_NONE]
607
ME_SET_VAL
,
// [ME_SET_LUB ][ME_SET_VAL ]
608
ME_SET_CLUB
,
// [ME_SET_LUB ][ME_SET_CARD]
609
ME_SET_LUB
,
// [ME_SET_LUB ][ME_SET_LUB ]
610
ME_SET_BB
,
// [ME_SET_LUB ][ME_SET_GLB ]
611
ME_SET_BB
,
// [ME_SET_LUB ][ME_SET_BB ]
612
ME_SET_CLUB
,
// [ME_SET_LUB ][ME_SET_CLUB]
613
ME_SET_CBB
,
// [ME_SET_LUB ][ME_SET_CGLB]
614
ME_SET_CBB
// [ME_SET_LUB ][ME_SET_CBB ]
615
},
616
{
617
ME_SET_GLB
,
// [ME_SET_GLB ][ME_SET_NONE]
618
ME_SET_VAL
,
// [ME_SET_GLB ][ME_SET_VAL ]
619
ME_SET_CGLB
,
// [ME_SET_GLB ][ME_SET_CARD]
620
ME_SET_BB
,
// [ME_SET_GLB ][ME_SET_LUB ]
621
ME_SET_GLB
,
// [ME_SET_GLB ][ME_SET_GLB ]
622
ME_SET_BB
,
// [ME_SET_GLB ][ME_SET_BB ]
623
ME_SET_CBB
,
// [ME_SET_GLB ][ME_SET_CLUB]
624
ME_SET_CGLB
,
// [ME_SET_GLB ][ME_SET_CGLB]
625
ME_SET_CBB
// [ME_SET_GLB ][ME_SET_CBB ]
626
},
627
{
628
ME_SET_BB
,
// [ME_SET_BB ][ME_SET_NONE]
629
ME_SET_VAL
,
// [ME_SET_BB ][ME_SET_VAL ]
630
ME_SET_CBB
,
// [ME_SET_BB ][ME_SET_CARD]
631
ME_SET_BB
,
// [ME_SET_BB ][ME_SET_LUB ]
632
ME_SET_BB
,
// [ME_SET_BB ][ME_SET_GLB ]
633
ME_SET_BB
,
// [ME_SET_BB ][ME_SET_BB ]
634
ME_SET_CBB
,
// [ME_SET_BB ][ME_SET_CLUB]
635
ME_SET_CBB
,
// [ME_SET_BB ][ME_SET_CGLB]
636
ME_SET_CBB
// [ME_SET_BB ][ME_SET_CBB ]
637
},
638
{
639
ME_SET_CLUB
,
// [ME_SET_CLUB][ME_SET_NONE]
640
ME_SET_VAL
,
// [ME_SET_CLUB][ME_SET_VAL ]
641
ME_SET_CLUB
,
// [ME_SET_CLUB][ME_SET_CARD]
642
ME_SET_CLUB
,
// [ME_SET_CLUB][ME_SET_LUB ]
643
ME_SET_CBB
,
// [ME_SET_CLUB][ME_SET_GLB ]
644
ME_SET_CBB
,
// [ME_SET_CLUB][ME_SET_BB ]
645
ME_SET_CLUB
,
// [ME_SET_CLUB][ME_SET_CLUB]
646
ME_SET_CBB
,
// [ME_SET_CLUB][ME_SET_CGLB]
647
ME_SET_CBB
// [ME_SET_CLUB][ME_SET_CBB ]
648
},
649
{
650
ME_SET_CGLB
,
// [ME_SET_CGLB][ME_SET_NONE]
651
ME_SET_VAL
,
// [ME_SET_CGLB][ME_SET_VAL ]
652
ME_SET_CGLB
,
// [ME_SET_CGLB][ME_SET_CARD]
653
ME_SET_CBB
,
// [ME_SET_CGLB][ME_SET_LUB ]
654
ME_SET_CGLB
,
// [ME_SET_CGLB][ME_SET_GLB ]
655
ME_SET_CBB
,
// [ME_SET_CGLB][ME_SET_BB ]
656
ME_SET_CBB
,
// [ME_SET_CGLB][ME_SET_CLUB]
657
ME_SET_CGLB
,
// [ME_SET_CGLB][ME_SET_CGLB]
658
ME_SET_CBB
// [ME_SET_CGLB][ME_SET_CBB ]
659
},
660
{
661
ME_SET_CBB
,
// [ME_SET_CBB ][ME_SET_NONE]
662
ME_SET_VAL
,
// [ME_SET_CBB ][ME_SET_VAL ]
663
ME_SET_CBB
,
// [ME_SET_CBB ][ME_SET_CARD]
664
ME_SET_CBB
,
// [ME_SET_CBB ][ME_SET_LUB ]
665
ME_SET_CBB
,
// [ME_SET_CBB ][ME_SET_GLB ]
666
ME_SET_CBB
,
// [ME_SET_CBB ][ME_SET_BB ]
667
ME_SET_CBB
,
// [ME_SET_CBB ][ME_SET_CLUB]
668
ME_SET_CBB
,
// [ME_SET_CBB ][ME_SET_CGLB]
669
ME_SET_CBB
// [ME_SET_CBB ][ME_SET_CBB ]
670
}
671
};
672
return
me_c[me1][me2];
673
}
674
forceinline
bool
675
SetVarImpConf::med_update
(
Gecode::ModEventDelta
& med,
Gecode::ModEvent
me) {
676
switch
(me) {
677
case
ME_SET_NONE
:
678
return
false
;
679
case
ME_SET_VAL
:
680
{
681
Gecode::ModEventDelta
med_set = med &
med_mask
;
682
if
(med_set == (
ME_SET_VAL
<<
med_fst
))
683
return
false
;
684
med ^= med_set;
685
med ^=
ME_SET_VAL
<<
med_fst
;
686
break
;
687
}
688
case
ME_SET_CARD
:
689
{
690
static
const
Gecode::ModEventDelta
me_c[
ME_SET_CBB
+1] = {
691
(
ME_SET_NONE
^
ME_SET_CARD
) <<
med_fst
,
692
(
ME_SET_VAL
^
ME_SET_VAL
) <<
med_fst
,
693
(
ME_SET_CARD
^
ME_SET_CARD
) <<
med_fst
,
694
(
ME_SET_LUB
^
ME_SET_CLUB
) <<
med_fst
,
695
(
ME_SET_GLB
^
ME_SET_CGLB
) <<
med_fst
,
696
(
ME_SET_BB
^
ME_SET_CBB
) <<
med_fst
,
697
(ME_SET_CLUB ^
ME_SET_CLUB
) <<
med_fst
,
698
(
ME_SET_CGLB
^
ME_SET_CGLB
) <<
med_fst
,
699
(ME_SET_CBB ^
ME_SET_CBB
) <<
med_fst
700
};
701
Gecode::ModEvent
me_o = (med &
med_mask
) >>
med_fst
;
702
Gecode::ModEventDelta
med_n = me_c[me_o];
703
if
(med_n == 0)
704
return
false
;
705
med ^= med_n;
706
break
;
707
}
708
case
ME_SET_LUB
:
709
{
710
static
const
Gecode::ModEventDelta
me_c[
ME_SET_CBB
+1] = {
711
(
ME_SET_NONE
^
ME_SET_LUB
) <<
med_fst
,
712
(
ME_SET_VAL
^
ME_SET_VAL
) <<
med_fst
,
713
(
ME_SET_CARD
^
ME_SET_CLUB
) <<
med_fst
,
714
(
ME_SET_LUB
^
ME_SET_LUB
) <<
med_fst
,
715
(
ME_SET_GLB
^
ME_SET_BB
) <<
med_fst
,
716
(
ME_SET_BB
^
ME_SET_BB
) <<
med_fst
,
717
(
ME_SET_CLUB
^
ME_SET_CLUB
) <<
med_fst
,
718
(
ME_SET_CGLB
^
ME_SET_CBB
) <<
med_fst
,
719
(ME_SET_CBB ^
ME_SET_CBB
) <<
med_fst
720
};
721
Gecode::ModEvent
me_o = (med &
med_mask
) >>
med_fst
;
722
Gecode::ModEventDelta
med_n = me_c[me_o];
723
if
(med_n == 0)
724
return
false
;
725
med ^= med_n;
726
break
;
727
}
728
case
ME_SET_GLB
:
729
{
730
static
const
Gecode::ModEventDelta
me_c[
ME_SET_CBB
+1] = {
731
(
ME_SET_NONE
^
ME_SET_GLB
) <<
med_fst
,
732
(
ME_SET_VAL
^
ME_SET_VAL
) <<
med_fst
,
733
(
ME_SET_CARD
^
ME_SET_CGLB
) <<
med_fst
,
734
(
ME_SET_LUB
^
ME_SET_BB
) <<
med_fst
,
735
(
ME_SET_GLB
^
ME_SET_GLB
) <<
med_fst
,
736
(ME_SET_BB ^ ME_SET_BB ) <<
med_fst
,
737
(
ME_SET_CLUB
^
ME_SET_CBB
) <<
med_fst
,
738
(
ME_SET_CGLB
^
ME_SET_CGLB
) <<
med_fst
,
739
(
ME_SET_CBB
^
ME_SET_CBB
) <<
med_fst
740
};
741
Gecode::ModEvent
me_o = (med &
med_mask
) >>
med_fst
;
742
Gecode::ModEventDelta
med_n = me_c[me_o];
743
if
(med_n == 0)
744
return
false
;
745
med ^= med_n;
746
break
;
747
}
748
case
ME_SET_BB
:
749
{
750
static
const
Gecode::ModEventDelta
me_c[
ME_SET_CBB
+1] = {
751
(
ME_SET_NONE
^
ME_SET_BB
) <<
med_fst
,
752
(
ME_SET_VAL
^
ME_SET_VAL
) <<
med_fst
,
753
(
ME_SET_CARD
^
ME_SET_CBB
) <<
med_fst
,
754
(
ME_SET_LUB
^
ME_SET_BB
) <<
med_fst
,
755
(
ME_SET_GLB
^
ME_SET_BB
) <<
med_fst
,
756
(ME_SET_BB ^ ME_SET_BB ) <<
med_fst
,
757
(
ME_SET_CLUB
^
ME_SET_CBB
) <<
med_fst
,
758
(
ME_SET_CGLB
^
ME_SET_CBB
) <<
med_fst
,
759
(ME_SET_CBB ^
ME_SET_CBB
) <<
med_fst
760
};
761
Gecode::ModEvent
me_o = (med &
med_mask
) >>
med_fst
;
762
Gecode::ModEventDelta
med_n = me_c[me_o];
763
if
(med_n == 0)
764
return
false
;
765
med ^= med_n;
766
break
;
767
}
768
case
ME_SET_CLUB
:
769
{
770
static
const
Gecode::ModEventDelta
me_c[
ME_SET_CBB
+1] = {
771
(
ME_SET_NONE
^
ME_SET_CLUB
) <<
med_fst
,
772
(
ME_SET_VAL
^
ME_SET_VAL
) <<
med_fst
,
773
(
ME_SET_CARD
^
ME_SET_CLUB
) <<
med_fst
,
774
(
ME_SET_LUB
^
ME_SET_CLUB
) <<
med_fst
,
775
(
ME_SET_GLB
^
ME_SET_CBB
) <<
med_fst
,
776
(
ME_SET_BB
^
ME_SET_CBB
) <<
med_fst
,
777
(ME_SET_CLUB ^
ME_SET_CLUB
) <<
med_fst
,
778
(
ME_SET_CGLB
^ ME_SET_CBB ) <<
med_fst
,
779
(ME_SET_CBB ^
ME_SET_CBB
) <<
med_fst
780
};
781
Gecode::ModEvent
me_o = (med &
med_mask
) >>
med_fst
;
782
Gecode::ModEventDelta
med_n = me_c[me_o];
783
if
(med_n == 0)
784
return
false
;
785
med ^= med_n;
786
break
;
787
}
788
case
ME_SET_CGLB
:
789
{
790
static
const
Gecode::ModEventDelta
me_c[
ME_SET_CBB
+1] = {
791
(
ME_SET_NONE
^
ME_SET_CGLB
) <<
med_fst
,
792
(
ME_SET_VAL
^
ME_SET_VAL
) <<
med_fst
,
793
(
ME_SET_CARD
^
ME_SET_CGLB
) <<
med_fst
,
794
(
ME_SET_LUB
^
ME_SET_CBB
) <<
med_fst
,
795
(
ME_SET_GLB
^
ME_SET_CGLB
) <<
med_fst
,
796
(
ME_SET_BB
^ ME_SET_CBB ) <<
med_fst
,
797
(
ME_SET_CLUB
^
ME_SET_CBB
) <<
med_fst
,
798
(
ME_SET_CGLB
^
ME_SET_CGLB
) <<
med_fst
,
799
(ME_SET_CBB ^
ME_SET_CBB
) <<
med_fst
800
};
801
Gecode::ModEvent
me_o = (med &
med_mask
) >>
med_fst
;
802
Gecode::ModEventDelta
med_n = me_c[me_o];
803
if
(med_n == 0)
804
return
false
;
805
med ^= med_n;
806
break
;
807
}
808
case
ME_SET_CBB
:
809
{
810
static
const
Gecode::ModEventDelta
me_c[
ME_SET_CBB
+1] = {
811
(
ME_SET_NONE
^
ME_SET_CBB
) <<
med_fst
,
812
(
ME_SET_VAL
^
ME_SET_VAL
) <<
med_fst
,
813
(
ME_SET_CARD
^
ME_SET_CBB
) <<
med_fst
,
814
(
ME_SET_LUB
^
ME_SET_CBB
) <<
med_fst
,
815
(
ME_SET_GLB
^
ME_SET_CBB
) <<
med_fst
,
816
(
ME_SET_BB
^ ME_SET_CBB ) <<
med_fst
,
817
(
ME_SET_CLUB
^
ME_SET_CBB
) <<
med_fst
,
818
(
ME_SET_CGLB
^ ME_SET_CBB ) <<
med_fst
,
819
(ME_SET_CBB ^
ME_SET_CBB
) <<
med_fst
820
};
821
Gecode::ModEvent
me_o = (med &
med_mask
) >>
med_fst
;
822
Gecode::ModEventDelta
med_n = me_c[me_o];
823
if
(med_n == 0)
824
return
false
;
825
med ^= med_n;
826
break
;
827
}
828
default
:
GECODE_NEVER
;
829
}
830
return
true
;
831
}
832
833
}}
834
#endif
835
#ifdef GECODE_HAS_FLOAT_VARS
836
namespace
Gecode {
namespace
Float {
837
forceinline
Gecode::ModEvent
838
FloatVarImpConf::me_combine(
Gecode::ModEvent
me1,
Gecode::ModEvent
me2) {
839
static
const
Gecode::ModEvent
me_c = (
840
(
841
(
ME_FLOAT_NONE
<< 0) |
// [ME_FLOAT_NONE][ME_FLOAT_NONE]
842
(
ME_FLOAT_VAL
<< 2) |
// [ME_FLOAT_NONE][ME_FLOAT_VAL ]
843
(
ME_FLOAT_BND
<< 4)
// [ME_FLOAT_NONE][ME_FLOAT_BND ]
844
) |
845
(
846
(
ME_FLOAT_VAL
<< 8) |
// [ME_FLOAT_VAL ][ME_FLOAT_NONE]
847
(
ME_FLOAT_VAL
<< 10) |
// [ME_FLOAT_VAL ][ME_FLOAT_VAL ]
848
(
ME_FLOAT_VAL
<< 12)
// [ME_FLOAT_VAL ][ME_FLOAT_BND ]
849
) |
850
(
851
(
ME_FLOAT_BND
<< 16) |
// [ME_FLOAT_BND ][ME_FLOAT_NONE]
852
(
ME_FLOAT_VAL
<< 18) |
// [ME_FLOAT_BND ][ME_FLOAT_VAL ]
853
(
ME_FLOAT_BND
<< 20)
// [ME_FLOAT_BND ][ME_FLOAT_BND ]
854
)
855
);
856
return
((me_c >> (me2 << 3)) >> (me1 << 1)) & 3;
857
}
858
forceinline
bool
859
FloatVarImpConf::med_update(
Gecode::ModEventDelta
& med,
Gecode::ModEvent
me) {
860
switch
(me) {
861
case
ME_FLOAT_NONE
:
862
return
false
;
863
case
ME_FLOAT_VAL
:
864
{
865
Gecode::ModEventDelta
med_float = med &
med_mask
;
866
if
(med_float == (
ME_FLOAT_VAL
<<
med_fst
))
867
return
false
;
868
med ^= med_float;
869
med ^=
ME_FLOAT_VAL
<<
med_fst
;
870
break
;
871
}
872
case
ME_FLOAT_BND
:
873
{
874
Gecode::ModEventDelta
med_float = med &
med_mask
;
875
if
(med_float != 0)
876
return
false
;
877
med |=
ME_FLOAT_BND
<<
med_fst
;
878
break
;
879
}
880
default
:
GECODE_NEVER
;
881
}
882
return
true
;
883
}
884
885
}}
886
#endif
887
namespace
Gecode {
888
forceinline
ModEventDelta
889
AllVarConf::med_combine
(
ModEventDelta
med1,
ModEventDelta
med2) {
890
#ifdef GECODE_HAS_INT_VARS
891
(void)
Gecode::Int::IntVarImpConf::med_update
(med1,(med2 &
Gecode::Int::IntVarImpConf::med_mask
) >>
Gecode::Int::IntVarImpConf::med_fst
);
892
#endif
893
#ifdef GECODE_HAS_INT_VARS
894
(void)
Gecode::Int::BoolVarImpConf::med_update
(med1,(med2 &
Gecode::Int::BoolVarImpConf::med_mask
) >>
Gecode::Int::BoolVarImpConf::med_fst
);
895
#endif
896
#ifdef GECODE_HAS_SET_VARS
897
(void)
Gecode::Set::SetVarImpConf::med_update
(med1,(med2 &
Gecode::Set::SetVarImpConf::med_mask
) >>
Gecode::Set::SetVarImpConf::med_fst
);
898
#endif
899
#ifdef GECODE_HAS_FLOAT_VARS
900
(void)
Gecode::Float::FloatVarImpConf::med_update
(med1,(med2 &
Gecode::Float::FloatVarImpConf::med_mask
) >>
Gecode::Float::FloatVarImpConf::med_fst
);
901
#endif
902
return
med1;
903
}
904
}
905
906
// STATISTICS: kernel-var