40 namespace Gecode {
namespace Int {
namespace NValues {
87 dis = r.
alloc<
int>(
n); n_dis = 0;
126 assert(
x.
size() > 0);
130 for (
int i=
x.
size()-1;
i--; ) {
137 if (static_cast<unsigned int>(
x.
size()+
vs.
size()) < s)
140 return static_cast<int>(s);
164 if (
y.max() ==
vs.
size() + 1) {
167 for (
int i=n_dis;
i--; )
176 for (
int i=
x.
size(); i--; ) {
199 int* m = r.
alloc<
int>(n_dis*(n_dis-1));
200 for (
int i=n_dis;
i--; ) {
202 ovl_i[dis[
i]] = m; m += n_dis-1;
212 for (
int i=n_dis;
i--; )
220 for (
int i=n_dis; i--; )
237 for (
int i=0;
true; i++)
243 int di = re[
i].
view, dj = j.val();
244 if (!ovl.get(di,dj)) {
246 ovl_i[di][deg[di]++] = dj;
247 ovl_i[dj][deg[dj]++] = di;
250 cur.
set(static_cast<unsigned int>(re[i].view));
253 cur.
clear(static_cast<unsigned int>(re[i].view));
265 for (
int i=n_dis;
i--; ) {
266 assert(deg[dis[
i]] < n_dis);
267 n_ovl_i[dis[
i]] = deg[dis[
i]];
271 int* ind = r.
alloc<
int>(n_dis);
276 int d_min = deg[dis[i_min]];
277 unsigned int s_min =
x[dis[i_min]].
size();
280 for (
int i=n_dis-1;
i--; )
281 if ((d_min > deg[dis[
i]]) ||
282 ((d_min == deg[dis[i]]) && (s_min >
x[dis[i]].
size()))) {
289 ind[n_ind++] = dis[i_min]; dis[i_min] = dis[--n_dis];
292 for (
int i=n_dis; i--; )
293 if (ovl.get(dis[i],ind[n_ind-1])) {
295 for (
int j=n_ovl_i[dis[i]]; j--; )
296 deg[ovl_i[dis[i]][j]]--;
298 dis[
i] = dis[--n_dis];
305 if (
vs.
size() + n_ind ==
y.max()) {
308 for (
int i=n_ind;
i--; )
313 for (
int i=
x.
size(); i--; ) {
331 if (
y.min() == g.
size()) {
ExecStatus prune_lower(Space &home, int *dis, int n_dis)
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
Event for range-based overlap analysis.
void add(Space &home)
Add values of assigned views to value set.
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
virtual PropCost cost(const Space &, const ModEventDelta &) const
Cost function.
union Gecode::@579::NNF::@61 u
Union depending on nodetype t.
ExecStatus ES_SUBSUMED(Propagator &p)
void clear(unsigned int i)
Clear bit i.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Mixed (n+1)-ary propagator.
First is subset of second iterator.
Domain consistent distinct propagator.
int size(Space &home) const
Return a size estimate based on the union of all values.
int val
The value for the range (first or last value, depending on type)
void eliminate(Space &home)
Eliminate subsumed views (all values included in the value set vs)
Range iterator for integer variable views
ViewArray< IntView > x
Array of views.
Value iterator for values in a bitset.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
ExecStatus all_in_valset(Space &home)
Propagate that all views must take values from value set.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
int n
Number of negative literals for node type.
void reset(void)
Reset iterator to start.
void dispose(Space &home)
Dispose value set.
Execution has resulted in failure.
int size(void) const
Return size (number of values)
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
IntBase(Home home, ValSet &vs, ViewArray< IntView > &x, VY y)
Constructor for posting.
ExecStatus prune_upper(Space &home, Graph &g)
Range iterator for union of iterators.
int view
Which view does this range belong to.
unsigned int size(I &i)
Size of all ranges of range iterator i.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
void purge(void)
Purge graph if necessary (reset information to avoid overflow)
View-value graph for propagation of upper bound.
void set(unsigned int i)
Set bit i.
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p with propagation condition pc to all views.
ValSet vs
Value set storing the values of already assigned views.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
void sync(Space &home)
Synchronize graph with new view domains.
Post propagator for SetVar SetOpType SetVar SetRelType r
void disjoint(Space &home, Region &r, int *&dis, int &n_dis)
Integer view for integer variables.
const int infinity
Infinity for integers.
Post propagator for SetVar SetOpType SetVar y
RangeEventType ret
The event type.
Range iterator for intersection of iterators.
Iter::Ranges::CompareStatus compare(View x) const
Compare view x with value set.
Symmetric diagonal bit matrix.
bool assigned(View x, int v)
Whether x is assigned to value v.
void free(T *b, long unsigned int n)
Delete n objects allocated from the region starting at b.
int size(void) const
Return size of maximal matching (excluding assigned views)
Post propagator for SetVar x
Class for storing values of already assigned views.
Gecode toplevel namespace
void update(Space &home, bool share, ValSet &vs)
Update value set during cloning.
bool subset(View x) const
Whether all values of x are included in the value set.
Number of values propagator for integer views base class.
int size(void) const
Return size of array (number of elements)
int ModEventDelta
Modification event deltas.
Home class for posting propagators
#define GECODE_NEVER
Assert that this command is never executed.
void add(Space &home, int v)
Add value v to value set.
void init(Space &home, const ValSet &vs, const ViewArray< IntView > &x)
Initialize graph including values in vs.
ExecStatus prune(Space &home)
Prune all values corresponding to unused edges.