38#ifndef __GECODE_INT_LINEAR_HH__
39#define __GECODE_INT_LINEAR_HH__
64 template<
class Val,
class A,
class B, PropCond pc>
97 template<
class Val,
class A,
class B, PropCond pc,
class Ctrl>
133 template<
class Val,
class A,
class B>
167 template<
class Val,
class A,
class B,
class Ctrl, ReifyMode rm>
200 template<
class Val,
class A,
class B>
236 template<
class Val,
class A,
class B>
270 template<
class Val,
class A,
class B>
304 template<
class Val,
class A,
class B, ReifyMode rm>
329namespace Gecode {
namespace Int {
namespace Linear {
345 template<
class Val,
class A,
class B,
class C, PropCond pc>
383 template<
class Val,
class A,
class B,
class C>
418 template<
class Val,
class A,
class B,
class C>
453 template<
class Val,
class A,
class B,
class C>
480namespace Gecode {
namespace Int {
namespace Linear {
496 template<
class Val,
class P,
class N, PropCond pc>
528 template<
class Val,
class P,
class N, PropCond pc,
class Ctrl>
551 template<
class Val,
class View>
560 template<
class Val,
class View>
576 template<
class Val,
class P,
class N>
577 class Eq :
public Lin<Val,P,N,PC_INT_BND> {
607 template<
class Val,
class View>
609 :
public Lin<Val,View,View,PC_INT_DOM> {
648 template<
class Val,
class P,
class N,
class Ctrl, ReifyMode rm>
682 template<
class Val,
class P,
class N>
683 class Nq :
public Lin<Val,P,N,PC_INT_VAL> {
715 template<
class Val,
class P,
class N>
716 class Lq :
public Lin<Val,P,N,PC_INT_BND> {
748 template<
class Val,
class P,
class N, ReifyMode rm>
749 class ReLq :
public ReLin<Val,P,N,PC_INT_BND,BoolView> {
775namespace Gecode {
namespace Int {
namespace Linear {
915 template<
class VX,
class VB>
954 template<
class VX,
class VB, ReifyMode rm>
986 template<
class VX,
class VB, ReifyMode rm>
1016namespace Gecode {
namespace Int {
namespace Linear {
1022 template<
class XV,
class YV>
1051 template<
class XV,
class YV>
1077 template<
class XV,
class YV>
1103 template<
class XV,
class YV>
1127namespace Gecode {
namespace Int {
namespace Linear {
1167 bool empty(
void)
const;
1169 int size(
void)
const;
1207 bool empty(
void)
const;
1209 int size(
void)
const;
1219 template<
class SBAP,
class SBAN,
class VX, PropCond pcx>
1235 SBAP&
p, SBAN&
n, VX
x,
int c);
1250 template<
class SBAP,
class SBAN,
class VX>
1262 SBAP&
p, SBAN&
n, VX
x,
int c);
1277 template<
class SBAP,
class SBAN,
class VX>
1289 SBAP&
p, SBAN&
n, VX
x,
int c);
1304 template<
class SBAP,
class SBAN,
class VX>
1316 SBAP&
p, SBAN&
n, VX
x,
int c);
1329namespace Gecode {
namespace Int {
namespace Linear {
1335 template<
class View>
1360 template<
class View>
BinaryPropagator(Space &home, BinaryPropagator &p)
Generic domain change information to be supplied to advisors.
Home class for posting propagators
Boolean view for Boolean variables.
Integer view for integer variables.
Traits for Boolean negation view.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
DomEq(Space &home, DomEq &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< View > &x, ViewArray< View > &y, Val c)
Post propagator for .
ScaleBool * fst(void) const
Return pointer to first element.
void sort(void)
Sort array in decreasing order of coefficients.
int size(void) const
Return number of elements.
void reschedule(Space &home, Propagator &p)
Schedule propagator p.
void update(Space &home, EmptyScaleBoolArray &esba)
Update sba during copying.
void cancel(Space &home, Propagator &p)
Cancel propagator p.
EmptyScaleBoolArray(void)
Default constructor.
bool empty(void) const
Test whether array is empty.
void subscribe(Space &home, Propagator &p)
Subscribe propagator p.
ScaleBool * lst(void) const
Return pointer after last element.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
EqBin(Space &home, EqBin &p)
Constructor for cloning p.
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
virtual void reschedule(Space &home)
Schedule function.
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
virtual Actor * copy(Space &home)
Create copy during cloning.
EqBoolInt(Space &home, EqBoolInt &p)
Constructor for cloning p.
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
virtual Actor * copy(Space &home)
Create copy during cloning.
EqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
EqBoolView(Space &home, EqBoolView &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Create copy during cloning.
EqTer(Space &home, EqTer &p)
Constructor for cloning p.
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual Actor * copy(Space &home)
Create copy during cloning.
Eq(Space &home, Eq &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
GqBin(Space &home, GqBin &p)
Constructor for cloning p.
virtual void reschedule(Space &home)
Schedule function.
GqBoolInt(Space &home, GqBoolInt &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
GqBoolView(Space &home, GqBoolView &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual void reschedule(Space &home)
Schedule function.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary)
LinBin(Space &home, LinBin &p)
Constructor for cloning p.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high unary)
int n_as
Number of active subscriptions.
void normalize(void)
Normalize by removing unused views.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Council< Advisor > co
Council for managing single advisor.
int n_hs
Number of views that have or had subscriptions.
ViewArray< VX > x
Boolean views.
LinBoolInt(Space &home, LinBoolInt &p)
Constructor for cloning p.
LinBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
SBAP p
Positive Boolean views with coefficients on left-hand side.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
VX x
Integer view on right-hand side.
int c
Integer constant on right-hand side.
virtual void reschedule(Space &home)
Schedule function.
SBAN n
Negative Boolean views with coefficients on left-hand side.
LinBoolView(Space &home, LinBoolView &p)
Constructor for cloning p.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual void reschedule(Space &home)
Schedule function.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
YV y
View to compare number of assigned Boolean views to.
ViewArray< XV > x
Boolean views.
int c
Righthandside (constant part from Boolean views assigned to 1)
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low ternary)
LinTer(Space &home, LinTer &p)
Constructor for cloning p.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual void reschedule(Space &home)
Schedule function.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Lin(Space &home, Lin< Val, P, N, pc > &p)
Constructor for cloning p.
ViewArray< N > y
Array of negative views.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
ViewArray< P > x
Array of positive views.
virtual void reschedule(Space &home)
Schedule function.
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
LqBin(Space &home, LqBin &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
LqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
virtual Actor * copy(Space &home)
Create copy during cloning.
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
LqTer(Space &home, LqTer &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Create copy during cloning.
Lq(Space &home, Lq &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
NqBin(Space &home, NqBin &p)
Constructor for cloning p.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low unary)
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
virtual Actor * copy(Space &home)
Create copy during cloning.
static ExecStatus post(Home home, ViewArray< VX > &b, int c)
Post propagator for .
bool resubscribe(Space &home, VX &y)
Update subscription.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
NqBoolInt(Home home, ViewArray< VX > &b, int c)
Constructor for posting.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
ViewArray< VX > x
Views not yet subscribed to.
virtual Actor * copy(Space &home)
Create copy during cloning.
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
NqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
NqBoolView(Space &home, NqBoolView &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual Actor * copy(Space &home)
Create copy during cloning.
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
NqTer(Space &home, NqTer &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Create copy during cloning.
Nq(Space &home, Nq &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
static ExecStatus post(Home home, A x0, B x1, Val c, Ctrl b)
Post propagator for .
ReEqBin(Space &home, ReEqBin &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual Actor * copy(Space &home)
Create copy during cloning.
static ExecStatus post(Home home, ViewArray< VX > &x, int c, VB b)
Post propagator for .
virtual void reschedule(Space &home)
Schedule function.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
ReEqBoolInt(Space &home, ReEqBoolInt &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c, Ctrl b)
Post propagator for .
ReEq(Space &home, ReEq &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual void reschedule(Space &home)
Schedule function.
static ExecStatus post(Home home, ViewArray< VX > &x, int c, VB b)
Post propagator for .
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
virtual Actor * copy(Space &home)
Create copy during cloning.
ReGqBoolInt(Space &home, ReGqBoolInt &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Ctrl b
Control view for reification.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary)
ReLinBin(Space &home, ReLinBin &p)
Constructor for cloning p.
virtual void reschedule(Space &home)
Schedule function.
Council< Advisor > co
Council for single advisor.
void normalize(void)
Normalize by removing unused views.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high unary)
int n_s
Number of subscriptions.
ReLinBoolInt(Space &home, ReLinBoolInt &p)
Constructor for cloning p.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual void reschedule(Space &home)
Schedule function.
ReLin(Space &home, ReLin &p)
Constructor for cloning p.
Ctrl b
Control view for reification.
static ExecStatus post(Home home, A x0, B x1, Val c, BoolView b)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Create copy during cloning.
ReLqBin(Space &home, ReLqBin &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c, BoolView b)
Post propagator for .
ReLq(Space &home, ReLq &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
void cancel(Space &home, Propagator &p)
Cancel propagator p.
void sort(void)
Sort array in decreasing order of coefficients.
void reschedule(Space &home, Propagator &p)
Schedule propagator p.
ScaleBool * lst(void) const
Return pointer after last element.
void subscribe(Space &home, Propagator &p)
Subscribe propagator p.
int size(void) const
Return number of elements.
ScaleBool * fst(void) const
Return pointer to first element.
ScaleBoolArray(void)
Default constructor.
bool empty(void) const
Test whether array is empty.
void update(Space &home, ScaleBoolArray &sba)
Update sba during copying.
Coefficient and Boolean view.
int a
Integer coefficient.
Class for describing linear term .
int p
Original position in array (for sorting into canonical order)
Base-class for propagators.
bool disabled(void) const
Whether propagator is currently disabled.
ModEventDelta med
A set of modification events (used during propagation)
Propagator(Home home)
Constructor for posting.
Reification specification.
#define GECODE_INT_EXPORT
void post(Home home, Term< IntView > *t, int n, IntRelType irt, int c, IntPropLevel=IPL_DEF)
Post propagator for linear constraint over integers.
int ModEventDelta
Modification event deltas.
IntRelType
Relation types for integers.
IntPropLevel
Propagation levels for integer propagators.
@ IPL_DEF
Simple propagation levels.
void estimate(Term< View > *t, int n, int c, int &l, int &u)
Estimate lower and upper bounds.
void bounds_n(ModEventDelta med, ViewArray< View > &y, Val &c, Val &sl, Val &su)
void bounds_p(ModEventDelta med, ViewArray< View > &x, Val &c, Val &sl, Val &su)
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value)
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
Post propagator for SetVar SetOpType SetVar y
Post propagator for SetVar x