Go to the documentation of this file.
38 #ifndef __GECODE_INT_LINEAR_HH__
39 #define __GECODE_INT_LINEAR_HH__
48 namespace Gecode {
namespace Int {
namespace Linear {
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>
329 namespace 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>
480 namespace 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>
553 Val&
c, Val& sl, Val& su);
560 template<
class Val,
class View>
562 Val&
c, Val& sl, Val& su);
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> {
775 namespace 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>
1016 namespace 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>
1127 namespace 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);
1329 namespace Gecode {
namespace Int {
namespace Linear {
1335 template<
class View>
1360 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 .
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)
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)
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
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.
EqBin(Space &home, EqBin &p)
Constructor for cloning p.
ReEqBin(Space &home, ReEqBin &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Create copy during cloning.
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)
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)
Copy propagator 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.
virtual Actor * copy(Space &home)
Create copy during cloning.
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)
virtual Actor * copy(Space &home)
Create copy during cloning.
LqBin(Space &home, LqBin &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 Actor * copy(Space &home)
Create copy during cloning.
Base-class for ternary linear propagators.
virtual Actor * copy(Space &home)
Create copy during cloning.
Propagator for inequality to Boolean sum with coefficients
Base-class for n-ary linear propagators.
void cancel(Space &home, Propagator &p)
Cancel propagator p.
NqTer(Space &home, NqTer &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int c
Integer constant on right-hand side.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Create copy during cloning.
IntPropLevel
Propagation levels for integer propagators.
virtual Actor * copy(Space &home)
Create copy during cloning.
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.
Base-class for binary linear propagators.
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.
ReLinBoolInt(Space &home, ReLinBoolInt &p)
Constructor for cloning p.
SBAN n
Negative Boolean views with coefficients on left-hand side.
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.
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.
GqBin(Space &home, GqBin &p)
Constructor for cloning p.
LqTer(Space &home, LqTer &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.
virtual Actor * copy(Space &home)
Create copy during cloning.
Propagator for bounds consistent ternary linear disquality
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
LinTer(Space &home, LinTer &p)
Constructor for cloning p.
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.
union Gecode::@602::NNF::@65 u
Union depending on nodetype t.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Base-class for reified binary linear propagators.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high unary)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
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.
LinBoolInt(Space &home, LinBoolInt &p)
Constructor for cloning p.
Generic domain change information to be supplied to advisors.
virtual Actor * copy(Space &home)
Create copy during cloning.
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
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual Actor * copy(Space &home)
Create copy during cloning.
Home class for posting propagators
Propagator for equality to Boolean sum with coefficients
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)
DomEq(Space &home, DomEq &p)
Constructor for cloning p.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary)
virtual Actor * copy(Space &home)
Create copy during cloning.
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)
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
Post propagator for SetVar SetOpType SetVar SetRelType r
virtual Actor * copy(Space &home)
Create copy during cloning.
void subscribe(Space &home, Propagator &p)
Subscribe propagator p.
void reschedule(Space &home, Propagator &p)
Schedule propagator p.
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
virtual Actor * copy(Space &home)
Create copy during cloning.
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.
virtual Actor * copy(Space &home)
Create copy during cloning.
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.
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
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.
Lq(Space &home, Lq &p)
Constructor for cloning p.
Propagator for bounds consistent binary linear disequality
ScaleBoolArray(void)
Default constructor.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ReLq(Space &home, ReLq &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.
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
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 .
NqBin(Space &home, NqBin &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, BoolView b)
Post propagator for .
virtual Actor * copy(Space &home)
Create copy during cloning.
static ExecStatus post(Home home, A x0, B x1, Val c, BoolView b)
Post propagator for .
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
virtual Actor * copy(Space &home)
Create copy during cloning.
Propagator for bounds consistent ternary linear equality
LinBin(Space &home, LinBin &p)
Constructor for cloning p.
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.
EqBoolView(Space &home, EqBoolView &p)
Constructor for cloning p.
int size(void) const
Return number of elements.
void bounds_p(ModEventDelta med, ViewArray< View > &x, Val &c, Val &sl, Val &su)
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
GqBoolView(Space &home, GqBoolView &p)
Constructor for cloning p.
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.
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.
GqBoolInt(Space &home, GqBoolInt &p)
Constructor for cloning p.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
virtual Actor * copy(Space &home)
Create copy during cloning.
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.
Eq(Space &home, Eq &p)
Constructor for cloning p.
@ IPL_DEF
Simple propagation levels.
ReLin(Space &home, ReLin &p)
Constructor for cloning p.
Propagator for disequality to Boolean sum with coefficients
ScaleBool * lst(void) const
Return pointer after last element.
EqBoolInt(Space &home, EqBoolInt &p)
Constructor for cloning p.
int size(void) const
Return number of elements.
virtual Actor * copy(Space &home)
Create copy during cloning.
int n_hs
Number of views that have or had subscriptions.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
Lin(Space &home, Lin< Val, P, N, pc > &p)
Constructor for cloning p.
bool empty(void) const
Test whether array is empty.
Base-class for reified n-ary linear propagators.
virtual Actor * copy(Space &home)
Create copy during cloning.
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.
ReEqBoolInt(Space &home, ReEqBoolInt &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 .
virtual Actor * copy(Space &home)
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 ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Create copy during cloning.
Empty array of scale Boolean views.
NqBoolView(Space &home, NqBoolView &p)
Constructor for cloning p.
void update(Space &home, EmptyScaleBoolArray &esba)
Update sba during copying.
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)
void reschedule(Space &home, Propagator &p)
Schedule propagator p.
Propagator for bounds consistent binary linear equality
LinBoolView(Space &home, LinBoolView &p)
Constructor for cloning p.
Council< Advisor > co
Council for single advisor.
void post(Home home, Term< BoolView > *t, int n, IntRelType irt, IntView x, int c, IntPropLevel)
Post propagator for linear constraint over Booleans.
Nq(Space &home, Nq &p)
Constructor for cloning p.
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.
ReLqBin(Space &home, ReLqBin &p)
Constructor for cloning p.
int n
Number of negative literals for node type.
ScaleBool * fst(void) const
Return pointer to first element.
Coefficient and Boolean view.
ReEq(Space &home, ReEq &p)
Constructor for cloning p.
int p
Original position in array (for sorting into canonical order)
ReLinBin(Space &home, ReLinBin &p)
Constructor for cloning p.
int ModEventDelta
Modification event deltas.
Council< Advisor > co
Council for managing single advisor.
EqTer(Space &home, EqTer &p)
Constructor for cloning p.
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.
void update(Space &home, ScaleBoolArray &sba)
Update sba during copying.
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 Actor * copy(Space &home)
Create copy during cloning.
virtual void reschedule(Space &home)
Schedule function.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ReGqBoolInt(Space &home, ReGqBoolInt &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.