44 namespace Test {
namespace Int {
68 static const int n = 3;
75 for (
int i=0;
i<3;
i++) {
76 x[
i]=xy[
i]; y[
i]=xy[n+
i];
79 for (
int i=0;
i<n-1;
i++)
84 Gecode::Support::quicksort<int,SortIntMin>(
x,
n,sim);
86 for (
int i=0;
i<
n;
i++)
94 for (
int i=0;
i<
n;
i++) {
95 x[
i]=xy[
i]; y[
i]=xy[n+
i];
106 static const int n = 3;
112 int x[
n], y[
n], z[
n];
113 for (
int i=0;
i<
n;
i++) {
114 x[
i]=xyz[
i]; y[
i]=xyz[n+
i]; z[
i]=xyz[2*n+
i];
117 for (
int i=0;
i<
n;
i++)
118 for (
int j=
i+1; j<
n; j++)
123 for (
int i=0;
i<n-1;
i++)
128 for (
int i=0;
i<
n;
i++)
129 if ((z[
i] < 0) || (z[
i] >= n))
133 for (
int i=0;
i<
n;
i++)
139 Gecode::Support::quicksort<int,SortIntMin>(
x,
n,sim);
140 for (
int i=0; i<
n; i++)
149 for (
int i=0;
i<
n;
i++) {
150 x[
i]=xyz[
i]; y[
i]=xyz[n+
i]; z[
i]=xyz[2*n+
i];
Test sorted with permutation variables
Relation for sorting integers in increasing order.
virtual bool solution(const Assignment &xyz) const
Test whether xyz is solution
NoVar(void)
Create and register test.
Gecode::IntArgs i(4, 1, 2, 3, 4)
PermVar(void)
Create and register test.
virtual bool solution(const Assignment &xy) const
Test whether xy is solution
bool operator()(const int x, const int y)
Test whether x is less than y
Passing integer variables.
void sorted(Home home, const IntVarArgs &x, const IntVarArgs &y, const IntVarArgs &z, IntConLevel)
Post propagator that y is x sorted in increasing order.
Node * x
Pointer to corresponding Boolean expression node.
Base class for assignments
static const int n
Number of variables to be sorted.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &xyz)
Post constraint on xyz.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &xy)
Post constraint on xy.
static const int n
Number of variables to be sorted.
Test sorted without permutation variables