34 namespace Gecode {
namespace Int {
namespace Sorted {
43 template<
class View,
bool Perm>
49 for (
int i=x.
size();
i--; ) {
50 xz[
i].
x=x[
i]; xz[
i].
z=z[
i];
54 (&xz[0], x.
size(), min_inc);
55 for (
int i=x.
size();
i--; ) {
56 x[
i]=xz[
i].x; z[
i]=xz[
i].z;
60 Support::quicksort<View,TupleMinInc<View> >(&x[0], x.
size(), min_inc);
72 template<
class View,
bool Perm>
99 for (
int i = 1;
i < ys;
i++) {
103 nofix |= (
me_modified(me_lb) && y[
i - 1].min() != y[
i].min());
106 for (
int i = ys - 1;
i--; ) {
110 nofix |= (
me_modified(me_ub) && y[
i + 1].max() != y[
i].max());
114 for (
int i = xs;
i--; ) {
120 me = x[
i].lq(home, y[xs - 1].
max());
123 nofix |= (
me_modified(me) && x[
i].max() != y[xs - 1].max());
150 for (
int i = 1;
i < ps;
i++) {
154 if (z[
i].
min() != sinfo[scclist[
i]].leftmost) {
171 z[
i - 1].min() != z[
i].min());
179 for (
int i = ps - 1;
i--; ) {
180 if (x[tau[
i]].
max() < x[tau[
i + 1]].max()) {
181 if (z[tau[
i]].
max() > z[tau[
i + 1]].max()) {
185 if (x[tau[
i + 1]].
min() > x[tau[
i]].max()) {
196 z[tau[
i + 1]].max() != z[tau[
i]].max());
Index comparison for ViewArray<Tuple>.
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.
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
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.
Post propagator for SetVar SetOpType SetVar SetRelType r
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Post propagator for SetVar SetOpType SetVar y
void sort_sigma(ViewArray< View > &x, ViewArray< View > &z)
Build .
bool assigned(View x, int v)
Whether x is assigned to value v.
Extended Index comparison for ViewArray<Tuple>.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
Post propagator for SetVar x
Gecode toplevel namespace
int size(void) const
Return size of array (number of elements)
bool me_failed(ModEvent me)
Check whether modification event me is failed.
Extended view comparison on pairs of views.