Generated on Sun Aug 26 2012 08:42:53 for Gecode by doxygen 1.8.1.1
element.hh
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Guido Tack <tack@gecode.org>
5  * Christian Schulte <schulte@gecode.org>
6  *
7  * Copyright:
8  * Guido Tack, 2004
9  * Christian Schulte, 2004
10  *
11  * Last modified:
12  * $Date: 2011-09-06 18:05:16 +1000 (Tue, 06 Sep 2011) $ by $Author: tack $
13  * $Revision: 12391 $
14  *
15  * This file is part of Gecode, the generic constraint
16  * development environment:
17  * http://www.gecode.org
18  *
19  * Permission is hereby granted, free of charge, to any person obtaining
20  * a copy of this software and associated documentation files (the
21  * "Software"), to deal in the Software without restriction, including
22  * without limitation the rights to use, copy, modify, merge, publish,
23  * distribute, sublicense, and/or sell copies of the Software, and to
24  * permit persons to whom the Software is furnished to do so, subject to
25  * the following conditions:
26  *
27  * The above copyright notice and this permission notice shall be
28  * included in all copies or substantial portions of the Software.
29  *
30  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
33  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
34  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
35  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
36  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37  *
38  */
39 
40 #ifndef __GECODE_SET_SELECT_HH__
41 #define __GECODE_SET_SELECT_HH__
42 
43 #include <gecode/set.hh>
44 
45 #include <gecode/int/element.hh>
46 #include <gecode/set/rel.hh>
47 #include <gecode/set/rel-op.hh>
48 
49 namespace Gecode { namespace Int { namespace Element {
51  template<>
52  class ViewToVarArg<Gecode::Set::SetView> {
53  public:
55  };
57  template<>
59  public:
61  };
62 }}}
63 
64 namespace Gecode { namespace Set { namespace Element {
65 
77  template<class View, class View0, class View1>
79  public:
81  protected:
84  View0 x0;
85  View1 x1;
86 
88  ElementIntersection(Space& home, bool share,ElementIntersection& p);
90  ElementIntersection(Home home,IdxViewArray&,View0,View1,
91  const IntSet& universe);
92  public:
94  virtual Actor* copy(Space& home,bool);
95  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
97  virtual size_t dispose(Space& home);
99  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
105  static ExecStatus post(Home home,IdxViewArray& x, View0 y,
106  View1 z, const IntSet& u);
107  };
108 
115  template<class View, class View0, class View1>
116  class ElementUnion : public Propagator {
117  public:
119  protected:
121  View0 x0;
122  View1 x1;
123 
125  ElementUnion(Space& home, bool share,ElementUnion& p);
127  ElementUnion(Home home,IdxViewArray&,View0,View1);
128  public:
130  virtual Actor* copy(Space& home,bool);
131  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
133  virtual size_t dispose(Space& home);
135  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
141  static ExecStatus post(Home home,IdxViewArray& x,View0 y, View1 z);
142  };
143 
150  template<class SView, class RView>
151  class ElementUnionConst : public Propagator {
152  protected:
153  SView x0;
155  int n_iv;
156  RView x1;
157 
159  ElementUnionConst(Space& home, bool share,ElementUnionConst& p);
161  ElementUnionConst(Home home,SView,const IntSetArgs&,RView);
162  public:
164  virtual Actor* copy(Space& home,bool);
165  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
167  virtual size_t dispose(Space& home);
169  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
175  static ExecStatus post(Home home,SView z,const IntSetArgs& x,RView y);
176  };
177 
184  template<class SView, class RView>
185  class ElementDisjoint : public Propagator {
186  public:
188  protected:
190  RView x1;
191 
193  ElementDisjoint(Space& home, bool share,ElementDisjoint& p);
195  ElementDisjoint(Home home,IdxViewArray&,RView);
196  public:
198  virtual Actor* copy(Space& home,bool);
199  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
201  virtual size_t dispose(Space& home);
203  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
205  static ExecStatus post(Home home,IdxViewArray& x,RView y);
206  };
207 
208 }}}
209 
214 
215 #endif
216 
217 // STATISTICS: set-prop
218