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>
99 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>
329 namespace Gecode {
namespace Int {
namespace Linear {
345 template<
class Val,
class A,
class B,
class C, PropCond pc>
381 template<
class Val,
class A,
class B,
class C>
416 template<
class Val,
class A,
class B,
class C>
451 template<
class Val,
class A,
class B,
class C>
478 namespace Gecode {
namespace Int {
namespace Linear {
494 template<
class Val,
class P,
class N, PropCond pc>
524 template<
class Val,
class P,
class N, PropCond pc,
class Ctrl>
543 template<
class Val,
class View>
545 Val&
c, Val& sl, Val& su);
552 template<
class Val,
class View>
554 Val&
c, Val& sl, Val& su);
568 template<
class Val,
class P,
class N>
569 class Eq :
public Lin<Val,P,N,PC_INT_BND> {
599 template<
class Val,
class View>
601 :
public Lin<Val,View,View,PC_INT_DOM> {
640 template<
class Val,
class P,
class N,
class Ctrl, ReifyMode rm>
674 template<
class Val,
class P,
class N>
675 class Nq :
public Lin<Val,P,N,PC_INT_VAL> {
707 template<
class Val,
class P,
class N>
708 class Lq :
public Lin<Val,P,N,PC_INT_BND> {
740 template<
class Val,
class P,
class N, ReifyMode rm>
741 class ReLq :
public ReLin<Val,P,N,PC_INT_BND,BoolView> {
767 namespace Gecode {
namespace Int {
namespace Linear {
901 template<
class VX,
class VB>
940 template<
class VX,
class VB, ReifyMode rm>
970 template<
class VX,
class VB, ReifyMode rm>
998 namespace Gecode {
namespace Int {
namespace Linear {
1004 template<
class XV,
class YV>
1031 template<
class XV,
class YV>
1057 template<
class XV,
class YV>
1083 template<
class XV,
class YV>
1107 namespace Gecode {
namespace Int {
namespace Linear {
1145 bool empty(
void)
const;
1147 int size(
void)
const;
1183 bool empty(
void)
const;
1185 int size(
void)
const;
1195 template<
class SBAP,
class SBAN,
class VX, PropCond pcx>
1211 SBAP& p, SBAN& n, VX x,
int c);
1224 template<
class SBAP,
class SBAN,
class VX>
1236 SBAP& p, SBAN& n, VX x,
int c);
1251 template<
class SBAP,
class SBAN,
class VX>
1263 SBAP& p, SBAN& n, VX x,
int c);
1278 template<
class SBAP,
class SBAN,
class VX>
1290 SBAP& p, SBAN& n, VX x,
int c);
1303 namespace Gecode {
namespace Int {
namespace Linear {
1309 template<
class View>
1332 template<
class View>
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Propagator for bounds consistent binary linear disequality
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
ViewArray< VX > x
Boolean views.
ReEq(Space &home, bool share, ReEq &p)
Constructor for cloning p.
void sort(void)
Sort array in decreasing order of coefficients.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
ViewArray< XV > x
Boolean views.
Propagator for inequality to Boolean sum with coefficients
Propagator for bounds consistent n-ary linear equality
Lq(Space &home, bool share, Lq &p)
Constructor for cloning p.
IntConLevel
Consistency levels for integer propagators.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary)
bool empty(void) const
Test whether array is empty.
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.
Empty array of scale Boolean views.
ViewArray< N > y
Array of negative views.
Propagator for reified bounds consistent n-ary linear less or equal
GqBoolInt(Space &home, bool share, GqBoolInt &p)
Constructor for cloning p.
Propagator for bounds consistent binary linear greater or equal
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
int n_s
Number of subscriptions.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
NqBoolInt(Home home, ViewArray< VX > &b, int c)
Constructor for posting.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Base-class for Boolean linear propagators.
void post(Home home, Term< BoolView > *t, int n, IntRelType irt, IntView x, int c, IntConLevel)
Post propagator for linear constraint over Booleans.
void subscribe(Space &home, Propagator &p)
Subscribe propagator p.
Propagator for bounds consistent n-ary linear disequality
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high unary)
Propagator for domain consistent n-ary linear equality
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Baseclass for integer Boolean sum.
static ExecStatus post(Home home, ViewArray< VX > &x, int c, VB b)
Post propagator for .
static ExecStatus post(Home home, ViewArray< VX > &x, int c, VB b)
Post propagator for .
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
Propagator for integer disequal to Boolean sum (cardinality)
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.
Propagator for bounds consistent ternary linear equality
LqBin(Space &home, bool share, LqBin &p)
Constructor for cloning p.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
GqBin(Space &home, bool share, GqBin &p)
Constructor for cloning p.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Base-class for reified n-ary linear propagators.
EqBoolView(Space &home, bool share, EqBoolView &p)
Constructor for cloning p.
Base-class for propagators.
YV y
View to compare number of assigned Boolean views to.
void sort(void)
Sort array in decreasing order of coefficients.
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
Base-class for ternary linear propagators.
ReGqBoolInt(Space &home, bool share, ReGqBoolInt &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int size(void) const
Return number of elements.
void cancel(Space &home, Propagator &p)
Cancel propagator p.
ReEqBoolInt(Space &home, bool share, ReEqBoolInt &p)
Constructor for cloning p.
GqBoolView(Space &home, bool share, GqBoolView &p)
Constructor for cloning p.
ScaleBool * lst(void) const
Return pointer after last element.
Base-class for n-ary linear propagators.
ReLinBoolInt(Space &home, bool share, ReLinBoolInt &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
Propagator for bounds consistent binary linear equality
EqTer(Space &home, bool share, EqTer &p)
Constructor for cloning p.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
LinTer(Space &home, bool share, LinTer &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Base-class for binary linear propagators.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Propagator for equality to Boolean sum (cardinality)
Base-class for both propagators and branchers.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int c
Integer constant on right-hand side.
Propagator for equality to Boolean sum with coefficients
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
ViewArray< P > x
Array of positive views.
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Council< Advisor > co
Council for single advisor.
Propagator for bounds consistent ternary linear less or equal
Gecode::FloatVal c(-8, 8)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Propagator for greater or equal to Boolean sum (cardinality)
int p
Number of positive literals for node type.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c, BoolView b)
Post propagator for .
int n
Number of negative literals for node type.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
int n_as
Number of active subscriptions.
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)
LqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
int c
Righthandside (constant part from Boolean views assigned to 1)
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
void bounds_n(ModEventDelta med, ViewArray< View > &y, Val &c, Val &sl, Val &su)
EqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
EqBoolInt(Space &home, bool share, EqBoolInt &p)
Constructor for cloning p.
IntRelType
Relation types for integers.
Propagator for integer less or equal to Boolean sum (cardinality)
Propagator for integer equal to Boolean sum (cardinality)
ScaleBool * fst(void) const
Return pointer to first element.
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.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
ScaleBool * fst(void) const
Return pointer to first element.
NqBoolView(Space &home, bool share, NqBoolView &p)
Constructor for cloning p.
ModEventDelta med
A set of modification events (used during propagation)
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
Propagator for bounds consistent binary linear less or equal
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Reification specification.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
ScaleBoolArray(void)
Default constructor.
ReLinBin(Space &home, bool share, ReLinBin &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
NqTer(Space &home, bool share, NqTer &p)
Constructor for cloning p.
bool resubscribe(Space &home, VX &y)
Update subscription.
Propagator for reified bounds consistent n-ary linear equality
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, A x0, B x1, Val c, Ctrl b)
Post propagator for .
void subscribe(Space &home, Propagator &p)
Subscribe propagator p.
Nq(Space &home, bool share, Nq &p)
Constructor for cloning p.
void normalize(void)
Normalize by removing unused views.
DomEq(Space &home, bool share, DomEq &p)
Constructor for cloning p.
void bounds_p(ModEventDelta med, ViewArray< View > &x, Val &c, Val &sl, Val &su)
Propagator for reified integer less or equal to Boolean sum (cardinality)
void normalize(void)
Normalize by removing unused views.
Propagator for reified integer equal to Boolean sum (cardinality)
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Propagator for disequality to Boolean sum with coefficients
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.
SBAN n
Negative Boolean views with coefficients on left-hand side.
Baseclass for reified integer Boolean sum.
Propagator for reified bounds consistent binary linear less or equal
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
EmptyScaleBoolArray(void)
Default constructor.
Base class for linear Boolean constraints with coefficients.
void update(Space &home, bool share, ScaleBoolArray &sba)
Update sba during copying.
static ExecStatus post(Home home, ViewArray< View > &x, ViewArray< View > &y, Val c)
Post propagator for .
Lin(Space &home, bool share, Lin< Val, P, N, pc > &p)
Constructor for cloning p.
union Gecode::@518::NNF::@57 u
Union depending on nodetype t.
Eq(Space &home, bool share, Eq &p)
Constructor for cloning p.
Integer view for integer variables.
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 .
Array of scale Boolean views.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c, Ctrl b)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Node * x
Pointer to corresponding Boolean expression node.
SBAP p
Positive Boolean views with coefficients on left-hand side.
Generic domain change information to be supplied to advisors.
Traits for Boolean negation view.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ScaleBool * lst(void) const
Return pointer after last element.
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.
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.
Base-class for reified binary linear propagators.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
ReLq(Space &home, bool share, ReLq &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.
Ctrl b
Control view for reification.
The default consistency for a constraint.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Propagator for reified bounds consistent binary linear equality
LinBoolInt(Space &home, bool share, LinBoolInt &p)
Constructor for cloning p.
bool empty(void) const
Test whether array is empty.
Coefficient and Boolean view.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
NqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
void cancel(Space &home, Propagator &p)
Cancel propagator p.
Council< Advisor > co
Council for managing single advisor.
int n_hs
Number of views that have or had subscriptions.
Ctrl b
Control view for reification.
Class for describing linear term .
ViewArray< VX > x
Views not yet subscribed to.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
LinBoolView(Space &home, bool share, LinBoolView &p)
Constructor for cloning p.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
int size(void) const
Return number of elements.
ReLin(Space &home, bool share, ReLin &p)
Constructor for cloning p.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
LinBin(Space &home, bool share, LinBin &p)
Constructor for cloning p.
Gecode toplevel namespace
Propagator for bounds consistent n-ary linear less or equal
void update(Space &home, bool share, EmptyScaleBoolArray &esba)
Update sba during copying.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
NqBin(Space &home, bool share, NqBin &p)
Constructor for cloning p.
Propagator for disequality to Boolean sum (cardinality)
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 .
int a
Integer coefficient.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high unary)
#define GECODE_INT_EXPORT
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.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
Propagator for bounds consistent ternary linear disquality
int ModEventDelta
Modification event deltas.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
ReLqBin(Space &home, bool share, ReLqBin &p)
Constructor for cloning p.
Home class for posting propagators
ReEqBin(Space &home, bool share, ReEqBin &p)
Constructor for cloning p.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
VX x
Integer view on right-hand side.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
LqTer(Space &home, bool share, LqTer &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.
EqBin(Space &home, bool share, EqBin &p)
Constructor for cloning p.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Boolean view for Boolean variables.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low ternary)