40 namespace Gecode {
namespace Int {
namespace ViewValGraph {
45 : view(NULL), val(NULL), n_view(0), n_val(0),
count(1U) {}
59 while (xi() && (*v != NULL)) {
60 if ((*v)->val() == xi.val()) {
64 v = (*v)->next_val_ref();
66 }
else if ((*v)->val() < xi.val()) {
68 v = (*v)->next_val_ref();
100 if (!e->
val(x)->matching()) {
105 e->
val(x)->matching()->revert(e->
val(x));
119 x = e->
val(x)->matching()->view(e->
val(x));
126 x = m.
pop(); e = x->
iter;
goto next;
135 if (
count > (UINT_MAX >> 1)) {
137 for (
int i=n_view;
i--; )
153 unsigned int cnt0 =
count;
154 unsigned int cnt1 =
count;
156 for (
int i = n_view;
i--; )
177 if (e->
dst(w)->low < w->
min)
192 if (!visit.
empty()) {
193 w=visit.
pop(); e=w->
iter;
goto next;
void push(const T &x)
Push element x on top of stack.
Edge< View > * next_edge(void) const
Return next edge in list of value edges.
bool initialized(void) const
Test whether graph has been initialized.
Edge< View > * edge_fst(void) const
Return first edge (organized by bi-links)
ValNode< View > * val(ViewNode< View > *x) const
Return value node when view node x is given.
Edge< View > * val_edges(void) const
Return first edge of all value edges.
Edge< View > ** next_edge_ref(void)
Return reference to next edge in list of value edges.
Edge< View > * next(void) const
Return next edge in list of edges per node.
Value iterator for integer views.
Edges in view-value graph.
ValNode< View > ** next_val_ref(void)
Return pointer to next value node fields.
View view(void) const
Return view.
bool empty(void) const
Test whether stack is empty.
Gecode::IntArgs i(4, 1, 2, 3, 4)
View nodes in view-value graph.
unsigned int low
Values for computing strongly connected components.
void revert(Node< View > *d)
Revert edge to node d for matching.
void purge(void)
Purge graph if necessary (reset information to avoid overflow)
Edge< View > * edge_lst(void) const
Return last edge (organized by bi-links)
Graph(void)
Construct graph as not yet initialized.
void init(Space &home, ViewNode< View > *x)
Initialize the edges for the view node x.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Node * x
Pointer to corresponding Boolean expression node.
Edge< View > ** val_edges_ref(void)
Return pointer to first edge fields of all value edges.
Value nodes in view-value graph.
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntConLevel)
Post propagator for .
Stack with fixed number of elements.
T pop(void)
Pop topmost element from stack and return it.
Gecode toplevel namespace
void scc(Space &home)
Compute the strongly connected components.
Node< View > * dst(Node< View > *s) const
Return destination of edge when source s is given.
bool match(ViewNodeStack &m, ViewNode< View > *x)
Find a matching for node x.
Edge< View > * iter
Next edge for computing strongly connected components.
Base-class for nodes (both view and value nodes)