Go to the documentation of this file.
42 #ifndef __GECODE_INT_LINEAR_HH__
43 #define __GECODE_INT_LINEAR_HH__
52 namespace Gecode {
namespace Int {
namespace Linear {
68 template<
class Val,
class A,
class B, PropCond pc>
101 template<
class Val,
class A,
class B, PropCond pc,
class Ctrl>
137 template<
class Val,
class A,
class B>
171 template<
class Val,
class A,
class B,
class Ctrl, ReifyMode rm>
204 template<
class Val,
class A,
class B>
240 template<
class Val,
class A,
class B>
274 template<
class Val,
class A,
class B>
308 template<
class Val,
class A,
class B, ReifyMode rm>
333 namespace Gecode {
namespace Int {
namespace Linear {
349 template<
class Val,
class A,
class B,
class C, PropCond pc>
387 template<
class Val,
class A,
class B,
class C>
422 template<
class Val,
class A,
class B,
class C>
457 template<
class Val,
class A,
class B,
class C>
484 namespace Gecode {
namespace Int {
namespace Linear {
500 template<
class Val,
class P,
class N, PropCond pc>
532 template<
class Val,
class P,
class N, PropCond pc,
class Ctrl>
555 template<
class Val,
class View>
557 Val&
c, Val& sl, Val& su);
564 template<
class Val,
class View>
566 Val&
c, Val& sl, Val& su);
580 template<
class Val,
class P,
class N>
581 class Eq :
public Lin<Val,P,N,PC_INT_BND> {
611 template<
class Val,
class View>
613 :
public Lin<Val,View,View,PC_INT_DOM> {
652 template<
class Val,
class P,
class N,
class Ctrl, ReifyMode rm>
686 template<
class Val,
class P,
class N>
687 class Nq :
public Lin<Val,P,N,PC_INT_VAL> {
719 template<
class Val,
class P,
class N>
720 class Lq :
public Lin<Val,P,N,PC_INT_BND> {
752 template<
class Val,
class P,
class N, ReifyMode rm>
753 class ReLq :
public ReLin<Val,P,N,PC_INT_BND,BoolView> {
779 namespace Gecode {
namespace Int {
namespace Linear {
919 template<
class VX,
class VB>
958 template<
class VX,
class VB, ReifyMode rm>
990 template<
class VX,
class VB, ReifyMode rm>
1020 namespace Gecode {
namespace Int {
namespace Linear {
1026 template<
class XV,
class YV>
1055 template<
class XV,
class YV>
1081 template<
class XV,
class YV>
1107 template<
class XV,
class YV>
1131 namespace Gecode {
namespace Int {
namespace Linear {
1171 bool empty(
void)
const;
1173 int size(
void)
const;
1211 bool empty(
void)
const;
1213 int size(
void)
const;
1223 template<
class SBAP,
class SBAN,
class VX, PropCond pcx>
1239 SBAP&
p, SBAN&
n, VX
x,
int c);
1254 template<
class SBAP,
class SBAN,
class VX>
1266 SBAP&
p, SBAN&
n, VX
x,
int c);
1281 template<
class SBAP,
class SBAN,
class VX>
1293 SBAP&
p, SBAN&
n, VX
x,
int c);
1308 template<
class SBAP,
class SBAN,
class VX>
1320 SBAP&
p, SBAN&
n, VX
x,
int c);
1333 namespace Gecode {
namespace Int {
namespace Linear {
1339 template<
class View>
1362 template<
class View>
static ExecStatus post(Home home, A x0, B x1, Val c, Ctrl b)
Post propagator for .
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
ReLin(Space &home, bool share, ReLin &p)
Constructor for cloning p.
Propagator for bounds consistent binary linear less or equal
Post propagator for SetVar x
int a
Integer coefficient.
IntRelType
Relation types for integers.
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.
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Propagator for reified integer equal to Boolean sum (cardinality)
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Baseclass for integer Boolean sum.
Post propagator for SetVar SetOpType SetVar y
Propagator for integer disequal to Boolean sum (cardinality)
Propagator for reified integer less or equal to Boolean sum (cardinality)
ReGqBoolInt(Space &home, bool share, ReGqBoolInt &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
ScaleBool * fst(void) const
Return pointer to first element.
Class for describing linear term .
NqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
LqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
Lq(Space &home, bool share, Lq &p)
Constructor for cloning p.
virtual void reschedule(Space &home)
Schedule function.
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ScaleBool * lst(void) const
Return pointer after last element.
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
bool empty(void) const
Test whether array is empty.
ReLinBoolInt(Space &home, bool share, ReLinBoolInt &p)
Constructor for cloning p.
void cancel(Space &home, Propagator &p)
Cancel propagator p.
Propagator for bounds consistent n-ary linear less or equal
void bounds_n(ModEventDelta med, ViewArray< View > &y, Val &c, Val &sl, Val &su)
ReEqBoolInt(Space &home, bool share, ReEqBoolInt &p)
Constructor for cloning p.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual void reschedule(Space &home)
Schedule function.
Base-class for ternary linear propagators.
Propagator for inequality to Boolean sum with coefficients
Base-class for n-ary linear propagators.
void cancel(Space &home, Propagator &p)
Cancel propagator p.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int c
Integer constant on right-hand side.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
GqBoolInt(Space &home, bool share, GqBoolInt &p)
Constructor for cloning p.
IntPropLevel
Propagation levels for integer propagators.
NqBin(Space &home, bool share, NqBin &p)
Constructor for cloning p.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
Base-class for both propagators and branchers.
LinBoolInt(Space &home, bool share, LinBoolInt &p)
Constructor for cloning p.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
LqBin(Space &home, bool share, LqBin &p)
Constructor for cloning p.
Base-class for binary linear propagators.
EqBoolView(Space &home, bool share, EqBoolView &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual void reschedule(Space &home)
Schedule function.
void sort(void)
Sort array in decreasing order of coefficients.
SBAN n
Negative Boolean views with coefficients on left-hand side.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
void sort(void)
Sort array in decreasing order of coefficients.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
ViewArray< N > y
Array of negative views.
union Gecode::@579::NNF::@61 u
Union depending on nodetype t.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
EqBoolInt(Space &home, bool share, EqBoolInt &p)
Constructor for cloning p.
Propagator for integer less or equal to Boolean sum (cardinality)
Propagator for integer equal to Boolean sum (cardinality)
virtual void reschedule(Space &home)
Schedule function.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
ReLq(Space &home, bool share, ReLq &p)
Constructor for cloning p.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
static ExecStatus post(Home home, ViewArray< View > &x, ViewArray< View > &y, Val c)
Post propagator for .
ViewArray< VX > x
Boolean views.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
static ExecStatus post(Home home, ViewArray< VX > &x, int c, VB b)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
static ExecStatus post(Home home, ViewArray< VX > &b, int c)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Propagator for bounds consistent ternary linear disquality
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
EmptyScaleBoolArray(void)
Default constructor.
Boolean view for Boolean variables.
Gecode toplevel namespace
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Propagator for bounds consistent n-ary linear equality
Base-class for propagators.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
NqBoolView(Space &home, bool share, NqBoolView &p)
Constructor for cloning p.
Base-class for reified binary linear propagators.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high unary)
ReEq(Space &home, bool share, ReEq &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Ctrl b
Control view for reification.
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
Traits for Boolean negation view.
Generic domain change information to be supplied to advisors.
Propagator for equality to Boolean sum (cardinality)
Reification specification.
#define GECODE_INT_EXPORT
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Propagator for bounds consistent n-ary linear disequality
Home class for posting propagators
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
ReLqBin(Space &home, bool share, ReLqBin &p)
Constructor for cloning p.
ReEqBin(Space &home, bool share, ReEqBin &p)
Constructor for cloning p.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
ReLinBin(Space &home, bool share, ReLinBin &p)
Constructor for cloning p.
Propagator for equality to Boolean sum with coefficients
EqTer(Space &home, bool share, EqTer &p)
Constructor for cloning p.
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
Propagator for greater or equal to Boolean sum (cardinality)
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary)
int c
Righthandside (constant part from Boolean views assigned to 1)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
void update(Space &home, bool share, EmptyScaleBoolArray &esba)
Update sba during copying.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Post propagator for SetVar SetOpType SetVar SetRelType r
LinBoolView(Space &home, bool share, LinBoolView &p)
Constructor for cloning p.
void subscribe(Space &home, Propagator &p)
Subscribe propagator p.
Nq(Space &home, bool share, Nq &p)
Constructor for cloning p.
void reschedule(Space &home, Propagator &p)
Schedule propagator p.
Lin(Space &home, bool share, Lin< Val, P, N, pc > &p)
Constructor for cloning p.
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
ModEventDelta med
A set of modification events (used during propagation)
YV y
View to compare number of assigned Boolean views to.
Array of scale Boolean views.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Propagator for reified bounds consistent n-ary linear less or equal
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c, Ctrl b)
Post propagator for .
ViewArray< P > x
Array of positive views.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Baseclass for reified integer Boolean sum.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual void reschedule(Space &home)
Schedule function.
Base class for linear Boolean constraints with coefficients.
Propagator for bounds consistent binary linear disequality
LqTer(Space &home, bool share, LqTer &p)
Constructor for cloning p.
ScaleBoolArray(void)
Default constructor.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
EqBin(Space &home, bool share, EqBin &p)
Constructor for cloning p.
Base-class for Boolean linear propagators.
LinBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
Eq(Space &home, bool share, Eq &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
NqBoolInt(Home home, ViewArray< VX > &b, int c)
Constructor for posting.
virtual void reschedule(Space &home)
Schedule function.
Propagator for reified bounds consistent binary linear equality
Propagator for domain consistent n-ary linear equality
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
VX x
Integer view on right-hand side.
int n_s
Number of subscriptions.
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c, BoolView b)
Post propagator for .
static ExecStatus post(Home home, A x0, B x1, Val c, BoolView b)
Post propagator for .
Propagator for bounds consistent ternary linear equality
virtual void reschedule(Space &home)
Schedule function.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low unary)
void normalize(void)
Normalize by removing unused views.
int size(void) const
Return number of elements.
void bounds_p(ModEventDelta med, ViewArray< View > &x, Val &c, Val &sl, Val &su)
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Propagator for bounds consistent binary linear greater or equal
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
void normalize(void)
Normalize by removing unused views.
int n_as
Number of active subscriptions.
void update(Space &home, bool share, ScaleBoolArray &sba)
Update sba during copying.
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 size_t dispose(Space &home)
Delete propagator and return its size.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary)
EqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
@ IPL_DEF
Simple propagation levels.
Propagator for disequality to Boolean sum with coefficients
ScaleBool * lst(void) const
Return pointer after last element.
int size(void) const
Return number of elements.
int n_hs
Number of views that have or had subscriptions.
NqTer(Space &home, bool share, NqTer &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
bool empty(void) const
Test whether array is empty.
Base-class for reified n-ary linear propagators.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Integer view for integer variables.
LinBin(Space &home, bool share, LinBin &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Propagator for reified bounds consistent n-ary linear equality
ViewArray< XV > x
Boolean views.
bool resubscribe(Space &home, VX &y)
Update subscription.
Ctrl b
Control view for reification.
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
GqBin(Space &home, bool share, GqBin &p)
Constructor for cloning p.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
void estimate(Term< View > *t, int n, int c, int &l, int &u)
Estimate lower and upper bounds.
Propagator for bounds consistent ternary linear less or equal
Propagator for reified bounds consistent binary linear less or equal
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Empty array of scale Boolean views.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high unary)
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
void reschedule(Space &home, Propagator &p)
Schedule propagator p.
Propagator for bounds consistent binary linear equality
Council< Advisor > co
Council for single advisor.
LinTer(Space &home, bool share, LinTer &p)
Constructor for cloning p.
void post(Home home, Term< BoolView > *t, int n, IntRelType irt, IntView x, int c, IntPropLevel)
Post propagator for linear constraint over Booleans.
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
virtual void reschedule(Space &home)
Schedule function.
Gecode::FloatVal c(-8, 8)
virtual void reschedule(Space &home)
Schedule function.
void subscribe(Space &home, Propagator &p)
Subscribe propagator p.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
int n
Number of negative literals for node type.
ScaleBool * fst(void) const
Return pointer to first element.
Coefficient and Boolean view.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
DomEq(Space &home, bool share, DomEq &p)
Constructor for cloning p.
int ModEventDelta
Modification event deltas.
Council< Advisor > co
Council for managing single advisor.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low ternary)
int p
Number of positive literals for node type.
static ExecStatus post(Home home, ViewArray< VX > &x, int c, VB b)
Post propagator for .
ViewArray< VX > x
Views not yet subscribed to.
virtual void reschedule(Space &home)
Schedule function.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Propagator for disequality to Boolean sum (cardinality)
virtual void reschedule(Space &home)
Schedule function.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
GqBoolView(Space &home, bool share, GqBoolView &p)
Constructor for cloning p.
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
SBAP p
Positive Boolean views with coefficients on left-hand side.