76 template<
class View,
bool Perm>
79 bool& subsumed,
int& dropfst) {
84 for (
int i = 0; i < xs ; i++) {
86 subsumed &= (
x[i].assigned() &&
88 y[
z[i].val()].assigned());
90 if (
x[i].val() !=
y[
z[i].val()].val()) {
93 if (
z[i].val() == i) {
99 subsumed &= (
x[i].assigned() &&
y[i].assigned());
101 if (
x[i].val() !=
y[i].val()) {
165 void unite(
int a,
int b,
int c);
187 while (sequence[
x].parent !=
x) {
188 x = sequence[
x].parent;
192 return sequence[
x].name;
198 while (sequence[
x].parent !=
x) {
200 x = sequence[
x].parent;
203 for (
int i=0; i<vsize; i++)
204 sequence[vertices[i]].parent =
x;
206 return sequence[
x].name;
212 int ra = sequence[a].root;
213 int rb = sequence[b].root;
216 if (sequence[ra].rank > sequence[rb].rank) {
222 sequence[
large].name = c;
223 sequence[c].root =
large;
228 for(
int i = n; i--; ){
267 return x[i].min() <
x[j].min();
269 return x[i].max() <
x[j].max();
296 return z[i].min() <
z[j].min();
298 return z[i].max() <
z[j].max();
301 return x[i].min() <
x[j].min();
304 return x[i].max() <
x[j].max();
322 if (
x.min() ==
y.min()) {
323 return x.max() <
y.max();
325 return x.min() <
y.min();
353 if (
x.x.min() ==
y.x.min()) {
354 if (
x.x.max() ==
y.x.max()) {
355 if (
x.z.min() ==
y.z.min()) {
356 return x.z.max() <
y.z.max();
358 return x.z.min() <
y.z.min();
361 return x.x.max() <
y.x.max();
364 return x.x.min() <
y.x.min();
376 template<
class View,
bool Perm>
387 bool x_complete =
true;
388 bool y_complete =
true;
389 bool z_complete =
true;
391 for (
int i=0; i<
y.size(); i++) {
392 x_complete &=
x[i].assigned();
393 y_complete &=
y[i].assigned();
395 z_complete &=
z[i].assigned();
400 for (
int i=0; i<
x.size(); i++) {
414 bool y_equality =
true;
415 for (
int i=1; i<
y.size(); i++) {
416 y_equality &= (
y[i-1].val() ==
y[i].val());
419 for (
int i=0; i<
x.size(); i++) {
437 for (
int i=0; i<
x.size(); i++) {
447 for (
int i=0; i<
x.size(); i++) {
459 for (
int i=0; i<
x.size(); i++) {
468 int gauss = ( (n * (n + 1)) / 2);
471 if (
sum != gauss - n) {
492 for (
int i=0; i<n; i++) {
493 if (
z[i].assigned()) {
495 if (
x[i].assigned()) {
502 if (
y[v].assigned()) {
516 me =
x[i].gq(home,
y[v].
min());
523 me =
y[v].lq(home,
x[i].
max());
529 me =
y[v].gq(home,
x[i].
min());
546 me =
x[i].gq(home,
y[l].
min());
Item used to construct the OfflineMin sequence.
int iset
Initial set label.
int pred
Predecessor in the Offline-Min sequence.
int root
Root node representing the set the vertex belongs to.
int succ
Successor in the Offline-Min sequence.
int rank
Ranking of the set given by its cardinality.
int name
Name or label of a set.
int parent
Predecessor in the tree representation of the set.
void unite(int a, int b, int c)
Unite two sets a and b and label the union with c.
OfflineMinItem & operator[](int)
void makeset(void)
Initialization of the datastructure.
int size(void)
Return the size of the Offline-Min item.
Storage class for mininmum and maximum of a variable.
int max
stores the mininmum of a variable
int min
stores the mininmum of a variable
Representation of a strongly connected component.
int leftmost
Leftmost y-node in a scc.
int left
Direct left neighbour of an y-node in a scc.
int right
Direct right neighbour of an y-node in a scc.
int rightmost
Rightmost reachable y-node in a scc.
bool operator()(const int i, const int j)
TupleMaxIncExt(const ViewArray< View > &x0, const ViewArray< View > &z0)
bool operator()(const int i, const int j)
TupleMaxInc(const ViewArray< View > &x0)
Extended view comparison on pairs of views.
bool operator()(const ViewPair< View > &x, const ViewPair< View > &y)
View comparison on ViewTuples.
bool operator()(const View &x, const View &y)
const int small[]
Small Photo example.
const int large[]
Large Photo example.
bool me_failed(ModEvent me)
Check whether modification event me is failed.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
bool channel(Space &home, ViewArray< View > &x, ViewArray< View > &y, ViewArray< View > &z, bool &nofix)
Channel between x, y and z.
bool array_assigned(Space &home, ViewArray< View > &x, ViewArray< View > &y, ViewArray< View > &z, bool &subsumed, bool &match_fixed, bool &, bool &noperm_bc)
Check for assignment of a variable array.
bool check_subsumption(ViewArray< View > &x, ViewArray< View > &y, ViewArray< View > &z, bool &subsumed, int &dropfst)
Subsumption test.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Post propagator for SetVar SetOpType SetVar y
LinIntExpr sum(const IntVarArgs &x)
Construct linear expression as sum of integer variables.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Post propagator for SetVar x
int ModEvent
Type for modification events.