38 namespace Gecode {
namespace Int {
namespace Circuit {
40 template<
class View,
class Offset>
44 start(0), y(home,x), o(o0) {
48 template<
class View,
class Offset>
53 y.update(home,share,p.
y);
71 template<
class View,
class Offset>
95 unsigned int n_edges = 0;
96 for (
int i=n;
i--; ) {
97 n_edges +=
x[
i].size();
148 si[
i].
v.init(
o(
x[i]));
150 if (si[si[i].
v.val()].
pre < 0) {
154 }
else if ((subtree_min <= si[si[i].
v.val()].
pre) &&
155 (si[si[i].
v.val()].
pre <= subtree_max)) {
157 eq[n_eq].
x =
o(
x[i]);
158 eq[n_eq].
n = si[
i].
v.val();
159 }
else if (si[si[i].
v.val()].
pre < subtree_min) {
160 nq[n_nq].
x =
o(
x[i]);
161 nq[n_nq].
n = si[
i].
v.val();
165 if (si[si[i].
v.val()].
low < si[
i].
min)
166 si[i].
min = si[si[i].
v.val()].
low;
169 if (si[i].
min < si[i].low) {
171 }
else if (i !=
start) {
185 subtree_min = subtree_max+1;
203 if (subtree_min > 1) {
205 if (si[
v.val()].
pre < subtree_min) {
206 nq[n_nq].
x =
o(
x[
v.val()]);
207 nq[n_nq].
n =
v.val();
215 ModEvent me = eq[n_eq].
x.eq(home,eq[n_eq].n);
224 ModEvent me = nq[n_nq].
x.nq(home,nq[n_nq].n);
238 template<
class View,
class Offset>
249 int* end = r.
alloc<
int>(
n);
257 for (
int i=
y.size();
i--; ) {
277 end[j0]=j; tell.
push(j0);
284 while (!tell.
empty()) {
292 template<
class View,
class Offset>
297 return sizeof(*this);
void push(const T &x)
Push element x on top of stack.
ExecStatus ES_SUBSUMED(Propagator &p)
ActorLink * next(void) const
Routines for double-linked list.
Offset o
Offset transformation.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
ExecStatus path(Space &home)
Ensure path property: prune edges that could give too small cycles.
bool empty(void) const
Test whether stack is empty.
int ModEvent
Type for modification events.
ViewArray< View > x
Array of views.
ExecStatus connected(Space &home)
Check whether the view value graph is strongly connected.
Value iterator for integer views.
Propagation has computed fixpoint.
int val(void) const
Return current value.
int start
Remember where to start the next time the propagator runs.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Execution has resulted in failure.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
ViewArray< View > y
Array for performing value propagation for distinct.
void update(const Offset &o)
Update during cloning.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Converter with fixed offset.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Node * x
Pointer to corresponding Boolean expression node.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
Base(Space &home, bool share, Base &p)
Constructor for cloning p.
bool assigned(View x, int v)
Whether x is assigned to value v.
Stack with fixed number of elements.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
T pop(void)
Pop topmost element from stack and return it.
Propagation has not computed fixpoint.
Information required for non-recursive checking for a single scc.
Gecode toplevel namespace
Int::ViewValues< View > v
Home class for posting propagators
Base-class for circuit propagator.
bool me_failed(ModEvent me)
Check whether modification event me is failed.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Information for performing a recorded tell.