34namespace Gecode {
namespace Int {
namespace Channel {
36 template<
class Info,
class Offset, PropCond pc>
40 :
Propagator(home),
n(n0), n_na(2*
n), ox(ox0), oy(oy0), xy(xy0) {
41 for (
int i=0; i<2*
n; i++)
42 xy[i].view.subscribe(home,*
this,pc);
45 template<
class Info,
class Offset, PropCond pc>
49 xy(home.alloc<Info>(2*
n)) {
52 for (
int i=0; i<2*
n; i++)
53 xy[i].update(home,
p.xy[i]);
56 template<
class Info,
class Offset, PropCond pc>
62 template<
class Info,
class Offset, PropCond pc>
65 for (
int i=0; i<2*
n; i++)
66 xy[i].view.reschedule(home,*
this,pc);
69 template<
class Info,
class Offset, PropCond pc>
72 for (
int i=0; i<2*
n; i++)
73 xy[i].view.cancel(home,*
this,pc);
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Home class for posting propagators
Base-class for channel propagators.
Base(Space &home, Base< Info, Offset, pc > &p)
Constructor for cloning p.
Offset oy
Offset transformation for y variables.
int n
Number of views (actually twice as many for both x and y)
Offset ox
Offset transformation for x variables.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Propagation cost (defined as low quadratic)
Info * xy
View and information for both x and y.
virtual void reschedule(Space &home)
Schedule function.
Converter with fixed offset.
void update(const Offset &o)
Update during cloning.
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
Base-class for propagators.
int ModEventDelta
Modification event deltas.
Gecode toplevel namespace