76 template<
class View,
bool Perm>
79 bool& subsumed,
int& dropfst) {
84 for (
int i = 0; i < xs ; i++) {
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()) {
168 void unite(
int a,
int b,
int c);
190 while (sequence[x].parent != x) {
191 x = sequence[x].parent;
195 return sequence[x].
name;
201 while (sequence[x].parent != x) {
202 vertices[path_length++] = x;
203 x = sequence[x].parent;
207 for (
int i=0; i < path_length-1; i++) {
208 sequence[vertices[i]].parent = x;
211 return sequence[x].name;
217 int ra = sequence[a].root;
218 int rb = sequence[b].root;
221 if (sequence[ra].rank > sequence[rb].rank) {
227 sequence[
large].name = c;
228 sequence[c].root =
large;
233 for(
int i = n; i--; ){
273 return x[i].min() <
x[j].min();
275 return x[i].max() <
x[j].max();
302 return z[i].min() <
z[j].min();
304 return z[i].max() <
z[j].max();
307 return x[i].min() <
x[j].min();
310 return x[i].max() <
x[j].max();
328 if (x.min() == y.min()) {
329 return x.max() < y.max();
331 return x.min() < y.min();
359 if (x.
x.min() == y.
x.min()) {
360 if (x.
x.max() == y.
x.max()) {
361 if (x.
z.min() == y.
z.min()) {
362 return x.
z.max() < y.
z.max();
364 return x.
z.min() < y.
z.min();
367 return x.
x.max() < y.
x.max();
370 return x.
x.min() < y.
x.min();
382 template<
class View,
bool Perm>
393 bool x_complete =
true;
394 bool y_complete =
true;
395 bool z_complete =
true;
397 for (
int i=0; i<y.
size(); i++) {
406 for (
int i=0; i<x.
size(); i++) {
407 ModEvent me = y[i].eq(home, x[i].val());
420 bool y_equality =
true;
421 for (
int i=1; i<y.
size(); i++) {
422 y_equality &= (y[i-1].val() == y[i].val());
425 for (
int i=0; i<x.
size(); i++) {
426 ModEvent me = x[i].eq(home, y[i].val());
443 for (
int i=0; i<x.
size(); i++) {
444 ModEvent me = y[z[i].val()].eq(home, x[i].val());
453 for (
int i=0; i<x.
size(); i++) {
454 ModEvent me = x[i].eq(home, y[z[i].val()].val());
465 for (
int i=0; i<x.
size(); i++) {
474 int gauss = ( (n * (n + 1)) / 2);
477 if (
sum != gauss - n) {
498 for (
int i=0; i<n; i++) {
499 if (z[i].assigned()) {
501 if (x[i].assigned()) {
503 ModEvent me = y[v].eq(home, x[i].val());
508 if (y[v].assigned()) {
510 ModEvent me = x[i].eq(home, y[v].val());
522 me = x[i].gq(home, y[v].
min());
529 me = y[v].lq(home, x[i].
max());
535 me = y[v].gq(home, x[i].
min());
552 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)
bool assigned(void) const
Test if all variables are assigned.
int size(void) const
Return size of array (number of elements).
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
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
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 .
int ModEvent
Type for modification events.
const int small[]
Small Photo example.
const int large[]
Large Photo example.