Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0
rel-op.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 * Contributing authors:
8 * Gabor Szokoli <szokoli@gecode.org>
9 *
10 * Copyright:
11 * Guido Tack, 2004
12 * Christian Schulte, 2004
13 * Gabor Szokoli, 2004
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_RELOP_HH__
41#define __GECODE_SET_RELOP_HH__
42
43#include <gecode/set.hh>
44#include <gecode/set/rel.hh>
45
46namespace Gecode { namespace Set { namespace RelOp {
47
60 template<class View0, class View1, class View2>
62 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
63 View2,PC_SET_CLUB> {
64 protected:
66 View2,PC_SET_CLUB>::x0;
68 View2,PC_SET_CLUB>::x1;
70 View2,PC_SET_CLUB>::x2;
74 SuperOfInter(Home home, View0, View1, View2);
75 public:
77 virtual Actor* copy(Space& home);
79 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
81 static ExecStatus post(Home home, View0 x, View1 y, View2 z);
82 };
83
90 template<class View0, class View1, class View2>
91 class SubOfUnion :
92 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
93 View2,PC_SET_ANY> {
94 protected:
96 View2,PC_SET_ANY>::x0;
98 View2,PC_SET_ANY>::x1;
100 View2,PC_SET_ANY>::x2;
102 SubOfUnion(Space& home, SubOfUnion& p);
104 SubOfUnion(Home home, View0, View1, View2);
105 public:
107 virtual Actor* copy(Space& home);
109 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
111 static ExecStatus post(Home home,View0 x,View1 y,View2 z);
112 };
113
114
121 template<class View0, class View1, class View2>
123 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
124 View2,PC_SET_ANY> {
125 protected:
127 View2,PC_SET_ANY>::x0;
129 View2,PC_SET_ANY>::x1;
131 View2,PC_SET_ANY>::x2;
135 Intersection(Home home,View0,View1,View2);
136 public:
138 virtual Actor* copy(Space& home);
140 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
142 static ExecStatus post(Home home,View0 x,View1 y,View2 z);
143 };
144
151 template<class View0, class View1, class View2>
152 class Union:
153 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
154 View2,PC_SET_ANY> {
155 protected:
157 View2,PC_SET_ANY>::x0;
159 View2,PC_SET_ANY>::x1;
161 View2,PC_SET_ANY>::x2;
163 Union(Space& home, Union& p);
165 Union(Home home, View0, View1, View2);
166 public:
168 virtual Actor* copy(Space& home);
170 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
172 static ExecStatus post(Home home,View0 x,View1 y,View2 z);
173 };
174
181 template<class View0, class View1>
183 public MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY> {
184 protected:
188 bool shared;
194 IntersectionN(Home home, ViewArray<View0>&, View1);
196 IntersectionN(Home home, ViewArray<View0>&, const IntSet&, View1);
197 public:
199 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
201 virtual Actor* copy(Space& home);
203 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
205 static ExecStatus post(Home home,ViewArray<View0>& y,View1 x);
208 const IntSet& z,View1 x);
209 };
210
217 template<class View0, class View1>
218 class UnionN : public MixNaryOnePropagator<View0,PC_SET_ANY,
219 View1,PC_SET_ANY> {
220 protected:
224 bool shared;
228 UnionN(Space& home, UnionN& p);
230 UnionN(Home home,ViewArray<View0>&,View1);
232 UnionN(Home home,ViewArray<View0>&,const IntSet&,View1);
233 public:
235 virtual Actor* copy(Space& home);
237 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
239 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
241 static ExecStatus post(Home home,ViewArray<View0>& y,View1 x);
244 const IntSet& z,View1 x);
245 };
246
247
254 template<class View0, class View1>
255 class PartitionN : public MixNaryOnePropagator<View0,PC_SET_ANY,
256 View1,PC_SET_ANY> {
257 protected:
261 bool shared;
265 PartitionN(Space& home, PartitionN& p);
267 PartitionN(Home home, ViewArray<View0>&, View1);
269 PartitionN(Home home, ViewArray<View0>&, const IntSet&, View1);
270 public:
272 virtual Actor* copy(Space& home);
274 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
276 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
278 static ExecStatus post(Home home,ViewArray<View0>& y,View1 x);
281 const IntSet& z,View1 x);
282 };
283
284}}}
285
293
294#endif
295
296// STATISTICS: set-prop
int p
Number of positive literals for node type.
Base-class for both propagators and branchers.
Definition core.hpp:628
Home class for posting propagators
Definition core.hpp:856
Integer sets.
Definition int.hh:174
Mixed (n+1)-ary propagator.
Definition pattern.hpp:272
Mixed ternary propagator.
Definition pattern.hpp:237
Propagation cost.
Definition core.hpp:486
ModEventDelta med
A set of modification events (used during propagation)
Definition core.hpp:1075
Growing sets of integers.
Definition var-imp.hpp:205
Shrinking sets of integers.
Definition var-imp.hpp:243
Propagator for nary intersection
Definition rel-op.hh:183
LUBndSet intOfDets
Intersection of the determined (which are dropped)
Definition rel-op.hh:190
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition inter.hpp:267
static ExecStatus post(Home home, ViewArray< View0 > &y, View1 x)
Post propagator .
Definition inter.hpp:235
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition inter.hpp:261
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition inter.hpp:273
bool shared
Whether the any views share a variable implementation.
Definition rel-op.hh:188
IntersectionN(Space &home, IntersectionN &p)
Constructor for cloning p.
Definition inter.hpp:225
Propagator for ternary intersection
Definition rel-op.hh:124
static ExecStatus post(Home home, View0 x, View1 y, View2 z)
Post propagator .
Definition inter.hpp:48
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition inter.hpp:56
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition inter.hpp:62
Intersection(Space &home, Intersection &p)
Constructor for cloning p.
Definition inter.hpp:193
Propagator for nary partition
Definition rel-op.hh:256
bool shared
Whether the any views share a variable implementation.
Definition rel-op.hh:261
PartitionN(Space &home, PartitionN &p)
Constructor for cloning p.
Definition partition.hpp:66
GLBndSet unionOfDets
Union of the determined (which are dropped)
Definition rel-op.hh:263
static ExecStatus post(Home home, ViewArray< View0 > &y, View1 x)
Post propagator .
Definition partition.hpp:79
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition partition.hpp:74
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Propagator for the subset of union
Definition rel-op.hh:93
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
SubOfUnion(Space &home, SubOfUnion &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
static ExecStatus post(Home home, View0 x, View1 y, View2 z)
Post propagator .
Propagator for the superset of intersection
Definition rel-op.hh:63
virtual Actor * copy(Space &home)
Copy propagator during cloning.
static ExecStatus post(Home home, View0 x, View1 y, View2 z)
Post propagator .
SuperOfInter(Space &home, SuperOfInter &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Propagator for nary union
Definition rel-op.hh:219
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition union.hpp:260
static ExecStatus post(Home home, ViewArray< View0 > &y, View1 x)
Post propagator .
Definition union.hpp:235
GLBndSet unionOfDets
Union of the determined (which are dropped)
Definition rel-op.hh:226
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition union.hpp:266
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition union.hpp:229
bool shared
Whether the any views share a variable implementation.
Definition rel-op.hh:224
UnionN(Space &home, UnionN &p)
Constructor for cloning p.
Definition union.hpp:221
Propagator for ternary union
Definition rel-op.hh:154
static ExecStatus post(Home home, View0 x, View1 y, View2 z)
Post propagator .
Definition union.hpp:61
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition union.hpp:69
Union(Space &home, Union &p)
Constructor for cloning p.
Definition union.hpp:55
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition union.hpp:75
Computation spaces.
Definition core.hpp:1742
View arrays.
Definition array.hpp:253
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
const Gecode::PropCond PC_SET_CLUB
Propagate when the cardinality or the least upper bound of a view changes.
Definition var-type.hpp:227
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
Definition var-type.hpp:248
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Definition set.hh:767
Post propagator for SetVar SetOpType SetVar y
Definition set.hh:767
ExecStatus
Definition core.hpp:472
Post propagator for SetVar x
Definition set.hh:767