40 namespace Test {
namespace Int {
64 static const int n = 3;
71 for (
int i=0;
i<3;
i++) {
75 for (
int i=0;
i<
n-1;
i++)
80 Gecode::Support::quicksort<int,SortIntMin>(
x,
n,sim);
82 for (
int i=0;
i<
n;
i++)
90 for (
int i=0;
i<
n;
i++) {
93 Gecode::sorted(home,
x,y);
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++)
135 Gecode::Support::quicksort<int,SortIntMin>(
x,
n,sim);
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];
148 Gecode::sorted(home,
x,y,z);
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
Gecode::IntArgs i({1, 2, 3, 4})