34namespace Gecode {
namespace Int {
namespace Circuit {
36 template<
class View,
class Offset>
40 start(0),
y(home,
x), o(o0) {
44 template<
class View,
class Offset>
67 template<
class View,
class Offset>
77 while (
x[v].assigned()) {
91 unsigned int n_edges = 0;
92 for (
int i=0; i<
n; i++) {
93 n_edges +=
x[i].size();
143 si[i].min = si[i].pre = si[i].low = cnt++;
144 si[i].v.init(o(
x[i]));
146 if (si[si[i].v.val()].pre < 0) {
150 }
else if ((subtree_min <= si[si[i].v.val()].pre) &&
151 (si[si[i].v.val()].pre <= subtree_max)) {
153 eq[n_eq].
x = o(
x[i]);
154 eq[n_eq].
n = si[i].v.val();
155 }
else if (si[si[i].v.val()].pre < subtree_min) {
156 nq[n_nq].
x = o(
x[i]);
157 nq[n_nq].
n = si[i].v.val();
161 if (si[si[i].v.val()].low < si[i].min)
162 si[i].min = si[si[i].v.val()].low;
165 if (si[i].
min < si[i].low) {
166 si[i].low = si[i].min;
167 }
else if (i != start) {
181 subtree_min = subtree_max+1;
199 if (subtree_min > 1) {
201 if (si[v.val()].pre < subtree_min) {
202 nq[n_nq].
x = o(
x[v.val()]);
203 nq[n_nq].
n = v.val();
228 start = o(
x[start]).min();
234 template<
class View,
class Offset>
245 int* end =
r.alloc<
int>(
n);
246 for (
int i=0; i<
n; i++)
253 for (
int i=0; i<
y.size(); i++) {
254 assert(!
y[i].assigned());
261 if (
x[j0].assigned() && (end[j0] < 0)) {
269 }
while (
x[j].assigned());
273 end[j0]=j; tell.
push(j0);
280 while (!tell.
empty()) {
288 template<
class View,
class Offset>
293 return sizeof(*this);
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
Home class for posting propagators
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Base-class for circuit propagator.
ExecStatus connected(Space &home)
Check whether the view value graph is strongly connected.
ViewArray< View > y
Array for performing value propagation for distinct.
Offset o
Offset transformation.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
ExecStatus path(Space &home)
Ensure path property: prune edges that could give too small cycles.
Base(Space &home, Base &p)
Constructor for cloning p.
Information required for non-recursive checking for a single scc.
Int::ViewValues< View > v
Information for performing a recorded tell.
Converter with fixed offset.
void update(const Offset &o)
Update during cloning.
Value iterator for integer views.
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.
ExecStatus ES_SUBSUMED(Propagator &p)
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
bool me_failed(ModEvent me)
Check whether modification event me is failed.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Gecode toplevel namespace
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 SetOpType SetVar y
@ ES_FIX
Propagation has computed fixpoint.
@ ES_FAILED
Execution has resulted in failure.
@ ES_NOFIX
Propagation has not computed fixpoint.
Post propagator for SetVar x
int ModEvent
Type for modification events.