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

rel-op.hh

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Guido Tack <tack@gecode.org>
00004  *     Christian Schulte <schulte@gecode.org>
00005  *
00006  *  Contributing authors:
00007  *     Gabor Szokoli <szokoli@gecode.org>
00008  *
00009  *  Copyright:
00010  *     Guido Tack, 2004
00011  *     Christian Schulte, 2004
00012  *     Gabor Szokoli, 2004
00013  *
00014  *  Last modified:
00015  *     $Date: 2006-04-11 15:58:37 +0200 (Tue, 11 Apr 2006) $ by $Author: tack $
00016  *     $Revision: 3188 $
00017  *
00018  *  This file is part of Gecode, the generic constraint
00019  *  development environment:
00020  *     http://www.gecode.org
00021  *
00022  *  See the file "LICENSE" for information on usage and
00023  *  redistribution of this file, and for a
00024  *     DISCLAIMER OF ALL WARRANTIES.
00025  *
00026  */
00027 
00028 #ifndef __GECODE_SET_RELOP_HH__
00029 #define __GECODE_SET_RELOP_HH__
00030 
00031 #include "gecode/set.hh"
00032 #include "gecode/iter.hh"
00033 #include "gecode/set/rel.hh"
00034 
00035 namespace Gecode { namespace Set { namespace RelOp {
00036 
00049    template <class View0, class View1, class View2>
00050    class SuperOfInter :
00051     public InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00052                                   View2,PC_SET_CLUB> {
00053    protected:
00054      using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00055                                   View2,PC_SET_CLUB>::x0;
00056      using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00057                                   View2,PC_SET_CLUB>::x1;
00058      using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00059                                   View2,PC_SET_CLUB>::x2;
00061      SuperOfInter(Space* home, bool share,SuperOfInter& p);
00063      SuperOfInter(Space* home,View0, View1, View2);
00064    public:
00066      virtual Actor*      copy(Space* home,bool);
00068      virtual ExecStatus  propagate(Space* home);
00070      static  ExecStatus  post(Space* home, View0 x, View1 y, View2 z);
00071    };
00072 
00079   template <class View0, class View1, class View2>
00080   class SubOfUnion :
00081     public InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00082                                   View2,PC_SET_ANY> {
00083   protected:
00084     using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00085                                  View2,PC_SET_ANY>::x0;
00086     using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00087                                  View2,PC_SET_ANY>::x1;
00088     using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00089                                  View2,PC_SET_ANY>::x2;
00091     SubOfUnion(Space* home, bool share,SubOfUnion& p);
00093     SubOfUnion(Space* home,View0, View1, View2);
00094   public:
00096     virtual Actor*      copy(Space* home,bool);
00098     virtual ExecStatus  propagate(Space* home);
00100     static  ExecStatus  post(Space* home,View0 x,View1 y,View2 z);
00101   };
00102 
00103 
00110    template <class View0, class View1, class View2>
00111    class Intersection:
00112     public InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00113                                   View2,PC_SET_ANY> {
00114    protected:
00115      using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00116                                   View2,PC_SET_ANY>::x0;
00117      using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00118                                   View2,PC_SET_ANY>::x1;
00119      using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00120                                   View2,PC_SET_ANY>::x2;
00122      Intersection(Space* home, bool share,Intersection& p);
00124      Intersection(Space* home,View0,View1,View2);
00125    public:
00127      virtual Actor*      copy(Space* home,bool);
00129      virtual ExecStatus  propagate(Space* home);
00131      static  ExecStatus  post(Space* home,View0 x,View1 y,View2 z);
00132    };
00133 
00140   template <class View0, class View1, class View2>
00141   class Union:
00142     public InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00143                                   View2,PC_SET_ANY> {
00144   protected:
00145     using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00146                                  View2,PC_SET_ANY>::x0;
00147     using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00148                                  View2,PC_SET_ANY>::x1;
00149     using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00150                                  View2,PC_SET_ANY>::x2;
00152     Union(Space* home, bool share,Union& p);
00154     Union(Space* home,View0,View1,View2);
00155   public:
00157     virtual Actor*      copy(Space* home,bool);
00159     virtual ExecStatus  propagate(Space* home);
00161     static  ExecStatus  post(Space* home,View0 x,View1 y,View2 z);
00162   };
00163 
00170   template <class View0, class View1>
00171   class IntersectionN : public InhomNaryOnePropagator<View0,PC_SET_ANY,
00172                                                       View1,PC_SET_ANY> {
00173   protected:
00174     using InhomNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
00175     using InhomNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
00177     bool shared;
00179     LUBndSet intOfDets;
00181     IntersectionN(Space* home, bool share,IntersectionN& p);
00183     IntersectionN(Space* home,ViewArray<View0>&, View1);
00184   public:
00185     virtual PropCost    cost(void) const;
00187     virtual Actor*      copy(Space* home,bool);
00189     virtual ExecStatus  propagate(Space* home);
00191     static  ExecStatus  post(Space* home,ViewArray<View0>& y,View1 x);
00192   };
00193 
00200   template <class View0, class View1>
00201   class UnionN : public InhomNaryOnePropagator<View0,PC_SET_ANY,
00202                                                View1,PC_SET_ANY> {
00203   protected:
00204     using InhomNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
00205     using InhomNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
00207     bool shared;
00209     GLBndSet unionOfDets;
00211     UnionN(Space* home, bool share,UnionN& p);
00213     UnionN(Space* home,ViewArray<View0>&,View1);
00214   public:
00216     virtual Actor*      copy(Space* home, bool);
00218     virtual ExecStatus  propagate(Space* home);
00219     virtual PropCost    cost(void) const;
00221     static  ExecStatus  post(Space* home,ViewArray<View0>& y,View1 x);
00222   };
00223 
00224 
00231   template <class View0, class View1>
00232   class PartitionN : public InhomNaryOnePropagator<View0,PC_SET_ANY,
00233                                                    View1,PC_SET_ANY> {
00234   protected:
00235     using InhomNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
00236     using InhomNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
00238     bool shared;
00240     GLBndSet unionOfDets;
00242     PartitionN(Space* home, bool share,PartitionN& p);
00244     PartitionN(Space* home,ViewArray<View0>&, View1);
00245   public:
00247     virtual Actor*      copy(Space* home,bool);
00249     virtual ExecStatus  propagate(Space* home);
00250     virtual PropCost    cost(void) const;
00252     static  ExecStatus  post(Space* home,ViewArray<View0>& y,View1 x);
00253   };
00254 
00255 }}}
00256 
00257 #include "gecode/set/rel-op/common.icc"
00258 #include "gecode/set/rel-op/superofinter.icc"
00259 #include "gecode/set/rel-op/subofunion.icc"
00260 #include "gecode/set/rel-op/inter.icc"
00261 #include "gecode/set/rel-op/union.icc"
00262 #include "gecode/set/rel-op/partition.icc"
00263 #include "gecode/set/rel-op/post.icc"
00264 
00265 #endif
00266 
00267 // STATISTICS: set-prop