40namespace Test {
namespace Int {
64 static const int n = 3;
71 for (
int i=0;i<3; i++) {
72 x[i]=xy[i]; y[i]=xy[
n+i];
75 for (
int i=0; i<
n-1; i++)
82 for (
int i=0; i<
n; i++)
90 for (
int i=0; i<
n; i++) {
91 x[i]=xy[i]; y[i]=xy[
n+i];
102 static const int n = 3;
108 int x[
n], y[
n], z[
n];
109 for (
int i=0; i<
n; i++) {
110 x[i]=xyz[i]; y[i]=xyz[
n+i]; z[i]=xyz[2*
n+i];
113 for (
int i=0; i<
n; i++)
114 for (
int j=i+1; j<
n; j++)
119 for (
int i=0; i<
n-1; i++)
124 for (
int i=0; i<
n; i++)
125 if ((z[i] < 0) || (z[i] >=
n))
129 for (
int i=0; i<
n; i++)
136 for (
int i=0; i<
n; i++)
145 for (
int i=0; i<
n; i++) {
146 x[i]=xyz[i]; y[i]=xyz[
n+i]; z[i]=xyz[2*
n+i];
Node * x
Pointer to corresponding Boolean expression node.
Passing integer variables.
Base class for assignments
Test sorted without permutation variables
virtual bool solution(const Assignment &xy) const
Test whether xy is solution
virtual void post(Gecode::Space &home, Gecode::IntVarArray &xy)
Post constraint on xy.
NoVar(void)
Create and register test.
static const int n
Number of variables to be sorted.
Test sorted with permutation variables
virtual void post(Gecode::Space &home, Gecode::IntVarArray &xyz)
Post constraint on xyz.
static const int n
Number of variables to be sorted.
virtual bool solution(const Assignment &xyz) const
Test whether xyz is solution
PermVar(void)
Create and register test.
Relation for sorting integers in increasing order.
bool operator()(const int x, const int y)
Test whether x is less than y
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
void sorted(Home home, const IntVarArgs &x, const IntVarArgs &y, IntPropLevel ipl=IPL_DEF)
Post propagator that y is x sorted in increasing order.