40 namespace 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++)
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++) {
91 x[
i]=xy[
i]; y[
i]=xy[n+
i];
102 static const int n = 3;
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];
void sorted(Home home, const IntVarArgs &x, const IntVarArgs &y, const IntVarArgs &z, IntPropLevel)
Post propagator that y is x sorted in increasing order.
Test sorted with permutation variables
Relation for sorting integers in increasing order.
NoVar(void)
Create and register test.
virtual bool solution(const Assignment &xyz) const
Test whether xyz is solution
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
PermVar(void)
Create and register test.
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
bool operator()(const int x, const int y)
Test whether x is less than y
Passing integer variables.
Post propagator for SetVar SetOpType SetVar y
Node * x
Pointer to corresponding Boolean expression node.
Base class for assignments
virtual bool solution(const Assignment &xy) const
Test whether xy is solution
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.
Test sorted without permutation variables