34 namespace Gecode {
namespace Int {
namespace Sorted {
76 template<
class View,
bool Perm>
84 for (
int i = 0;
i < xs ;
i++) {
90 if (x[
i].val() != y[z[
i].val()].val()) {
93 if (z[
i].val() ==
i) {
101 if (x[
i].val() != y[
i].val()) {
165 void unite(
int a,
int b,
int c);
203 for (
int i = vsize;
i--; ) {
229 for(
int i =
n;
i--; ){
266 bool operator ()(
const int i,
const int j) {
267 if (x[i].
max() == x[j].
max()) {
268 return x[
i].min() < x[j].min();
270 return x[
i].max() < x[j].max();
293 bool operator ()(
const int i,
const int j) {
294 if (x[i].
max() == x[j].
max()) {
295 if (x[i].
min() == x[j].
min()) {
296 if (z[i].
max() == z[j].
max()) {
297 return z[
i].min() < z[j].min();
299 return z[
i].max() < z[j].max();
302 return x[
i].min() < x[j].min();
305 return x[
i].max() < x[j].max();
322 bool operator ()(
const View&
x,
const View&
y) {
323 if (x.min() == y.min()) {
324 return x.max() < y.max();
326 return x.min() < y.min();
354 if (x.
x.min() == y.
x.min()) {
355 if (x.
x.max() == y.
x.max()) {
356 if (x.
z.min() == y.
z.min()) {
357 return x.
z.max() < y.
z.max();
359 return x.
z.min() < y.
z.min();
362 return x.
x.max() < y.
x.max();
365 return x.
x.min() < y.
x.min();
377 template<
class View,
bool Perm>
388 bool x_complete =
true;
389 bool y_complete =
true;
390 bool z_complete =
true;
392 for (
int i = y.
size();
i--; ) {
401 for (
int i = x.
size();
i--; ) {
415 bool y_equality =
true;
416 for (
int i = y.
size() - 1;
i--; ) {
417 y_equality &= (y[
i].val() == y[
i + 1].val());
420 for (
int i = x.
size();
i--; ) {
438 for (
int i = x.
size();
i--; ) {
439 ModEvent me = y[z[
i].val()].eq(home, x[
i].val());
448 for (
int i = x.
size();
i--; ) {
449 ModEvent me = x[
i].eq(home, y[z[
i].val()].val());
460 for (
int i = x.
size();
i--; ) {
462 if (x[
i].
max() < y[pi].
min() ||
469 int gauss = ( (n * (n + 1)) / 2);
472 if (sum != gauss - n) {
493 for (
int i = n;
i--; ) {
517 me = x[
i].gq(home, y[v].
min());
524 me = y[
v].lq(home, x[
i].
max());
530 me = y[
v].gq(home, x[
i].
min());
547 me = x[
i].gq(home, y[l].
min());
TupleMaxIncExt(const ViewArray< View > &x0, const ViewArray< View > &z0)
Index comparison for ViewArray<Tuple>.
Storage class for mininmum and maximum of a variable.
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntPropLevel)
Post propagator for .
int iset
Initial set label.
ExecStatus subsumed(Space &home, Propagator &p, int c, TaskArray< Task > &t)
Check for subsumption (all tasks must be assigned)
Item used to construct the OfflineMin sequence.
int ModEvent
Type for modification events.
const int large[]
Large Photo example.
View comparison on ViewTuples.
int succ
Successor in the Offline-Min sequence.
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.
unsigned int size(I &i)
Size of all ranges of range iterator i.
TupleMaxInc(const ViewArray< View > &x0)
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
int name
Name or label of a set.
Representation of a strongly connected component.
Post propagator for SetVar SetOpType SetVar SetRelType r
int right
Direct right neighbour of an y-node in a scc.
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
Post propagator for SetVar SetOpType SetVar y
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
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
bool assigned(void) const
Test if all variables are assigned.
Extended Index comparison for ViewArray<Tuple>.
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.
Post propagator for SetVar x
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.
void unite(int a, int b, int c)
Unite two sets a and b and label the union with c.
Gecode toplevel namespace
LinFloatExpr sum(const FloatVarArgs &x)
Construct linear float expression as sum of float variables.
const int small[]
Small Photo example.
int size(void) const
Return size of array (number of elements)
int size(void)
Return the size of the Offline-Min item.
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.