49 bool operator ()(
const std::pair<X,int>& lhs,
50 const std::pair<X,int>& rhs) {
51 return lhs.second < rhs.second;
56 IntVar unify(Home home, IntVar
x, IntVar y) {
61 IntSet unify(Home,
const IntSet&
x,
const IntSet& y) {
64 Iter::Ranges::Inter<IntSetRanges,IntSetRanges>
i(xr,yr);
71 void removeDuplicates(Home home, A&
c, IntArgs&
v) {
72 typedef typename A::value_type S;
73 typedef std::pair<S,int> P;
75 P*
a = re.alloc<P>(
c.size());
76 for (
int i=0;
i<
c.size();
i++)
82 int cur =
a[0].second-1;
83 for (
int i=0;
i<
c.size();
i++) {
84 if (
a[
i].second==cur) {
85 cc[cc.size()-1] = unify(home, cc[cc.size()-1],
a[
i].first);
92 re.free<P>(
a,
c.size());
105 if (
v.size() !=
c.size())
112 removeDuplicates(home,
c,
v);
117 for (
int i=0;
i<
v.size();
i++)
118 cv[
i].init(
c[
i],
v[
i]);
138 for (
int i=0;
i<
c.size();
i++)
150 if (
v.size() !=
c.size())
154 for (
int i=0;
i<
c.size();
i++) {
162 removeDuplicates(home,
c,
v);
166 for (
int i=0;
i<
v.size();
i++) {
167 if (
c[
i].ranges() > 1) {
170 for (
int j=0; j<
v.size(); j++)
171 cv[j].init(home,
c[j],
v[j]);
192 for (
int i=0;
i<
c.size();
i++)
214 for (
int i=0;
i<
c.size();
i++)
223 for (
int i=0;
i<
v.size();
i++)
void values(Home home, const IntVarArgs &x, IntSet y, IntPropLevel ipl)
Post constraint .
Node * x
Pointer to corresponding Boolean expression node.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
Home class for posting propagators
Passing integer arguments.
Passing integer variables.
Exception: Arguments contain same variable multiply
Exception: Arguments are of different size
Bounds consistent global cardinality propagator.
Domain consistent global cardinality propagator.
Value consistent global cardinality propagator.
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntPropLevel)
Post propagator for .
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
#define GECODE_POST
Check for failure in a constraint post function.
#define GECODE_ES_FAIL(es)
Check whether execution status es is failed, and fail space home.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
IntPropLevel
Propagation levels for integer propagators.
@ IPL_DOM
Domain propagation Options: basic versus advanced propagation.
@ IPL_BND
Bounds propagation.
IntPropLevel vbd(IntPropLevel ipl)
Extract value, bounds, or domain propagation from propagation level.
bool same(VarArgArray< Var > x, VarArgArray< Var > y)
const FloatNum max
Largest allowed float value.
const FloatNum min
Smallest allowed float value.
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
Gecode::IntArgs i({1, 2, 3, 4})
Multi _c(Gecode::IntArgs({1, 2, 3}))