Generated on Mon Aug 25 11:35:40 2008 for Gecode by doxygen 1.5.6

var-type.icc

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