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()) {
187 while (sequence[
x].parent !=
x) {
192 return sequence[
x].
name;
198 while (sequence[
x].parent !=
x) {
203 for (
int i=0;
i<vsize;
i++)
204 sequence[vertices[
i]].parent =
x;
206 return sequence[
x].
name;
216 if (sequence[
ra].rank > sequence[
rb].rank) {
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();
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++) {
462 x[
i].min() >
y[
pi].max()) {
468 int gauss = ( (
n * (
n + 1)) / 2);
471 if (
sum != gauss -
n) {
492 for (
int i=0;
i<
n;
i++) {
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());
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int n
Number of negative literals for node type.
Node * x
Pointer to corresponding Boolean expression node.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
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.
Offline-Min datastructure Used to compute the perfect matching between the unsorted views x and the s...
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.
Extended Index comparison for ViewArray<Tuple>.
bool operator()(const int i, const int j)
TupleMaxIncExt(const ViewArray< View > &x0, const ViewArray< View > &z0)
Index comparison for ViewArray<Tuple>.
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 whether view is assigned.
VarImp * x
Pointer to variable implementation.
int ModEvent
Type for modification events.
const int small[]
Small Photo example.
const int large[]
Large Photo example.
LinFloatExpr sum(const FloatVarArgs &x)
Construct linear float expression as sum of float variables.
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Post propagator for SetVar SetOpType SetVar y
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.
const FloatNum max
Largest allowed float value.
const FloatNum min
Smallest allowed float value.
ExecStatus subsumed(Space &home, Propagator &p, int c, TaskArray< Task > &t)
Check for subsumption (all tasks must be assigned)
bool assigned(View x, int v)
Whether x is assigned to value v.
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.
unsigned int size(I &i)
Size of all ranges of range iterator i.
Gecode::FloatVal c(-8, 8)
Gecode::IntArgs i({1, 2, 3, 4})