main page
modules
namespaces
classes
files
Gecode home
Generated on Tue Mar 5 2013 22:37:30 for Gecode by
doxygen
1.8.3.1
gecode
set
view
set.hpp
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
*
6
* Contributing authors:
7
* Christian Schulte <schulte@gecode.org>
8
* Gabor Szokoli <szokoli@gecode.org>
9
*
10
* Copyright:
11
* Guido Tack, 2004
12
* Christian Schulte, 2004
13
* Gabor Szokoli, 2004
14
*
15
* Last modified:
16
* $Date: 2010-09-01 01:19:33 +1000 (Wed, 01 Sep 2010) $ by $Author: schulte $
17
* $Revision: 11368 $
18
*
19
* This file is part of Gecode, the generic constraint
20
* development environment:
21
* http://www.gecode.org
22
*
23
* Permission is hereby granted, free of charge, to any person obtaining
24
* a copy of this software and associated documentation files (the
25
* "Software"), to deal in the Software without restriction, including
26
* without limitation the rights to use, copy, modify, merge, publish,
27
* distribute, sublicense, and/or sell copies of the Software, and to
28
* permit persons to whom the Software is furnished to do so, subject to
29
* the following conditions:
30
*
31
* The above copyright notice and this permission notice shall be
32
* included in all copies or substantial portions of the Software.
33
*
34
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
38
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
39
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
40
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41
*
42
*/
43
44
namespace
Gecode {
namespace
Set {
45
46
/*
47
* Constructors and access
48
*
49
*/
50
51
forceinline
52
SetView::SetView
(
void
) {}
53
forceinline
54
SetView::SetView
(
const
SetVar
& y)
55
:
VarImpView
<
SetVar
>(y.varimp()) {}
56
forceinline
57
SetView::SetView
(
SetVarImp
* y)
58
:
VarImpView
<
SetVar
>(y) {}
59
60
/*
61
* Variable information
62
*
63
*/
64
65
forceinline
unsigned
int
66
SetView::glbSize
(
void
)
const
{
67
return
x
->
glbSize
();
68
}
69
forceinline
unsigned
int
70
SetView::lubSize
(
void
)
const
{
71
return
x
->
lubSize
();
72
}
73
forceinline
unsigned
int
74
SetView::unknownSize
(
void
)
const
{
75
return
x
->
lubSize
() -
x
->
glbSize
();
76
}
77
forceinline
bool
78
SetView::contains
(
int
i
)
const
{
79
return
x
->
knownIn
(i);
80
}
81
forceinline
bool
82
SetView::notContains
(
int
i
)
const
{
83
return
x
->
knownOut
(i);
84
}
85
forceinline
unsigned
int
86
SetView::cardMin
(
void
)
const
{
87
return
x
->
cardMin
();
88
}
89
forceinline
unsigned
int
90
SetView::cardMax
(
void
)
const
{
91
return
x
->
cardMax
();
92
}
93
forceinline
int
94
SetView::lubMin
(
void
)
const
{
95
return
x
->
lubMin
();
96
}
97
forceinline
int
98
SetView::lubMax
(
void
)
const
{
99
return
x
->
lubMax
();
100
}
101
forceinline
int
102
SetView::lubMinN
(
unsigned
int
n)
const
{
103
return
x
->
lubMinN
(n);
104
}
105
forceinline
int
106
SetView::glbMin
(
void
)
const
{
107
return
x
->
glbMin
();
108
}
109
forceinline
int
110
SetView::glbMax
(
void
)
const
{
111
return
x
->
glbMax
();
112
}
113
114
/*
115
* Tells
116
*
117
*/
118
119
forceinline
ModEvent
120
SetView::cardMin
(
Space
& home,
unsigned
int
m
) {
121
return
x
->
cardMin
(home, m);
122
}
123
124
forceinline
ModEvent
125
SetView::cardMax
(
Space
& home,
unsigned
int
m
) {
126
return
x
->
cardMax
(home, m);
127
}
128
129
forceinline
ModEvent
130
SetView::include
(
Space
& home,
int
from,
int
to) {
131
return
x
->
include
(home,from,to);
132
}
133
134
forceinline
ModEvent
135
SetView::include
(
Space
& home,
int
n) {
136
return
x
->
include
(home,n);
137
}
138
139
forceinline
ModEvent
140
SetView::exclude
(
Space
& home,
int
n) {
141
return
x
->
exclude
(home, n);
142
}
143
144
forceinline
ModEvent
145
SetView::intersect
(
Space
& home,
int
from,
int
to) {
146
return
x
->
intersect
(home,from,to);
147
}
148
149
forceinline
ModEvent
150
SetView::intersect
(
Space
& home,
int
n) {
151
return
x
->
intersect
(home,n);
152
}
153
154
template
<
class
I>
ModEvent
155
SetView::includeI
(
Space
& home, I& iter) {
156
return
x
->
includeI
(home, iter);
157
}
158
159
forceinline
ModEvent
160
SetView::exclude
(
Space
& home,
int
from,
int
to) {
161
return
x
->
exclude
(home,from,to);
162
}
163
template
<
class
I>
ModEvent
164
SetView::excludeI
(
Space
& home, I& iter) {
165
return
x
->
excludeI
(home, iter);
166
}
167
template
<
class
I>
ModEvent
168
SetView::intersectI
(
Space
& home, I& iter) {
169
return
x
->
intersectI
(home, iter);
170
}
171
172
173
/*
174
* Delta information for advisors
175
*
176
*/
177
178
forceinline
ModEvent
179
SetView::modevent
(
const
Delta
&
d
) {
return
SetVarImp::modevent
(d); }
180
181
forceinline
int
182
SetView::glbMin
(
const
Delta
&
d
)
const
{
return
SetVarImp::glbMin
(d); }
183
184
forceinline
int
185
SetView::glbMax
(
const
Delta
&
d
)
const
{
return
SetVarImp::glbMax
(d); }
186
187
forceinline
bool
188
SetView::glbAny
(
const
Delta
&
d
)
const
{
return
SetVarImp::glbAny
(d); }
189
190
forceinline
int
191
SetView::lubMin
(
const
Delta
&
d
)
const
{
return
SetVarImp::lubMin
(d); }
192
193
forceinline
int
194
SetView::lubMax
(
const
Delta
&
d
)
const
{
return
SetVarImp::lubMax
(d); }
195
196
forceinline
bool
197
SetView::lubAny
(
const
Delta
&
d
)
const
{
return
SetVarImp::lubAny
(d); }
198
199
204
template
<>
205
class
LubRanges
<
SetView
> :
public
LubRanges
<SetVarImp*> {
206
public
:
208
209
210
LubRanges
(
void
);
212
LubRanges
(
const
SetView
& x);
214
void
init
(
const
SetView
& x);
216
};
217
218
forceinline
219
LubRanges<SetView>::LubRanges
(
void
) {}
220
221
forceinline
222
LubRanges<SetView>::LubRanges
(
const
SetView
& x)
223
:
LubRanges
<
SetVarImp
*>(x.varimp()) {}
224
225
forceinline
void
226
LubRanges<SetView>::init
(
const
SetView
& x) {
227
LubRanges<SetVarImp*>::init
(x.
varimp
());
228
}
229
230
235
template
<>
236
class
GlbRanges
<
SetView
> :
public
GlbRanges
<SetVarImp*> {
237
public
:
239
240
241
GlbRanges
(
void
);
243
GlbRanges
(
const
SetView
& x);
245
void
init
(
const
SetView
& x);
246
};
247
248
forceinline
249
GlbRanges<SetView>::GlbRanges
(
void
) {}
250
251
forceinline
252
GlbRanges<SetView>::GlbRanges
(
const
SetView
& x)
253
:
GlbRanges
<
SetVarImp
*>(x.varimp()) {}
254
255
forceinline
void
256
GlbRanges<SetView>::init
(
const
SetView
& x) {
257
GlbRanges<SetVarImp*>::init
(x.
varimp
());
258
}
259
260
}}
261
262
// STATISTICS: set-var
263