38 namespace Gecode {
namespace Int {
namespace Sorted {
80 template<
class View,
bool Perm>
88 for (
int i = 0;
i < xs ;
i++) {
94 if (x[
i].val() != y[z[
i].val()].val()) {
97 if (z[
i].val() ==
i) {
105 if (x[
i].val() != y[
i].val()) {
191 while (sequence[x].parent != x) {
196 return sequence[
x].
name;
202 while (sequence[x].parent != x) {
207 for (
int i = vsize;
i--; ) {
211 return sequence[
x].
name;
221 if (sequence[ra].rank > sequence[rb].rank) {
225 sequence[small].
parent = large;
226 sequence[large].
rank += sequence[small].
rank;
227 sequence[large].
name =
c;
228 sequence[
c].
root = large;
233 for(
int i = n;
i--; ){
271 if (x[i].
max() == x[j].
max()) {
272 return x[
i].min() < x[j].min();
274 return x[
i].max() < x[j].max();
298 if (x[i].
max() == x[j].
max()) {
299 if (x[i].
min() == x[j].
min()) {
300 if (z[i].
max() == z[j].
max()) {
301 return z[
i].min() < z[j].min();
303 return z[
i].max() < z[j].max();
306 return x[
i].min() < x[j].min();
309 return x[
i].max() < x[j].max();
327 if (x.min() == y.min()) {
328 return x.max() < y.max();
330 return x.min() < y.min();
358 if (x.
x.min() == y.
x.min()) {
359 if (x.
x.max() == y.
x.max()) {
360 if (x.
z.min() == y.
z.min()) {
361 return x.
z.max() < y.
z.max();
363 return x.
z.min() < y.
z.min();
366 return x.
x.max() < y.
x.max();
369 return x.
x.min() < y.
x.min();
381 template<
class View,
bool Perm>
392 bool x_complete =
true;
393 bool y_complete =
true;
394 bool z_complete =
true;
396 for (
int i = y.
size();
i--; ) {
405 for (
int i = x.
size();
i--; ) {
419 bool y_equality =
true;
420 for (
int i = y.
size() - 1;
i--; ) {
421 y_equality &= (y[
i].val() == y[
i + 1].val());
424 for (
int i = x.
size();
i--; ) {
442 for (
int i = x.
size();
i--; ) {
443 ModEvent me = y[z[
i].val()].eq(home, x[
i].val());
452 for (
int i = x.
size();
i--; ) {
453 ModEvent me = x[
i].eq(home, y[z[
i].val()].val());
464 for (
int i = x.
size();
i--; ) {
466 if (x[
i].
max() < y[pi].
min() ||
473 int gauss = ( (n * (n + 1)) / 2);
476 if (sum != gauss - n) {
497 for (
int i = n;
i--; ) {
521 me = x[
i].gq(home, y[v].
min());
528 me = y[
v].lq(home, x[
i].
max());
534 me = y[
v].gq(home, x[
i].
min());
551 me = x[
i].gq(home, y[l].
min());
TupleMaxIncExt(const ViewArray< View > &x0, const ViewArray< View > &z0)
Index comparison for ViewArray.
Storage class for mininmum and maximum of a variable.
int iset
Initial set label.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Item used to construct the OfflineMin sequence.
int ModEvent
Type for modification events.
View comparison on ViewTuples.
int succ
Successor in the Offline-Min sequence.
bool operator()(const int i, const int j)
bool operator()(const int i, const int j)
bool channel(Space &home, ViewArray< View > &x, ViewArray< View > &y, ViewArray< View > &z, bool &nofix)
Channel between x, y and z.
Gecode::FloatVal c(-8, 8)
OfflineMinItem & operator[](int)
Gecode::IntArgs i(4, 1, 2, 3, 4)
int min
stores the mininmum of a variable
int n
Number of negative literals for node type.
int left
Direct left neighbour of an y-node in a scc.
int rightmost
Rightmost reachable y-node in a scc.
bool check_subsumption(ViewArray< View > &x, ViewArray< View > &y, ViewArray< View > &z, bool &subsumed, int &dropfst)
Subsumption test.
bool operator()(const ViewPair< View > &x, const ViewPair< View > &y)
unsigned int size(I &i)
Size of all ranges of range iterator i.
TupleMaxInc(const ViewArray< View > &x0)
int name
Name or label of a set.
Representation of a strongly connected component.
int right
Direct right neighbour of an y-node in a scc.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
ExecStatus subsumed(Space &home, Propagator &p, TaskArray< Task > &t)
Check tasks t for subsumption.
Node * x
Pointer to corresponding Boolean expression node.
int leftmost
Leftmost y-node in a scc.
int parent
Predecessor in the tree representation of the set.
bool assigned(View x, int v)
Whether x is assigned to value v.
int max
stores the mininmum of a variable
Extended Index comparison for ViewArray.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
int root
Root node representing the set the vertex belongs to.
Offline-Min datastructure Used to compute the perfect matching between the unsorted views x and the s...
int rank
Ranking of the set given by its cardinality.
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 operator()(const View &x, const View &y)
void unite(int a, int b, int c)
Unite two sets a and b and label the union with c.
int size(void) const
Return size of array (number of elements)
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
LinFloatExpr sum(const FloatVarArgs &x)
Construct linear float expression as sum of float variables.
int size(void)
Return the size of the Offline-Min item.
bool assigned(void) const
Test if all variables are assigned.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
void makeset(void)
Initialization of the datastructure.
bool me_failed(ModEvent me)
Check whether modification event me is failed.
int pred
Predecessor in the Offline-Min sequence.
Extended view comparison on pairs of views.