Generated on Wed Nov 1 15:04:40 2006 for Gecode by doxygen 1.4.5

imp-hdr.icc

Go to the documentation of this file.
00001 /*
00002  *  CAUTION:
00003  *    This file has been automatically generated.
00004  *    Do not edit, edit the file "gecode/int/var-imp.vis" instead.
00005  *
00006  *  This file contains generated code fragments which are 
00007  *  copyrighted as follows:
00008  *
00009  *  Main author:
00010  *     Christian Schulte <schulte@gecode.org>
00011  *
00012  *  Copyright:
00013  *     Christian Schulte, 2006
00014  *
00015  *  The generated code fragments are part of Gecode, the generic
00016  *  constraint development environment:
00017  *     http://www.gecode.org
00018  *
00019  *  See the file "LICENSE" for information on usage and
00020  *  redistribution of this file, and for a
00021  *     DISCLAIMER OF ALL WARRANTIES.
00022  *
00023  */
00024 
00025 
00026 namespace Gecode { namespace Int {
00027 
00034 
00035   const Gecode::ModEvent ME_INT_FAILED = Gecode::ME_GEN_FAILED;
00036 
00038   const Gecode::ModEvent ME_INT_NONE = Gecode::ME_GEN_NONE;
00039 
00041   const Gecode::ModEvent ME_INT_VAL = Gecode::ME_GEN_ASSIGNED;
00042 
00051   const Gecode::ModEvent ME_INT_BND = Gecode::ME_GEN_ASSIGNED + 1;
00052 
00061   const Gecode::ModEvent ME_INT_DOM = Gecode::ME_GEN_ASSIGNED + 2;
00062 
00070   const Gecode::PropCond PC_INT_VAL = Gecode::PC_GEN_ASSIGNED;
00071 
00080   const Gecode::PropCond PC_INT_BND = Gecode::PC_GEN_ASSIGNED + 1;
00081 
00090   const Gecode::PropCond PC_INT_DOM = Gecode::PC_GEN_ASSIGNED + 2;
00091 
00093 
00095   class IntMeDiff {
00096   public:
00098     ModEvent operator()(ModEvent me1, ModEvent me2) const;
00099   };
00100 
00102   class IntVarImpBase : public Gecode::Variable<VTI_INT,PC_INT_DOM,IntMeDiff> {
00103   protected:
00105     class Processor : public Gecode::VarTypeProcessor<VTI_INT,PC_INT_DOM,IntMeDiff> {
00106     public:
00108       GECODE_INT_EXPORT virtual void process(Space* home, VarBase* x);
00109     };
00111     GECODE_INT_EXPORT static Processor p;
00113     IntVarImpBase(Space* home, bool share, IntVarImpBase& x);
00114   public:
00116     IntVarImpBase(Space* home);
00118 
00119 
00131     void subscribe(Space* home, Propagator* p, PropCond pc, bool assigned, bool process);
00133     void notify(Space* home, ModEvent me);
00135 
00136 
00137   };
00138 
00139 
00140   forceinline ModEvent
00141   IntMeDiff::operator()(ModEvent me1, ModEvent me2) const {
00142     const int med = (
00143       (
00144         ((ME_INT_NONE ^ ME_INT_NONE) << 0) |  // [ME_INT_NONE][ME_INT_NONE]
00145         ((ME_INT_VAL ^ ME_INT_VAL) << 2) |  // [ME_INT_NONE][ME_INT_VAL]
00146         ((ME_INT_BND ^ ME_INT_BND) << 4) |  // [ME_INT_NONE][ME_INT_BND]
00147         ((ME_INT_DOM ^ ME_INT_DOM) << 6)    // [ME_INT_NONE][ME_INT_DOM]
00148       ) |
00149       (
00150         ((ME_INT_NONE ^ ME_INT_VAL) << 8) |  // [ME_INT_VAL][ME_INT_NONE]
00151         ((ME_INT_VAL ^ ME_INT_VAL) << 10) |  // [ME_INT_VAL][ME_INT_VAL]
00152         ((ME_INT_BND ^ ME_INT_VAL) << 12) |  // [ME_INT_VAL][ME_INT_BND]
00153         ((ME_INT_DOM ^ ME_INT_VAL) << 14)    // [ME_INT_VAL][ME_INT_DOM]
00154       ) |
00155       (
00156         ((ME_INT_NONE ^ ME_INT_BND) << 16) |  // [ME_INT_BND][ME_INT_NONE]
00157         ((ME_INT_VAL ^ ME_INT_VAL) << 18) |  // [ME_INT_BND][ME_INT_VAL]
00158         ((ME_INT_BND ^ ME_INT_BND) << 20) |  // [ME_INT_BND][ME_INT_BND]
00159         ((ME_INT_DOM ^ ME_INT_BND) << 22)    // [ME_INT_BND][ME_INT_DOM]
00160       ) |
00161       (
00162         ((ME_INT_NONE ^ ME_INT_DOM) << 24) |  // [ME_INT_DOM][ME_INT_NONE]
00163         ((ME_INT_VAL ^ ME_INT_VAL) << 26) |  // [ME_INT_DOM][ME_INT_VAL]
00164         ((ME_INT_BND ^ ME_INT_BND) << 28) |  // [ME_INT_DOM][ME_INT_BND]
00165         ((ME_INT_DOM ^ ME_INT_DOM) << 30)    // [ME_INT_DOM][ME_INT_DOM]
00166       )
00167     );
00168     return (((med >> (me1 << 3)) >> (me2 << 1)) & 3);
00169   }
00170 
00171   forceinline
00172   IntVarImpBase::IntVarImpBase(Space* home)
00173     : Gecode::Variable<VTI_INT,PC_INT_DOM,IntMeDiff>(home) {}
00174 
00175   forceinline
00176   IntVarImpBase::IntVarImpBase(Space* home, bool share, IntVarImpBase& x)
00177     : Gecode::Variable<VTI_INT,PC_INT_DOM,IntMeDiff>(home,share,x) {}
00178 
00179   forceinline void
00180   IntVarImpBase::subscribe(Space* home, Propagator* p, PropCond pc, bool assigned, bool process) {
00181     Gecode::Variable<VTI_INT,PC_INT_DOM,IntMeDiff>::subscribe(home,p,pc,assigned,ME_INT_BND,process);
00182   }
00183 
00184   forceinline void
00185   IntVarImpBase::notify(Space* home, ModEvent me) {
00186     Gecode::Variable<VTI_INT,PC_INT_DOM,IntMeDiff>::notify(home,me);
00187   }
00188 
00189 }}
00190 
00191 // STATISTICS: int-var