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

rel.hh

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Guido Tack <tack@gecode.org>
00005  *     Christian Schulte <schulte@gecode.org>
00006  *
00007  *  Contributing authors:
00008  *     Gabor Szokoli <szokoli@gecode.org>
00009  *
00010  *  Copyright:
00011  *     Guido Tack, 2004
00012  *     Christian Schulte, 2004
00013  *     Gabor Szokoli, 2004
00014  *
00015  *  Last modified:
00016  *     $Date: 2008-01-29 13:37:51 +0100 (Tue, 29 Jan 2008) $ by $Author: tack $
00017  *     $Revision: 5993 $
00018  *
00019  *  This file is part of Gecode, the generic constraint
00020  *  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 #ifndef __GECODE_SET_REL_HH__
00045 #define __GECODE_SET_REL_HH__
00046 
00047 #include "gecode/set.hh"
00048 
00049 namespace Gecode { namespace Set { namespace Rel {
00050 
00063   template <class View0, class View1>
00064   class SubSet :
00065     public MixBinaryPropagator<View0,PC_SET_CGLB,View1,PC_SET_CLUB> {
00066   protected:
00067     using MixBinaryPropagator<View0,PC_SET_CGLB,View1,PC_SET_CLUB>::x0;
00068     using MixBinaryPropagator<View0,PC_SET_CGLB,View1,PC_SET_CLUB>::x1;
00070     SubSet(Space* home, bool share,SubSet& p);
00072     SubSet(Space* home,View0, View1);
00073   public:
00075     virtual Actor*      copy(Space* home,bool);
00077     virtual ExecStatus propagate(Space* home, ModEventDelta med);
00079     static  ExecStatus post(Space* home,View0 x,View1 y);
00081     virtual Reflection::ActorSpec spec(const Space* home,
00082                                         Reflection::VarMap& m) const;
00084     static void post(Space* home, Reflection::VarMap& vars,
00085                      const Reflection::ActorSpec& spec);
00087     static Support::Symbol ati(void);
00088   };
00089 
00097   template <class View0, class View1>
00098   class NoSubSet :
00099     public MixBinaryPropagator<View0,PC_SET_CLUB,View1,PC_SET_CGLB> {
00100   protected:
00101     using MixBinaryPropagator<View0,PC_SET_CLUB,View1,PC_SET_CGLB>::x0;
00102     using MixBinaryPropagator<View0,PC_SET_CLUB,View1,PC_SET_CGLB>::x1;
00104     NoSubSet(Space* home, bool share,NoSubSet& p);
00106     NoSubSet(Space* home,View0,View1);
00107   public:
00109     virtual Actor*      copy(Space* home,bool);
00111     virtual ExecStatus propagate(Space* home, ModEventDelta med);
00113     static  ExecStatus post(Space* home,View0 x,View1 y);
00115     virtual Reflection::ActorSpec spec(const Space* home,
00116                                         Reflection::VarMap& m) const;
00118     static void post(Space* home, Reflection::VarMap& vars,
00119                      const Reflection::ActorSpec& spec);
00121     static Support::Symbol ati(void);
00122   };
00123 
00130   template <class View0, class View1>
00131   class ReSubset :
00132     public Propagator {
00133   protected:
00134     View0 x0;
00135     View1 x1;
00136     Gecode::Int::BoolView b;
00137 
00139     ReSubset(Space* home, bool share,ReSubset&);
00141     ReSubset(Space* home,View0, View1, Gecode::Int::BoolView);
00142   public:
00144     virtual Actor*      copy(Space* home,bool);
00146     virtual PropCost cost(ModEventDelta med) const;
00148     virtual size_t dispose(Space* home);
00150     virtual ExecStatus propagate(Space* home, ModEventDelta med);
00152     static ExecStatus post(Space* home,View0 x, View1 y,
00153                            Gecode::Int::BoolView b);
00155     virtual Reflection::ActorSpec spec(const Space* home,
00156                                         Reflection::VarMap& m) const;
00158     static void post(Space* home, Reflection::VarMap& vars,
00159                      const Reflection::ActorSpec& spec);
00161     static Support::Symbol ati(void);
00162   };
00163 
00171   template <class View0, class View1>
00172   class Eq : 
00173     public MixBinaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY> {
00174   protected:
00175     using MixBinaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x0;
00176     using MixBinaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x1;
00178     Eq(Space* home, bool share,Eq& p);
00180     Eq(Space* home,View0, View1);
00181   public:
00183     virtual Actor*      copy(Space* home,bool);
00185     virtual ExecStatus  propagate(Space* home, ModEventDelta med);
00187     static  ExecStatus  post(Space* home,View0,View1);
00189     virtual Reflection::ActorSpec spec(const Space* home,
00190                                         Reflection::VarMap& m) const;
00192     static void post(Space* home, Reflection::VarMap& vars,
00193                      const Reflection::ActorSpec& spec);
00195     static Support::Symbol ati(void);
00196   };
00197 
00204   template <class View0, class View1>
00205   class ReEq :
00206     public Propagator {
00207   protected:
00208     View0 x0;
00209     View1 x1;
00210     Gecode::Int::BoolView b;
00211 
00213     ReEq(Space* home, bool share,ReEq&);
00215     ReEq(Space* home,View0, View1, Gecode::Int::BoolView);
00216   public:
00218     virtual Actor*      copy(Space* home,bool);
00220     virtual PropCost cost(ModEventDelta med) const;
00222     virtual size_t dispose(Space* home);
00224     virtual ExecStatus propagate(Space* home, ModEventDelta med);
00226     static ExecStatus post(Space* home,View0 x, View1 y,
00227                            Gecode::Int::BoolView b);
00229     virtual Reflection::ActorSpec spec(const Space* home,
00230                                         Reflection::VarMap& m) const;
00232     static void post(Space* home, Reflection::VarMap& vars,
00233                      const Reflection::ActorSpec& spec);
00235     static Support::Symbol ati(void);
00236   };
00237 
00245   template <class View0, class View1>
00246   class Distinct :
00247     public MixBinaryPropagator<View0,PC_SET_VAL,View1,PC_SET_VAL> {
00248   protected:
00249     using MixBinaryPropagator<View0,PC_SET_VAL,View1,PC_SET_VAL>::x0;
00250     using MixBinaryPropagator<View0,PC_SET_VAL,View1,PC_SET_VAL>::x1;
00252     Distinct(Space* home, bool share,Distinct& p);
00254     Distinct(Space* home,View0,View1);
00255   public:
00257     virtual Actor*      copy(Space* home,bool);
00259     virtual ExecStatus  propagate(Space* home, ModEventDelta med);
00261     static  ExecStatus  post(Space* home,View0,View1);
00263     virtual Reflection::ActorSpec spec(const Space* home,
00264                                         Reflection::VarMap& m) const;
00266     static void post(Space* home, Reflection::VarMap& vars,
00267                      const Reflection::ActorSpec& spec);
00269     static Support::Symbol ati(void);
00270   };
00271 
00282   template <class View0>
00283   class DistinctDoit : public UnaryPropagator<View0,PC_SET_ANY> {
00284   protected:
00285     using UnaryPropagator<View0,PC_SET_ANY>::x0;
00287     ConstantView y;
00289     DistinctDoit(Space* home, bool share,DistinctDoit&);
00291     DistinctDoit(Space* home, View0, ConstantView);
00292   public:
00294     virtual Actor*      copy(Space* home, bool);
00296     virtual ExecStatus propagate(Space* home, ModEventDelta med);
00298     static ExecStatus post(Space* home, View0, ConstantView);
00300     virtual Reflection::ActorSpec spec(const Space* home,
00301                                         Reflection::VarMap& m) const;
00303     static void post(Space* home, Reflection::VarMap& vars,
00304                      const Reflection::ActorSpec& spec);
00306     static Support::Symbol ati(void);
00307   };
00308 
00309 }}}
00310 
00311 #include "gecode/set/rel/common.icc"
00312 #include "gecode/set/rel/subset.icc"
00313 #include "gecode/set/rel/nosubset.icc"
00314 #include "gecode/set/rel/re-subset.icc"
00315 #include "gecode/set/rel/eq.icc"
00316 #include "gecode/set/rel/re-eq.icc"
00317 #include "gecode/set/rel/nq.icc"
00318 
00319 #endif
00320 
00321 // STATISTICS: set-prop