36namespace Gecode {
namespace Int {
namespace ViewValGraph {
41 : view(NULL), val(NULL), n_view(0), n_val(0),
count(1U) {}
55 while (xi() && (*v != NULL)) {
56 if ((*v)->val() == xi.
val()) {
60 v = (*v)->next_val_ref();
62 }
else if ((*v)->val() < xi.
val()) {
64 v = (*v)->next_val_ref();
96 if (!e->
val(
x)->matching()) {
100 x = m.
pop(); e =
x->iter;
101 e->
val(
x)->matching()->revert(e->
val(
x));
115 x = e->
val(
x)->matching()->view(e->
val(
x));
122 x = m.
pop(); e =
x->iter;
goto next;
131 if (
count > (UINT_MAX >> 1)) {
133 for (
int i=0; i<n_view; i++)
149 unsigned int cnt0 =
count;
150 unsigned int cnt1 =
count;
152 for (
int i=0; i<n_view; i++)
173 if (e->
dst(w)->low < w->
min)
188 if (!visit.
empty()) {
189 w=visit.
pop(); e=w->
iter;
goto next;
Edges in view-value graph.
ValNode< View > * val(ViewNode< View > *x) const
Return value node when view node x is given.
Edge< View > * next_edge(void) const
Return next edge in list of value edges.
Edge< View > ** next_edge_ref(void)
Return reference to next edge in list of value edges.
Node< View > * dst(Node< View > *s) const
Return destination of edge when source s is given.
Edge< View > * next(void) const
Return next edge in list of edges per node.
void revert(Node< View > *d)
Revert edge to node d for matching.
View-value graph base class.
void purge(void)
Purge graph if necessary (reset information to avoid overflow)
Graph(void)
Construct graph as not yet initialized.
void init(Space &home, ViewNode< View > *x)
Initialize the edges for the view node x.
bool match(ViewNodeStack &m, ViewNode< View > *x)
Find a matching for node x.
void scc(void)
Compute the strongly connected components.
Base-class for nodes (both view and value nodes)
Edge< View > * edge_fst(void) const
Return first edge (organized by bi-links)
Edge< View > * iter
Next edge for computing strongly connected components.
Edge< View > * edge_lst(void) const
Return last edge (organized by bi-links)
unsigned int low
Values for computing strongly connected components.
Value nodes in view-value graph.
ValNode< View > ** next_val_ref(void)
Return pointer to next value node fields.
View nodes in view-value graph.
Value iterator for integer views.
int val(void) const
Return current value.
Stack with fixed number of elements.
void push(const T &x)
Push element x on top of stack.
T pop(void)
Pop topmost element from stack and return it.
bool empty(void) const
Test whether stack is empty.
Gecode toplevel namespace
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntPropLevel ipl=IPL_DEF)
Post propagator for .
Post propagator for SetVar SetOpType SetVar SetRelType r
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Post propagator for SetVar x