main page
modules
namespaces
classes
files
Gecode home
Generated on Sat May 25 2013 18:00:35 for Gecode by
doxygen
1.8.3.1
gecode
set
int.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: 2013-01-29 21:09:15 +0100 (Tue, 29 Jan 2013) $ by $Author: schulte $
13
* $Revision: 13247 $
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_INT_HH__
41
#define __GECODE_SET_INT_HH__
42
43
#include <
gecode/set.hh
>
44
45
namespace
Gecode {
namespace
Set {
namespace
Int {
46
58
template
<
class
View>
59
class
MinElement
:
60
public
MixBinaryPropagator
<View,PC_SET_ANY,
61
Gecode::Int::IntView,Gecode::Int::PC_INT_BND> {
62
protected
:
63
using
MixBinaryPropagator
<View,
PC_SET_ANY
,
64
Gecode::Int::IntView
,
Gecode::Int::PC_INT_BND
>
::x0
;
65
using
MixBinaryPropagator
<View,
PC_SET_ANY
,
66
Gecode::Int::IntView
,
Gecode::Int::PC_INT_BND
>
::x1
;
68
MinElement
(
Space
& home,
bool
share,
MinElement
&
p
);
70
MinElement
(
Home
home, View,
Gecode::Int::IntView
);
71
public
:
73
virtual
Actor
*
copy
(
Space
& home,
bool
);
75
virtual
ExecStatus
propagate
(
Space
& home,
const
ModEventDelta
&
med
);
77
static
ExecStatus
post
(
Home
home, View s,
Gecode::Int::IntView
x
);
78
};
79
86
template
<
class
View>
87
class
NotMinElement
:
88
public
MixBinaryPropagator
<View,PC_SET_ANY,
89
Gecode::Int::IntView,Gecode::Int::PC_INT_DOM> {
90
protected
:
91
using
MixBinaryPropagator
<View,
PC_SET_ANY
,
92
Gecode::Int::IntView
,
Gecode::Int::PC_INT_DOM
>
::x0
;
93
using
MixBinaryPropagator
<View,
PC_SET_ANY
,
94
Gecode::Int::IntView
,
Gecode::Int::PC_INT_DOM
>
::x1
;
96
NotMinElement
(
Space
& home,
bool
share,
NotMinElement
&
p
);
98
NotMinElement
(
Home
home, View,
Gecode::Int::IntView
);
99
public
:
101
virtual
Actor
*
copy
(
Space
& home,
bool
);
103
virtual
ExecStatus
propagate
(
Space
& home,
const
ModEventDelta
&
med
);
105
static
ExecStatus
post
(
Home
home, View s,
Gecode::Int::IntView
x
);
106
};
107
114
template
<
class
View, ReifyMode rm>
115
class
ReMinElement
:
116
public
Gecode::Int::ReMixBinaryPropagator
<View,PC_SET_ANY,
117
Gecode::Int::IntView,Gecode::Int::PC_INT_DOM,Gecode::Int::BoolView> {
118
protected
:
119
using
Gecode::Int::ReMixBinaryPropagator
<View,
PC_SET_ANY
,
120
Gecode::Int::IntView
,
Gecode::Int::PC_INT_DOM
,
Gecode::Int::BoolView
>
::x0
;
121
using
Gecode::Int::ReMixBinaryPropagator
<View,
PC_SET_ANY
,
122
Gecode::Int::IntView
,
Gecode::Int::PC_INT_DOM
,
Gecode::Int::BoolView
>
::x1
;
123
using
Gecode::Int::ReMixBinaryPropagator
<View,
PC_SET_ANY
,
124
Gecode::Int::IntView
,
Gecode::Int::PC_INT_DOM
,
Gecode::Int::BoolView
>
::b
;
126
ReMinElement
(
Space
& home,
bool
share,
ReMinElement
&
p
);
128
ReMinElement
(
Home
home, View,
Gecode::Int::IntView
,
129
Gecode::Int::BoolView
);
130
public
:
132
virtual
Actor
*
copy
(
Space
& home,
bool
);
134
virtual
ExecStatus
propagate
(
Space
& home,
const
ModEventDelta
&
med
);
136
static
ExecStatus
post
(
Home
home, View s,
Gecode::Int::IntView
x
,
137
Gecode::Int::BoolView
b
);
138
};
139
146
template
<
class
View>
147
class
MaxElement
:
148
public
MixBinaryPropagator
<View,PC_SET_ANY,Gecode::Int::IntView,Gecode::Int::PC_INT_BND> {
149
protected
:
150
using
MixBinaryPropagator
<View,
PC_SET_ANY
,
151
Gecode::Int::IntView
,
Gecode::Int::PC_INT_BND
>
::x0
;
152
using
MixBinaryPropagator
<View,
PC_SET_ANY
,
153
Gecode::Int::IntView
,
Gecode::Int::PC_INT_BND
>
::x1
;
155
MaxElement
(
Space
& home,
bool
share,
MaxElement
&
p
);
157
MaxElement
(
Home
home, View,
Gecode::Int::IntView
);
158
public
:
160
virtual
Actor
*
copy
(
Space
& home,
bool
);
162
virtual
ExecStatus
propagate
(
Space
& home,
const
ModEventDelta
&
med
);
164
static
ExecStatus
post
(
Home
home, View s,
Gecode::Int::IntView
x
);
165
};
166
173
template
<
class
View>
174
class
NotMaxElement
:
175
public
MixBinaryPropagator
<View,PC_SET_ANY,
176
Gecode::Int::IntView,Gecode::Int::PC_INT_DOM> {
177
protected
:
178
using
MixBinaryPropagator
<View,
PC_SET_ANY
,
179
Gecode::Int::IntView
,
Gecode::Int::PC_INT_DOM
>
::x0
;
180
using
MixBinaryPropagator
<View,
PC_SET_ANY
,
181
Gecode::Int::IntView
,
Gecode::Int::PC_INT_DOM
>
::x1
;
183
NotMaxElement
(
Space
& home,
bool
share,
NotMaxElement
&
p
);
185
NotMaxElement
(
Home
home, View,
Gecode::Int::IntView
);
186
public
:
188
virtual
Actor
*
copy
(
Space
& home,
bool
);
190
virtual
ExecStatus
propagate
(
Space
& home,
const
ModEventDelta
&
med
);
192
static
ExecStatus
post
(
Home
home, View s,
Gecode::Int::IntView
x
);
193
};
194
201
template
<
class
View, ReifyMode rm>
202
class
ReMaxElement
:
203
public
Gecode::Int::ReMixBinaryPropagator
<View,PC_SET_ANY,
204
Gecode::Int::IntView,Gecode::Int::PC_INT_DOM,Gecode::Int::BoolView> {
205
protected
:
206
using
Gecode::Int::ReMixBinaryPropagator
<View,
PC_SET_ANY
,
207
Gecode::Int::IntView
,
Gecode::Int::PC_INT_DOM
,
Gecode::Int::BoolView
>
::x0
;
208
using
Gecode::Int::ReMixBinaryPropagator
<View,
PC_SET_ANY
,
209
Gecode::Int::IntView
,
Gecode::Int::PC_INT_DOM
,
Gecode::Int::BoolView
>
::x1
;
210
using
Gecode::Int::ReMixBinaryPropagator
<View,
PC_SET_ANY
,
211
Gecode::Int::IntView
,
Gecode::Int::PC_INT_DOM
,
Gecode::Int::BoolView
>
::b
;
213
ReMaxElement
(
Space
& home,
bool
share,
ReMaxElement
&
p
);
215
ReMaxElement
(
Home
home, View,
Gecode::Int::IntView
,
Gecode::Int::BoolView
);
216
public
:
218
virtual
Actor
*
copy
(
Space
& home,
bool
);
220
virtual
ExecStatus
propagate
(
Space
& home,
const
ModEventDelta
&
med
);
222
static
ExecStatus
post
(
Home
home, View s,
Gecode::Int::IntView
x
,
223
Gecode::Int::BoolView
b
);
224
};
225
232
template
<
class
View>
233
class
Card
:
234
public
MixBinaryPropagator
<View,PC_SET_CARD,
235
Gecode::Int::IntView,Gecode::Int::PC_INT_BND> {
236
protected
:
237
using
MixBinaryPropagator
<View,
PC_SET_CARD
,
238
Gecode::Int::IntView
,
Gecode::Int::PC_INT_BND
>
::x0
;
239
using
MixBinaryPropagator
<View,
PC_SET_CARD
,
240
Gecode::Int::IntView
,
Gecode::Int::PC_INT_BND
>
::x1
;
242
Card
(
Space
& home,
bool
share,
Card
&
p
);
244
Card
(
Home
home, View,
Gecode::Int::IntView
);
245
public
:
247
virtual
Actor
*
copy
(
Space
& home,
bool
);
249
virtual
ExecStatus
propagate
(
Space
& home,
const
ModEventDelta
&
med
);
251
static
ExecStatus
post
(
Home
home, View s,
Gecode::Int::IntView
x
);
252
};
253
260
template
<
class
View>
261
class
Weights
:
public
Propagator
{
262
protected
:
264
SharedArray<int>
elements
;
266
SharedArray<int>
weights
;
267
269
View
x
;
271
Gecode::Int::IntView
y
;
272
274
Weights
(
Space
& home,
bool
share,
Weights
&
p
);
276
Weights
(
Home
home,
const
SharedArray<int>
&,
const
SharedArray<int>
&,
277
View,
Gecode::Int::IntView
);
278
public
:
280
virtual
Actor
*
copy
(
Space
& home,
bool
);
282
virtual
PropCost
cost
(
const
Space
& home,
const
ModEventDelta
&
med
)
const
;
284
virtual
size_t
dispose
(
Space
& home);
286
virtual
ExecStatus
propagate
(
Space
& home,
const
ModEventDelta
&
med
);
288
static
ExecStatus
post
(
Home
home,
289
const
SharedArray<int>
&
elements
,
290
const
SharedArray<int>
&
weights
,
291
View
x
,
Gecode::Int::IntView
y
);
292
};
293
294
}}}
295
296
#include <
gecode/set/int/minmax.hpp
>
297
#include <
gecode/set/int/card.hpp
>
298
#include <
gecode/set/int/weights.hpp
>
299
300
#endif
301
302
// STATISTICS: set-prop