53 bool operator ()(
const std::pair<X,int>& lhs,
54 const std::pair<X,int>& rhs) {
55 return lhs.second < rhs.second;
60 IntVar unify(Home home, IntVar
x, IntVar y) {
65 IntSet unify(Home,
const IntSet&
x,
const IntSet& y) {
68 Iter::Ranges::Inter<IntSetRanges,IntSetRanges>
i(xr,yr);
75 void removeDuplicates(Home home, A&
c, IntArgs&
v) {
76 typedef typename A::value_type S;
77 typedef std::pair<S,int> P;
79 P*
a = re.alloc<P>(
c.size());
80 for (
int i=
c.size();
i--;)
86 int cur =
a[0].second-1;
87 for (
int i=0;
i<
c.size();
i++) {
88 if (
a[
i].second==cur) {
89 cc[cc.size()-1] = unify(home, cc[cc.size()-1],
a[
i].first);
96 re.free<P>(
a,
c.size());
109 if (
v.size() !=
c.size())
116 removeDuplicates(home,
c,
v);
121 for (
int i =
v.size();
i--; )
122 cv[
i].init(
c[
i],
v[
i]);
142 for (
int i =
c.size();
i--; )
154 if (
v.size() !=
c.size())
158 for (
int i=
c.size();
i--; ) {
167 removeDuplicates(home,
c,
v);
171 for (
int i =
v.size();
i--; ) {
172 if (
c[
i].ranges() > 1) {
175 for (
int j =
v.size(); j--; )
176 cv[j].init(home,
c[j],
v[j]);
197 for (
int i =
c.size();
i--; )
219 for (
int i =
c.size();
i--; )
228 for (
int i =
v.size();
i--; )
Value consistent global cardinality propagator.
IntConLevel
Consistency levels for integer propagators.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Multi _c(Gecode::IntArgs(3, 1, 2, 3))
Gecode::IntArgs i(4, 1, 2, 3, 4)
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
Domain consistent global cardinality propagator.
bool failed(void) const
Check whether corresponding space is failed.
Passing integer variables.
Passing integer arguments.
struct Gecode::@511::NNF::@54::@56 a
For atomic nodes.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void values(Home home, const IntVarArgs &x, IntSet y, IntConLevel icl=ICL_DEF)
Post constraint .
Node * x
Pointer to corresponding Boolean expression node.
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntConLevel)
Post propagator for .
Exception: Arguments contain same variable multiply
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Bounds propagation or consistency.
Gecode toplevel namespace
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
Home class for posting propagators
Exception: Arguments are of different size
#define GECODE_ES_FAIL(es)
Check whether execution status es is failed, and fail space home.
Bounds consistent global cardinality propagator.
Domain propagation or consistency.