Generated on Fri Oct 19 11:25:13 2018 for Gecode by doxygen 1.6.3

var-type.hpp

Go to the documentation of this file.
00001 /*
00002  *  CAUTION:
00003  *    This file has been automatically generated. Do not edit,
00004  *    edit the following files instead:
00005  *     - ./gecode/int/var-imp/int.vis
00006  *     - ./gecode/int/var-imp/bool.vis
00007  *     - ./gecode/set/var-imp/set.vis
00008  *     - ./gecode/float/var-imp/float.vis
00009  *
00010  *  This file contains generated code fragments which are
00011  *  copyrighted as follows:
00012  *
00013  *  Main author:
00014  *     Christian Schulte <schulte@gecode.org>
00015  *
00016  *  Copyright:
00017  *     Christian Schulte, 2007
00018  *
00019  *  The generated code fragments are part of Gecode, the generic
00020  *  constraint development environment:
00021  *     http://www.gecode.org
00022  *
00023  *  Permission is hereby granted, free of charge, to any person obtaining
00024  *  a copy of this software and associated documentation files (the
00025  *  "Software"), to deal in the Software without restriction, including
00026  *  without limitation the rights to use, copy, modify, merge, publish,
00027  *  distribute, sublicense, and/or sell copies of the Software, and to
00028  *  permit persons to whom the Software is furnished to do so, subject to
00029  *  the following conditions:
00030  *
00031  *  The above copyright notice and this permission notice shall be
00032  *  included in all copies or substantial portions of the Software.
00033  *
00034  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00035  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00036  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00037  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00038  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00039  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00040  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00041  *
00042  */
00043 
00044 #ifdef GECODE_HAS_INT_VARS
00045 namespace Gecode { namespace Int {
00051 
00052   const Gecode::ModEvent ME_INT_FAILED = Gecode::ME_GEN_FAILED;
00054   const Gecode::ModEvent ME_INT_NONE = Gecode::ME_GEN_NONE;
00056   const Gecode::ModEvent ME_INT_VAL = Gecode::ME_GEN_ASSIGNED;
00065   const Gecode::ModEvent ME_INT_BND = Gecode::ME_GEN_ASSIGNED + 1;
00072   const Gecode::ModEvent ME_INT_DOM = Gecode::ME_GEN_ASSIGNED + 2;
00074   const Gecode::PropCond PC_INT_NONE = Gecode::PC_GEN_NONE;
00082   const Gecode::PropCond PC_INT_VAL = Gecode::PC_GEN_ASSIGNED;
00091   const Gecode::PropCond PC_INT_BND = Gecode::PC_GEN_ASSIGNED + 1;
00100   const Gecode::PropCond PC_INT_DOM = Gecode::PC_GEN_ASSIGNED + 2;
00102 }}
00103 #endif
00104 #ifdef GECODE_HAS_INT_VARS
00105 namespace Gecode { namespace Int {
00111 
00112   const Gecode::ModEvent ME_BOOL_FAILED = Gecode::ME_GEN_FAILED;
00114   const Gecode::ModEvent ME_BOOL_NONE = Gecode::ME_GEN_NONE;
00116   const Gecode::ModEvent ME_BOOL_VAL = Gecode::ME_GEN_ASSIGNED;
00118   const Gecode::PropCond PC_BOOL_NONE = Gecode::PC_GEN_NONE;
00126   const Gecode::PropCond PC_BOOL_VAL = Gecode::PC_GEN_ASSIGNED;
00128 }}
00129 #endif
00130 #ifdef GECODE_HAS_SET_VARS
00131 namespace Gecode { namespace Set {
00137 
00138   const Gecode::ModEvent ME_SET_FAILED = Gecode::ME_GEN_FAILED;
00140   const Gecode::ModEvent ME_SET_NONE = Gecode::ME_GEN_NONE;
00142   const Gecode::ModEvent ME_SET_VAL = Gecode::ME_GEN_ASSIGNED;
00148   const Gecode::ModEvent ME_SET_CARD = Gecode::ME_GEN_ASSIGNED + 1;
00156   const Gecode::ModEvent ME_SET_LUB = Gecode::ME_GEN_ASSIGNED + 2;
00164   const Gecode::ModEvent ME_SET_GLB = Gecode::ME_GEN_ASSIGNED + 3;
00172   const Gecode::ModEvent ME_SET_BB = Gecode::ME_GEN_ASSIGNED + 4;
00179   const Gecode::ModEvent ME_SET_CLUB = Gecode::ME_GEN_ASSIGNED + 5;
00186   const Gecode::ModEvent ME_SET_CGLB = Gecode::ME_GEN_ASSIGNED + 6;
00197   const Gecode::ModEvent ME_SET_CBB = Gecode::ME_GEN_ASSIGNED + 7;
00199   const Gecode::PropCond PC_SET_NONE = Gecode::PC_GEN_NONE;
00207   const Gecode::PropCond PC_SET_VAL = Gecode::PC_GEN_ASSIGNED;
00216   const Gecode::PropCond PC_SET_CARD = Gecode::PC_GEN_ASSIGNED + 1;
00227   const Gecode::PropCond PC_SET_CLUB = Gecode::PC_GEN_ASSIGNED + 2;
00238   const Gecode::PropCond PC_SET_CGLB = Gecode::PC_GEN_ASSIGNED + 3;
00248   const Gecode::PropCond PC_SET_ANY = Gecode::PC_GEN_ASSIGNED + 4;
00250 }}
00251 #endif
00252 #ifdef GECODE_HAS_FLOAT_VARS
00253 namespace Gecode { namespace Float {
00259 
00260   const Gecode::ModEvent ME_FLOAT_FAILED = Gecode::ME_GEN_FAILED;
00262   const Gecode::ModEvent ME_FLOAT_NONE = Gecode::ME_GEN_NONE;
00264   const Gecode::ModEvent ME_FLOAT_VAL = Gecode::ME_GEN_ASSIGNED;
00273   const Gecode::ModEvent ME_FLOAT_BND = Gecode::ME_GEN_ASSIGNED + 1;
00275   const Gecode::PropCond PC_FLOAT_NONE = Gecode::PC_GEN_NONE;
00283   const Gecode::PropCond PC_FLOAT_VAL = Gecode::PC_GEN_ASSIGNED;
00292   const Gecode::PropCond PC_FLOAT_BND = Gecode::PC_GEN_ASSIGNED + 1;
00294 }}
00295 #endif
00296 #ifdef GECODE_HAS_INT_VARS
00297 namespace Gecode { namespace Int {
00299   class IntVarImpConf {
00300   public:
00302     static const int idx_c = 0;
00304     static const int idx_d = -1;
00306     static const Gecode::PropCond pc_max = PC_INT_DOM;
00308     static const int free_bits = 0;
00310     static const int med_fst = 0;
00312     static const int med_lst = med_fst + 2;
00314     static const int med_mask = ((1 << 2) - 1) << med_fst;
00316     static Gecode::ModEvent me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2);
00318     static bool med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me);
00319   };
00320 }}
00321 #else
00322 namespace Gecode { namespace Int {
00324   class IntVarImpConf {
00325   public:
00327     static const int idx_c = -1;
00329     static const int idx_d = -1;
00331     static const int med_lst = 0;
00332   };
00333 }}
00334 #endif
00335 #ifdef GECODE_HAS_INT_VARS
00336 namespace Gecode { namespace Int {
00338   class BoolVarImpConf {
00339   public:
00341     static const int idx_c = Gecode::Int::IntVarImpConf::idx_c+1;
00343     static const int idx_d = Gecode::Int::IntVarImpConf::idx_d;
00345     static const Gecode::PropCond pc_max = PC_BOOL_VAL;
00347     static const int free_bits = 2;
00349     static const int med_fst = Gecode::Int::IntVarImpConf::med_lst;
00351     static const int med_lst = med_fst + 1;
00353     static const int med_mask = ((1 << 1) - 1) << med_fst;
00355     static Gecode::ModEvent me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2);
00357     static bool med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me);
00358   };
00359 }}
00360 #else
00361 namespace Gecode { namespace Int {
00363   class BoolVarImpConf {
00364   public:
00366     static const int idx_c = Gecode::Int::IntVarImpConf::idx_c;
00368     static const int idx_d = Gecode::Int::IntVarImpConf::idx_d;
00370     static const int med_lst = Gecode::Int::IntVarImpConf::med_lst;
00371   };
00372 }}
00373 #endif
00374 #ifdef GECODE_HAS_SET_VARS
00375 namespace Gecode { namespace Set {
00377   class SetVarImpConf {
00378   public:
00380     static const int idx_c = Gecode::Int::BoolVarImpConf::idx_c+1;
00382     static const int idx_d = Gecode::Int::BoolVarImpConf::idx_d;
00384     static const Gecode::PropCond pc_max = PC_SET_ANY;
00386     static const int free_bits = 0;
00388     static const int med_fst = Gecode::Int::BoolVarImpConf::med_lst;
00390     static const int med_lst = med_fst + 4;
00392     static const int med_mask = ((1 << 4) - 1) << med_fst;
00394     static Gecode::ModEvent me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2);
00396     static bool med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me);
00397   };
00398 }}
00399 #else
00400 namespace Gecode { namespace Set {
00402   class SetVarImpConf {
00403   public:
00405     static const int idx_c = Gecode::Int::BoolVarImpConf::idx_c;
00407     static const int idx_d = Gecode::Int::BoolVarImpConf::idx_d;
00409     static const int med_lst = Gecode::Int::BoolVarImpConf::med_lst;
00410   };
00411 }}
00412 #endif
00413 #ifdef GECODE_HAS_FLOAT_VARS
00414 namespace Gecode { namespace Float {
00416   class FloatVarImpConf {
00417   public:
00419     static const int idx_c = Gecode::Set::SetVarImpConf::idx_c+1;
00421     static const int idx_d = Gecode::Set::SetVarImpConf::idx_d;
00423     static const Gecode::PropCond pc_max = PC_FLOAT_BND;
00425     static const int free_bits = 0;
00427     static const int med_fst = Gecode::Set::SetVarImpConf::med_lst;
00429     static const int med_lst = med_fst + 2;
00431     static const int med_mask = ((1 << 2) - 1) << med_fst;
00433     static Gecode::ModEvent me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2);
00435     static bool med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me);
00436   };
00437 }}
00438 #else
00439 namespace Gecode { namespace Float {
00441   class FloatVarImpConf {
00442   public:
00444     static const int idx_c = Gecode::Set::SetVarImpConf::idx_c;
00446     static const int idx_d = Gecode::Set::SetVarImpConf::idx_d;
00448     static const int med_lst = Gecode::Set::SetVarImpConf::med_lst;
00449   };
00450 }}
00451 #endif
00452 
00453 namespace Gecode {
00454 
00456   class AllVarConf {
00457   public:
00459     static const int idx_c = Gecode::Float::FloatVarImpConf::idx_c+1;
00461     static const int idx_d = Gecode::Float::FloatVarImpConf::idx_d+1;
00463     static ModEventDelta med_combine(ModEventDelta med1, ModEventDelta med2);
00464   };
00465 
00466 }
00467 
00468 #ifdef GECODE_HAS_INT_VARS
00469 namespace Gecode { namespace Int {
00470   forceinline Gecode::ModEvent
00471   IntVarImpConf::me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2) {
00472     static const Gecode::ModEvent me_c = (
00473       (
00474         (ME_INT_NONE <<  0) |  // [ME_INT_NONE][ME_INT_NONE]
00475         (ME_INT_VAL  <<  2) |  // [ME_INT_NONE][ME_INT_VAL ]
00476         (ME_INT_BND  <<  4) |  // [ME_INT_NONE][ME_INT_BND ]
00477         (ME_INT_DOM  <<  6)    // [ME_INT_NONE][ME_INT_DOM ]
00478       ) |
00479       (
00480         (ME_INT_VAL  <<  8) |  // [ME_INT_VAL ][ME_INT_NONE]
00481         (ME_INT_VAL  << 10) |  // [ME_INT_VAL ][ME_INT_VAL ]
00482         (ME_INT_VAL  << 12) |  // [ME_INT_VAL ][ME_INT_BND ]
00483         (ME_INT_VAL  << 14)    // [ME_INT_VAL ][ME_INT_DOM ]
00484       ) |
00485       (
00486         (ME_INT_BND  << 16) |  // [ME_INT_BND ][ME_INT_NONE]
00487         (ME_INT_VAL  << 18) |  // [ME_INT_BND ][ME_INT_VAL ]
00488         (ME_INT_BND  << 20) |  // [ME_INT_BND ][ME_INT_BND ]
00489         (ME_INT_BND  << 22)    // [ME_INT_BND ][ME_INT_DOM ]
00490       ) |
00491       (
00492         (ME_INT_DOM  << 24) |  // [ME_INT_DOM ][ME_INT_NONE]
00493         (ME_INT_VAL  << 26) |  // [ME_INT_DOM ][ME_INT_VAL ]
00494         (ME_INT_BND  << 28) |  // [ME_INT_DOM ][ME_INT_BND ]
00495         (ME_INT_DOM  << 30)    // [ME_INT_DOM ][ME_INT_DOM ]
00496       )
00497     );
00498     return ((me_c >> (me2 << 3)) >> (me1 << 1)) & 3;
00499   }
00500   forceinline bool
00501   IntVarImpConf::med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me) {
00502     switch (me) {
00503     case ME_INT_NONE:
00504       return false;
00505     case ME_INT_VAL:
00506       {
00507         Gecode::ModEventDelta med_int = med & med_mask;
00508         if (med_int == (ME_INT_VAL << med_fst))
00509           return false;
00510         med ^= med_int;
00511         med ^= ME_INT_VAL << med_fst;
00512         break;
00513       }
00514     case ME_INT_BND:
00515       {
00516         static const Gecode::ModEvent me_c = (
00517           ((ME_INT_NONE ^ ME_INT_BND ) <<  0) |
00518           ((ME_INT_VAL  ^ ME_INT_VAL ) <<  4) |
00519           ((ME_INT_BND  ^ ME_INT_BND ) <<  8) |
00520           ((ME_INT_DOM  ^ ME_INT_BND ) << 12)
00521         );
00522         Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
00523         Gecode::ModEvent me_n = (me_c >> (me_o << 2)) & (med_mask >> med_fst);
00524         if (me_n == 0)
00525           return false;
00526         med ^= me_n << med_fst;
00527         break;
00528       }
00529     case ME_INT_DOM:
00530       {
00531         Gecode::ModEventDelta med_int = med & med_mask;
00532         if (med_int != 0)
00533           return false;
00534         med |= ME_INT_DOM << med_fst;
00535         break;
00536       }
00537     default: GECODE_NEVER;
00538     }
00539     return true;
00540   }
00541 
00542 }}
00543 #endif
00544 #ifdef GECODE_HAS_INT_VARS
00545 namespace Gecode { namespace Int {
00546   forceinline Gecode::ModEvent
00547   BoolVarImpConf::me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2) {
00548     return me1 | me2;
00549   }
00550   forceinline bool
00551   BoolVarImpConf::med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me) {
00552     switch (me) {
00553     case ME_BOOL_NONE:
00554       return false;
00555     case ME_BOOL_VAL:
00556       if ((med & (ME_BOOL_VAL << med_fst)) != 0)
00557         return false;
00558       med |= ME_BOOL_VAL << med_fst;
00559       break;
00560     default: GECODE_NEVER;
00561     }
00562     return true;
00563   }
00564 
00565 }}
00566 #endif
00567 #ifdef GECODE_HAS_SET_VARS
00568 namespace Gecode { namespace Set {
00569   forceinline Gecode::ModEvent
00570   SetVarImpConf::me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2) {
00571     static const Gecode::ModEvent me_c[ME_SET_CBB+1][ME_SET_CBB+1] = {
00572       {
00573         ME_SET_NONE, // [ME_SET_NONE][ME_SET_NONE]
00574         ME_SET_VAL , // [ME_SET_NONE][ME_SET_VAL ]
00575         ME_SET_CARD, // [ME_SET_NONE][ME_SET_CARD]
00576         ME_SET_LUB , // [ME_SET_NONE][ME_SET_LUB ]
00577         ME_SET_GLB , // [ME_SET_NONE][ME_SET_GLB ]
00578         ME_SET_BB  , // [ME_SET_NONE][ME_SET_BB  ]
00579         ME_SET_CLUB, // [ME_SET_NONE][ME_SET_CLUB]
00580         ME_SET_CGLB, // [ME_SET_NONE][ME_SET_CGLB]
00581         ME_SET_CBB   // [ME_SET_NONE][ME_SET_CBB ]
00582       },
00583       {
00584         ME_SET_VAL , // [ME_SET_VAL ][ME_SET_NONE]
00585         ME_SET_VAL , // [ME_SET_VAL ][ME_SET_VAL ]
00586         ME_SET_VAL , // [ME_SET_VAL ][ME_SET_CARD]
00587         ME_SET_VAL , // [ME_SET_VAL ][ME_SET_LUB ]
00588         ME_SET_VAL , // [ME_SET_VAL ][ME_SET_GLB ]
00589         ME_SET_VAL , // [ME_SET_VAL ][ME_SET_BB  ]
00590         ME_SET_VAL , // [ME_SET_VAL ][ME_SET_CLUB]
00591         ME_SET_VAL , // [ME_SET_VAL ][ME_SET_CGLB]
00592         ME_SET_VAL   // [ME_SET_VAL ][ME_SET_CBB ]
00593       },
00594       {
00595         ME_SET_CARD, // [ME_SET_CARD][ME_SET_NONE]
00596         ME_SET_VAL , // [ME_SET_CARD][ME_SET_VAL ]
00597         ME_SET_CARD, // [ME_SET_CARD][ME_SET_CARD]
00598         ME_SET_CLUB, // [ME_SET_CARD][ME_SET_LUB ]
00599         ME_SET_CGLB, // [ME_SET_CARD][ME_SET_GLB ]
00600         ME_SET_CBB , // [ME_SET_CARD][ME_SET_BB  ]
00601         ME_SET_CLUB, // [ME_SET_CARD][ME_SET_CLUB]
00602         ME_SET_CGLB, // [ME_SET_CARD][ME_SET_CGLB]
00603         ME_SET_CBB   // [ME_SET_CARD][ME_SET_CBB ]
00604       },
00605       {
00606         ME_SET_LUB , // [ME_SET_LUB ][ME_SET_NONE]
00607         ME_SET_VAL , // [ME_SET_LUB ][ME_SET_VAL ]
00608         ME_SET_CLUB, // [ME_SET_LUB ][ME_SET_CARD]
00609         ME_SET_LUB , // [ME_SET_LUB ][ME_SET_LUB ]
00610         ME_SET_BB  , // [ME_SET_LUB ][ME_SET_GLB ]
00611         ME_SET_BB  , // [ME_SET_LUB ][ME_SET_BB  ]
00612         ME_SET_CLUB, // [ME_SET_LUB ][ME_SET_CLUB]
00613         ME_SET_CBB , // [ME_SET_LUB ][ME_SET_CGLB]
00614         ME_SET_CBB   // [ME_SET_LUB ][ME_SET_CBB ]
00615       },
00616       {
00617         ME_SET_GLB , // [ME_SET_GLB ][ME_SET_NONE]
00618         ME_SET_VAL , // [ME_SET_GLB ][ME_SET_VAL ]
00619         ME_SET_CGLB, // [ME_SET_GLB ][ME_SET_CARD]
00620         ME_SET_BB  , // [ME_SET_GLB ][ME_SET_LUB ]
00621         ME_SET_GLB , // [ME_SET_GLB ][ME_SET_GLB ]
00622         ME_SET_BB  , // [ME_SET_GLB ][ME_SET_BB  ]
00623         ME_SET_CBB , // [ME_SET_GLB ][ME_SET_CLUB]
00624         ME_SET_CGLB, // [ME_SET_GLB ][ME_SET_CGLB]
00625         ME_SET_CBB   // [ME_SET_GLB ][ME_SET_CBB ]
00626       },
00627       {
00628         ME_SET_BB  , // [ME_SET_BB  ][ME_SET_NONE]
00629         ME_SET_VAL , // [ME_SET_BB  ][ME_SET_VAL ]
00630         ME_SET_CBB , // [ME_SET_BB  ][ME_SET_CARD]
00631         ME_SET_BB  , // [ME_SET_BB  ][ME_SET_LUB ]
00632         ME_SET_BB  , // [ME_SET_BB  ][ME_SET_GLB ]
00633         ME_SET_BB  , // [ME_SET_BB  ][ME_SET_BB  ]
00634         ME_SET_CBB , // [ME_SET_BB  ][ME_SET_CLUB]
00635         ME_SET_CBB , // [ME_SET_BB  ][ME_SET_CGLB]
00636         ME_SET_CBB   // [ME_SET_BB  ][ME_SET_CBB ]
00637       },
00638       {
00639         ME_SET_CLUB, // [ME_SET_CLUB][ME_SET_NONE]
00640         ME_SET_VAL , // [ME_SET_CLUB][ME_SET_VAL ]
00641         ME_SET_CLUB, // [ME_SET_CLUB][ME_SET_CARD]
00642         ME_SET_CLUB, // [ME_SET_CLUB][ME_SET_LUB ]
00643         ME_SET_CBB , // [ME_SET_CLUB][ME_SET_GLB ]
00644         ME_SET_CBB , // [ME_SET_CLUB][ME_SET_BB  ]
00645         ME_SET_CLUB, // [ME_SET_CLUB][ME_SET_CLUB]
00646         ME_SET_CBB , // [ME_SET_CLUB][ME_SET_CGLB]
00647         ME_SET_CBB   // [ME_SET_CLUB][ME_SET_CBB ]
00648       },
00649       {
00650         ME_SET_CGLB, // [ME_SET_CGLB][ME_SET_NONE]
00651         ME_SET_VAL , // [ME_SET_CGLB][ME_SET_VAL ]
00652         ME_SET_CGLB, // [ME_SET_CGLB][ME_SET_CARD]
00653         ME_SET_CBB , // [ME_SET_CGLB][ME_SET_LUB ]
00654         ME_SET_CGLB, // [ME_SET_CGLB][ME_SET_GLB ]
00655         ME_SET_CBB , // [ME_SET_CGLB][ME_SET_BB  ]
00656         ME_SET_CBB , // [ME_SET_CGLB][ME_SET_CLUB]
00657         ME_SET_CGLB, // [ME_SET_CGLB][ME_SET_CGLB]
00658         ME_SET_CBB   // [ME_SET_CGLB][ME_SET_CBB ]
00659       },
00660       {
00661         ME_SET_CBB , // [ME_SET_CBB ][ME_SET_NONE]
00662         ME_SET_VAL , // [ME_SET_CBB ][ME_SET_VAL ]
00663         ME_SET_CBB , // [ME_SET_CBB ][ME_SET_CARD]
00664         ME_SET_CBB , // [ME_SET_CBB ][ME_SET_LUB ]
00665         ME_SET_CBB , // [ME_SET_CBB ][ME_SET_GLB ]
00666         ME_SET_CBB , // [ME_SET_CBB ][ME_SET_BB  ]
00667         ME_SET_CBB , // [ME_SET_CBB ][ME_SET_CLUB]
00668         ME_SET_CBB , // [ME_SET_CBB ][ME_SET_CGLB]
00669         ME_SET_CBB   // [ME_SET_CBB ][ME_SET_CBB ]
00670       }
00671     };
00672     return me_c[me1][me2];
00673   }
00674   forceinline bool
00675   SetVarImpConf::med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me) {
00676     switch (me) {
00677     case ME_SET_NONE:
00678       return false;
00679     case ME_SET_VAL:
00680       {
00681         Gecode::ModEventDelta med_set = med & med_mask;
00682         if (med_set == (ME_SET_VAL << med_fst))
00683           return false;
00684         med ^= med_set;
00685         med ^= ME_SET_VAL << med_fst;
00686         break;
00687       }
00688     case ME_SET_CARD:
00689       {
00690         static const Gecode::ModEventDelta me_c[ME_SET_CBB+1] = {
00691           (ME_SET_NONE ^ ME_SET_CARD) << med_fst,
00692           (ME_SET_VAL  ^ ME_SET_VAL ) << med_fst,
00693           (ME_SET_CARD ^ ME_SET_CARD) << med_fst,
00694           (ME_SET_LUB  ^ ME_SET_CLUB) << med_fst,
00695           (ME_SET_GLB  ^ ME_SET_CGLB) << med_fst,
00696           (ME_SET_BB   ^ ME_SET_CBB ) << med_fst,
00697           (ME_SET_CLUB ^ ME_SET_CLUB) << med_fst,
00698           (ME_SET_CGLB ^ ME_SET_CGLB) << med_fst,
00699           (ME_SET_CBB  ^ ME_SET_CBB ) << med_fst
00700         };
00701         Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
00702         Gecode::ModEventDelta med_n = me_c[me_o];
00703         if (med_n == 0)
00704           return false;
00705         med ^= med_n;
00706         break;
00707       }
00708     case ME_SET_LUB:
00709       {
00710         static const Gecode::ModEventDelta me_c[ME_SET_CBB+1] = {
00711           (ME_SET_NONE ^ ME_SET_LUB ) << med_fst,
00712           (ME_SET_VAL  ^ ME_SET_VAL ) << med_fst,
00713           (ME_SET_CARD ^ ME_SET_CLUB) << med_fst,
00714           (ME_SET_LUB  ^ ME_SET_LUB ) << med_fst,
00715           (ME_SET_GLB  ^ ME_SET_BB  ) << med_fst,
00716           (ME_SET_BB   ^ ME_SET_BB  ) << med_fst,
00717           (ME_SET_CLUB ^ ME_SET_CLUB) << med_fst,
00718           (ME_SET_CGLB ^ ME_SET_CBB ) << med_fst,
00719           (ME_SET_CBB  ^ ME_SET_CBB ) << med_fst
00720         };
00721         Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
00722         Gecode::ModEventDelta med_n = me_c[me_o];
00723         if (med_n == 0)
00724           return false;
00725         med ^= med_n;
00726         break;
00727       }
00728     case ME_SET_GLB:
00729       {
00730         static const Gecode::ModEventDelta me_c[ME_SET_CBB+1] = {
00731           (ME_SET_NONE ^ ME_SET_GLB ) << med_fst,
00732           (ME_SET_VAL  ^ ME_SET_VAL ) << med_fst,
00733           (ME_SET_CARD ^ ME_SET_CGLB) << med_fst,
00734           (ME_SET_LUB  ^ ME_SET_BB  ) << med_fst,
00735           (ME_SET_GLB  ^ ME_SET_GLB ) << med_fst,
00736           (ME_SET_BB   ^ ME_SET_BB  ) << med_fst,
00737           (ME_SET_CLUB ^ ME_SET_CBB ) << med_fst,
00738           (ME_SET_CGLB ^ ME_SET_CGLB) << med_fst,
00739           (ME_SET_CBB  ^ ME_SET_CBB ) << med_fst
00740         };
00741         Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
00742         Gecode::ModEventDelta med_n = me_c[me_o];
00743         if (med_n == 0)
00744           return false;
00745         med ^= med_n;
00746         break;
00747       }
00748     case ME_SET_BB:
00749       {
00750         static const Gecode::ModEventDelta me_c[ME_SET_CBB+1] = {
00751           (ME_SET_NONE ^ ME_SET_BB  ) << med_fst,
00752           (ME_SET_VAL  ^ ME_SET_VAL ) << med_fst,
00753           (ME_SET_CARD ^ ME_SET_CBB ) << med_fst,
00754           (ME_SET_LUB  ^ ME_SET_BB  ) << med_fst,
00755           (ME_SET_GLB  ^ ME_SET_BB  ) << med_fst,
00756           (ME_SET_BB   ^ ME_SET_BB  ) << med_fst,
00757           (ME_SET_CLUB ^ ME_SET_CBB ) << med_fst,
00758           (ME_SET_CGLB ^ ME_SET_CBB ) << med_fst,
00759           (ME_SET_CBB  ^ ME_SET_CBB ) << med_fst
00760         };
00761         Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
00762         Gecode::ModEventDelta med_n = me_c[me_o];
00763         if (med_n == 0)
00764           return false;
00765         med ^= med_n;
00766         break;
00767       }
00768     case ME_SET_CLUB:
00769       {
00770         static const Gecode::ModEventDelta me_c[ME_SET_CBB+1] = {
00771           (ME_SET_NONE ^ ME_SET_CLUB) << med_fst,
00772           (ME_SET_VAL  ^ ME_SET_VAL ) << med_fst,
00773           (ME_SET_CARD ^ ME_SET_CLUB) << med_fst,
00774           (ME_SET_LUB  ^ ME_SET_CLUB) << med_fst,
00775           (ME_SET_GLB  ^ ME_SET_CBB ) << med_fst,
00776           (ME_SET_BB   ^ ME_SET_CBB ) << med_fst,
00777           (ME_SET_CLUB ^ ME_SET_CLUB) << med_fst,
00778           (ME_SET_CGLB ^ ME_SET_CBB ) << med_fst,
00779           (ME_SET_CBB  ^ ME_SET_CBB ) << med_fst
00780         };
00781         Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
00782         Gecode::ModEventDelta med_n = me_c[me_o];
00783         if (med_n == 0)
00784           return false;
00785         med ^= med_n;
00786         break;
00787       }
00788     case ME_SET_CGLB:
00789       {
00790         static const Gecode::ModEventDelta me_c[ME_SET_CBB+1] = {
00791           (ME_SET_NONE ^ ME_SET_CGLB) << med_fst,
00792           (ME_SET_VAL  ^ ME_SET_VAL ) << med_fst,
00793           (ME_SET_CARD ^ ME_SET_CGLB) << med_fst,
00794           (ME_SET_LUB  ^ ME_SET_CBB ) << med_fst,
00795           (ME_SET_GLB  ^ ME_SET_CGLB) << med_fst,
00796           (ME_SET_BB   ^ ME_SET_CBB ) << med_fst,
00797           (ME_SET_CLUB ^ ME_SET_CBB ) << med_fst,
00798           (ME_SET_CGLB ^ ME_SET_CGLB) << med_fst,
00799           (ME_SET_CBB  ^ ME_SET_CBB ) << med_fst
00800         };
00801         Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
00802         Gecode::ModEventDelta med_n = me_c[me_o];
00803         if (med_n == 0)
00804           return false;
00805         med ^= med_n;
00806         break;
00807       }
00808     case ME_SET_CBB:
00809       {
00810         static const Gecode::ModEventDelta me_c[ME_SET_CBB+1] = {
00811           (ME_SET_NONE ^ ME_SET_CBB ) << med_fst,
00812           (ME_SET_VAL  ^ ME_SET_VAL ) << med_fst,
00813           (ME_SET_CARD ^ ME_SET_CBB ) << med_fst,
00814           (ME_SET_LUB  ^ ME_SET_CBB ) << med_fst,
00815           (ME_SET_GLB  ^ ME_SET_CBB ) << med_fst,
00816           (ME_SET_BB   ^ ME_SET_CBB ) << med_fst,
00817           (ME_SET_CLUB ^ ME_SET_CBB ) << med_fst,
00818           (ME_SET_CGLB ^ ME_SET_CBB ) << med_fst,
00819           (ME_SET_CBB  ^ ME_SET_CBB ) << med_fst
00820         };
00821         Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
00822         Gecode::ModEventDelta med_n = me_c[me_o];
00823         if (med_n == 0)
00824           return false;
00825         med ^= med_n;
00826         break;
00827       }
00828     default: GECODE_NEVER;
00829     }
00830     return true;
00831   }
00832 
00833 }}
00834 #endif
00835 #ifdef GECODE_HAS_FLOAT_VARS
00836 namespace Gecode { namespace Float {
00837   forceinline Gecode::ModEvent
00838   FloatVarImpConf::me_combine(Gecode::ModEvent me1, Gecode::ModEvent me2) {
00839     static const Gecode::ModEvent me_c = (
00840       (
00841         (ME_FLOAT_NONE <<  0) |  // [ME_FLOAT_NONE][ME_FLOAT_NONE]
00842         (ME_FLOAT_VAL  <<  2) |  // [ME_FLOAT_NONE][ME_FLOAT_VAL ]
00843         (ME_FLOAT_BND  <<  4)    // [ME_FLOAT_NONE][ME_FLOAT_BND ]
00844       ) |
00845       (
00846         (ME_FLOAT_VAL  <<  8) |  // [ME_FLOAT_VAL ][ME_FLOAT_NONE]
00847         (ME_FLOAT_VAL  << 10) |  // [ME_FLOAT_VAL ][ME_FLOAT_VAL ]
00848         (ME_FLOAT_VAL  << 12)    // [ME_FLOAT_VAL ][ME_FLOAT_BND ]
00849       ) |
00850       (
00851         (ME_FLOAT_BND  << 16) |  // [ME_FLOAT_BND ][ME_FLOAT_NONE]
00852         (ME_FLOAT_VAL  << 18) |  // [ME_FLOAT_BND ][ME_FLOAT_VAL ]
00853         (ME_FLOAT_BND  << 20)    // [ME_FLOAT_BND ][ME_FLOAT_BND ]
00854       )
00855     );
00856     return ((me_c >> (me2 << 3)) >> (me1 << 1)) & 3;
00857   }
00858   forceinline bool
00859   FloatVarImpConf::med_update(Gecode::ModEventDelta& med, Gecode::ModEvent me) {
00860     switch (me) {
00861     case ME_FLOAT_NONE:
00862       return false;
00863     case ME_FLOAT_VAL:
00864       {
00865         Gecode::ModEventDelta med_float = med & med_mask;
00866         if (med_float == (ME_FLOAT_VAL << med_fst))
00867           return false;
00868         med ^= med_float;
00869         med ^= ME_FLOAT_VAL << med_fst;
00870         break;
00871       }
00872     case ME_FLOAT_BND:
00873       {
00874         Gecode::ModEventDelta med_float = med & med_mask;
00875         if (med_float != 0)
00876           return false;
00877         med |= ME_FLOAT_BND << med_fst;
00878         break;
00879       }
00880     default: GECODE_NEVER;
00881     }
00882     return true;
00883   }
00884 
00885 }}
00886 #endif
00887 namespace Gecode {
00888   forceinline ModEventDelta
00889   AllVarConf::med_combine(ModEventDelta med1, ModEventDelta med2) {
00890 #ifdef GECODE_HAS_INT_VARS
00891     (void) Gecode::Int::IntVarImpConf::med_update(med1,(med2 & Gecode::Int::IntVarImpConf::med_mask) >> Gecode::Int::IntVarImpConf::med_fst);
00892 #endif
00893 #ifdef GECODE_HAS_INT_VARS
00894     (void) Gecode::Int::BoolVarImpConf::med_update(med1,(med2 & Gecode::Int::BoolVarImpConf::med_mask) >> Gecode::Int::BoolVarImpConf::med_fst);
00895 #endif
00896 #ifdef GECODE_HAS_SET_VARS
00897     (void) Gecode::Set::SetVarImpConf::med_update(med1,(med2 & Gecode::Set::SetVarImpConf::med_mask) >> Gecode::Set::SetVarImpConf::med_fst);
00898 #endif
00899 #ifdef GECODE_HAS_FLOAT_VARS
00900     (void) Gecode::Float::FloatVarImpConf::med_update(med1,(med2 & Gecode::Float::FloatVarImpConf::med_mask) >> Gecode::Float::FloatVarImpConf::med_fst);
00901 #endif
00902     return med1;
00903   }
00904 }
00905 
00906 // STATISTICS: kernel-var