38 namespace Gecode {
namespace Int {
namespace Sorted {
47 template<
class View,
bool Perm>
53 for (
int i=x.
size();
i--; ) {
54 xz[
i].
x=x[
i]; xz[
i].
z=z[
i];
58 (&xz[0], x.
size(), min_inc);
59 for (
int i=x.
size();
i--; ) {
60 x[
i]=xz[
i].x; z[
i]=xz[
i].z;
64 Support::quicksort<View,TupleMinInc<View> >(&x[0], x.
size(), min_inc);
76 template<
class View,
bool Perm>
103 for (
int i = 1;
i < ys;
i++) {
107 nofix |= (
me_modified(me_lb) && y[
i - 1].min() != y[
i].min());
110 for (
int i = ys - 1;
i--; ) {
114 nofix |= (
me_modified(me_ub) && y[
i + 1].max() != y[
i].max());
118 for (
int i = xs;
i--; ) {
124 me = x[
i].lq(home, y[xs - 1].
max());
127 nofix |= (
me_modified(me) && x[
i].max() != y[xs - 1].max());
154 for (
int i = 1;
i < ps;
i++) {
158 if (z[
i].
min() != sinfo[scclist[
i]].leftmost) {
175 z[
i - 1].min() != z[
i].min());
183 for (
int i = ps - 1;
i--; ) {
184 if (x[tau[
i]].
max() < x[tau[
i + 1]].max()) {
185 if (z[tau[
i]].
max() > z[tau[
i + 1]].max()) {
189 if (x[tau[
i + 1]].
min() > x[tau[
i]].max()) {
200 z[tau[
i + 1]].max() != z[tau[
i]].max());
Index comparison for ViewArray.
void sort_tau(ViewArray< View > &x, ViewArray< View > &z, int tau[])
Build .
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
int ModEvent
Type for modification events.
View comparison on ViewTuples.
bool normalize(Space &home, ViewArray< View > &y, ViewArray< View > &x, bool &nofix)
Performing normalization on the views in y.
Gecode::IntArgs i(4, 1, 2, 3, 4)
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
int rightmost
Rightmost reachable y-node in a scc.
void sort_sigma(Space &home, ViewArray< View > &x, ViewArray< View > &z)
Build .
bool perm_bc(Space &home, int tau[], SccComponent sinfo[], int scclist[], ViewArray< View > &x, ViewArray< View > &z, bool &crossingedge, bool &nofix)
Bounds consistency on the permutation views.
Representation of a strongly connected component.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Node * x
Pointer to corresponding Boolean expression node.
bool assigned(View x, int v)
Whether x is assigned to value v.
Extended Index comparison for ViewArray.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
int size(void) const
Return size of array (number of elements)
Gecode toplevel namespace
bool me_failed(ModEvent me)
Check whether modification event me is failed.
Extended view comparison on pairs of views.