linear.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
* Guido Tack <tack@gecode.org>
* Tias Guns <tias.guns@cs.kuleuven.be>
*
* Copyright:
* Christian Schulte, 2002
* Guido Tack, 2004
* Tias Guns, 2009
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __GECODE_INT_LINEAR_HH__
#define __GECODE_INT_LINEAR_HH__
#include <gecode/int.hh>
namespace Gecode { namespace Int { namespace Linear {
/*
* Binary propagators
*
*/
template<class Val, class A, class B, PropCond pc>
class LinBin : public Propagator {
protected:
A x0;
B x1;
Val c;
LinBin(Space& home, LinBin& p);
LinBin(Space& home, Propagator& p, A x0, B x1, Val c);
LinBin(Home home, A x0, B x1, Val c);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
};
template<class Val, class A, class B, PropCond pc, class Ctrl>
class ReLinBin : public Propagator {
protected:
A x0;
B x1;
Val c;
Ctrl b;
ReLinBin(Space& home, ReLinBin& p);
ReLinBin(Home home, A x0, B x1, Val c, Ctrl b);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
};
template<class Val, class A, class B>
class EqBin : public LinBin<Val,A,B,PC_INT_BND> {
protected:
using LinBin<Val,A,B,PC_INT_BND>::x0;
using LinBin<Val,A,B,PC_INT_BND>::x1;
using LinBin<Val,A,B,PC_INT_BND>::c;
EqBin(Space& home, EqBin& p);
EqBin(Home home, A x0, B x1, Val c);
public:
EqBin(Space& home, Propagator& p, A x0, B x1, Val c);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, A x0, B x1, Val c);
};
template<class Val, class A, class B, class Ctrl, ReifyMode rm>
class ReEqBin : public ReLinBin<Val,A,B,PC_INT_BND,Ctrl> {
protected:
using ReLinBin<Val,A,B,PC_INT_BND,Ctrl>::x0;
using ReLinBin<Val,A,B,PC_INT_BND,Ctrl>::x1;
using ReLinBin<Val,A,B,PC_INT_BND,Ctrl>::c;
using ReLinBin<Val,A,B,PC_INT_BND,Ctrl>::b;
ReEqBin(Space& home, ReEqBin& p);
ReEqBin(Home home,A,B,Val,Ctrl);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, A x0, B x1, Val c, Ctrl b);
};
template<class Val, class A, class B>
class NqBin : public LinBin<Val,A,B,PC_INT_VAL> {
protected:
using LinBin<Val,A,B,PC_INT_VAL>::x0;
using LinBin<Val,A,B,PC_INT_VAL>::x1;
using LinBin<Val,A,B,PC_INT_VAL>::c;
NqBin(Space& home, NqBin& p);
NqBin(Home home, A x0, B x1, Val c);
public:
NqBin(Space& home, Propagator& p, A x0, B x1, Val c);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
static ExecStatus post(Home home, A x0, B x1, Val c);
};
template<class Val, class A, class B>
class LqBin : public LinBin<Val,A,B,PC_INT_BND> {
protected:
using LinBin<Val,A,B,PC_INT_BND>::x0;
using LinBin<Val,A,B,PC_INT_BND>::x1;
using LinBin<Val,A,B,PC_INT_BND>::c;
LqBin(Space& home, LqBin& p);
LqBin(Home home, A x0, B x1, Val c);
public:
LqBin(Space& home, Propagator& p, A x0, B x1, Val c);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, A x0, B x1, Val c);
};
template<class Val, class A, class B>
class GqBin : public LinBin<Val,A,B,PC_INT_BND> {
protected:
using LinBin<Val,A,B,PC_INT_BND>::x0;
using LinBin<Val,A,B,PC_INT_BND>::x1;
using LinBin<Val,A,B,PC_INT_BND>::c;
GqBin(Space& home, GqBin& p);
GqBin(Home home, A x0, B x1, Val c);
public:
GqBin(Space& home, Propagator& p, A x0, B x1, Val c);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, A x0, B x1, Val c);
};
template<class Val, class A, class B, ReifyMode rm>
class ReLqBin : public ReLinBin<Val,A,B,PC_INT_BND,BoolView> {
protected:
using ReLinBin<Val,A,B,PC_INT_BND,BoolView>::x0;
using ReLinBin<Val,A,B,PC_INT_BND,BoolView>::x1;
using ReLinBin<Val,A,B,PC_INT_BND,BoolView>::c;
using ReLinBin<Val,A,B,PC_INT_BND,BoolView>::b;
ReLqBin(Space& home, ReLqBin& p);
ReLqBin(Home home, A x0, B x1, Val c, BoolView b);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, A x0, B x1, Val c, BoolView b);
};
}}}
#include <gecode/int/linear/int-bin.hpp>
namespace Gecode { namespace Int { namespace Linear {
/*
* Ternary propagators
*
*/
template<class Val, class A, class B, class C, PropCond pc>
class LinTer : public Propagator {
protected:
A x0;
B x1;
C x2;
Val c;
LinTer(Space& home, LinTer& p);
LinTer(Home home, A x0, B x1, C x2, Val c);
LinTer(Space& home, Propagator& p, A x0, B x1, C x2, Val c);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
};
template<class Val, class A, class B, class C>
class EqTer : public LinTer<Val,A,B,C,PC_INT_BND> {
protected:
using LinTer<Val,A,B,C,PC_INT_BND>::x0;
using LinTer<Val,A,B,C,PC_INT_BND>::x1;
using LinTer<Val,A,B,C,PC_INT_BND>::x2;
using LinTer<Val,A,B,C,PC_INT_BND>::c;
EqTer(Space& home, EqTer& p);
EqTer(Home home, A x0, B x1, C x2, Val c);
public:
EqTer(Space& home, Propagator& p, A x0, B x1, C x2, Val c);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, A x0, B x1, C x2, Val c);
};
template<class Val, class A, class B, class C>
class NqTer : public LinTer<Val,A,B,C,PC_INT_VAL> {
protected:
using LinTer<Val,A,B,C,PC_INT_VAL>::x0;
using LinTer<Val,A,B,C,PC_INT_VAL>::x1;
using LinTer<Val,A,B,C,PC_INT_VAL>::x2;
using LinTer<Val,A,B,C,PC_INT_VAL>::c;
NqTer(Space& home, NqTer& p);
NqTer(Home home, A x0, B x1, C x2, Val c);
public:
NqTer(Space& home, Propagator& p, A x0, B x1, C x2, Val c);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, A x0, B x1, C x2, Val c);
};
template<class Val, class A, class B, class C>
class LqTer : public LinTer<Val,A,B,C,PC_INT_BND> {
protected:
using LinTer<Val,A,B,C,PC_INT_BND>::x0;
using LinTer<Val,A,B,C,PC_INT_BND>::x1;
using LinTer<Val,A,B,C,PC_INT_BND>::x2;
using LinTer<Val,A,B,C,PC_INT_BND>::c;
LqTer(Space& home, LqTer& p);
LqTer(Home home, A x0, B x1, C x2, Val c);
public:
LqTer(Space& home, Propagator& p, A x0, B x1, C x2, Val c);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, A x0, B x1, C x2, Val c);
};
}}}
#include <gecode/int/linear/int-ter.hpp>
namespace Gecode { namespace Int { namespace Linear {
/*
* n-ary propagators
*
*/
template<class Val, class P, class N, PropCond pc>
class Lin : public Propagator {
protected:
ViewArray<P> x;
ViewArray<N> y;
Val c;
Lin(Space& home, Lin<Val,P,N,pc>& p);
Lin(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
};
template<class Val, class P, class N, PropCond pc, class Ctrl>
class ReLin : public Lin<Val,P,N,pc> {
protected:
using Lin<Val,P,N,pc>::x;
using Lin<Val,P,N,pc>::y;
Ctrl b;
ReLin(Space& home, ReLin& p);
ReLin(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c, Ctrl b);
public:
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
};
template<class Val, class View>
void bounds_p(ModEventDelta med, ViewArray<View>& x,
Val& c, Val& sl, Val& su);
template<class Val, class View>
void bounds_n(ModEventDelta med, ViewArray<View>& y,
Val& c, Val& sl, Val& su);
template<class Val, class P, class N>
class Eq : public Lin<Val,P,N,PC_INT_BND> {
protected:
using Lin<Val,P,N,PC_INT_BND>::x;
using Lin<Val,P,N,PC_INT_BND>::y;
using Lin<Val,P,N,PC_INT_BND>::c;
Eq(Space& home, Eq& p);
public:
Eq(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus
post(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
};
template<class Val, class View>
class DomEq
: public Lin<Val,View,View,PC_INT_DOM> {
protected:
using Lin<Val,View,View,PC_INT_DOM>::x;
using Lin<Val,View,View,PC_INT_DOM>::y;
using Lin<Val,View,View,PC_INT_DOM>::c;
DomEq(Space& home, DomEq& p);
public:
DomEq(Home home, ViewArray<View>& x, ViewArray<View>& y, Val c);
virtual Actor* copy(Space& home);
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus
post(Home home, ViewArray<View>& x, ViewArray<View>& y, Val c);
};
template<class Val, class P, class N, class Ctrl, ReifyMode rm>
class ReEq : public ReLin<Val,P,N,PC_INT_BND,Ctrl> {
protected:
using ReLin<Val,P,N,PC_INT_BND,Ctrl>::x;
using ReLin<Val,P,N,PC_INT_BND,Ctrl>::y;
using ReLin<Val,P,N,PC_INT_BND,Ctrl>::c;
using ReLin<Val,P,N,PC_INT_BND,Ctrl>::b;
ReEq(Space& home, ReEq& p);
public:
ReEq(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c, Ctrl b);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus
post(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c, Ctrl b);
};
template<class Val, class P, class N>
class Nq : public Lin<Val,P,N,PC_INT_VAL> {
protected:
using Lin<Val,P,N,PC_INT_VAL>::x;
using Lin<Val,P,N,PC_INT_VAL>::y;
using Lin<Val,P,N,PC_INT_VAL>::c;
Nq(Space& home, Nq& p);
public:
Nq(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus
post(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
};
template<class Val, class P, class N>
class Lq : public Lin<Val,P,N,PC_INT_BND> {
protected:
using Lin<Val,P,N,PC_INT_BND>::x;
using Lin<Val,P,N,PC_INT_BND>::y;
using Lin<Val,P,N,PC_INT_BND>::c;
Lq(Space& home, Lq& p);
public:
Lq(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus
post(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c);
};
template<class Val, class P, class N, ReifyMode rm>
class ReLq : public ReLin<Val,P,N,PC_INT_BND,BoolView> {
protected:
using ReLin<Val,P,N,PC_INT_BND,BoolView>::x;
using ReLin<Val,P,N,PC_INT_BND,BoolView>::y;
using ReLin<Val,P,N,PC_INT_BND,BoolView>::c;
using ReLin<Val,P,N,PC_INT_BND,BoolView>::b;
ReLq(Space& home, ReLq& p);
public:
ReLq(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c, BoolView b);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus
post(Home home, ViewArray<P>& x, ViewArray<N>& y, Val c, BoolView b);
};
}}}
#include <gecode/int/linear/int-nary.hpp>
#include <gecode/int/linear/int-dom.hpp>
namespace Gecode { namespace Int { namespace Linear {
/*
* Boolean linear propagators
*
*/
template<class VX>
class LinBoolInt : public Propagator {
protected:
Council<Advisor> co;
ViewArray<VX> x;
int n_as;
int n_hs;
int c;
void normalize(void);
LinBoolInt(Space& home, LinBoolInt& p);
LinBoolInt(Home home, ViewArray<VX>& x, int n_s, int c);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual size_t dispose(Space& home);
};
template<class VX>
class EqBoolInt : public LinBoolInt<VX> {
protected:
using LinBoolInt<VX>::co;
using LinBoolInt<VX>::x;
using LinBoolInt<VX>::n_as;
using LinBoolInt<VX>::n_hs;
using LinBoolInt<VX>::c;
using LinBoolInt<VX>::disabled;
EqBoolInt(Space& home, EqBoolInt& p);
EqBoolInt(Home home, ViewArray<VX>& x, int c);
public:
virtual Actor* copy(Space& home);
virtual void reschedule(Space& home);
virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, ViewArray<VX>& x, int c);
};
template<class VX>
class GqBoolInt : public LinBoolInt<VX> {
protected:
using LinBoolInt<VX>::co;
using LinBoolInt<VX>::x;
using LinBoolInt<VX>::n_as;
using LinBoolInt<VX>::n_hs;
using LinBoolInt<VX>::c;
using LinBoolInt<VX>::disabled;
GqBoolInt(Space& home, GqBoolInt& p);
GqBoolInt(Home home, ViewArray<VX>& x, int c);
public:
virtual Actor* copy(Space& home);
virtual void reschedule(Space& home);
virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, ViewArray<VX>& x, int c);
};
template<class VX>
class NqBoolInt : public BinaryPropagator<VX,PC_INT_VAL> {
protected:
using BinaryPropagator<VX,PC_INT_VAL>::x0;
using BinaryPropagator<VX,PC_INT_VAL>::x1;
ViewArray<VX> x;
int c;
bool resubscribe(Space& home, VX& y);
NqBoolInt(Home home, ViewArray<VX>& b, int c);
NqBoolInt(Space& home, NqBoolInt<VX>& p);
public:
virtual Actor* copy(Space& home);
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, ViewArray<VX>& b, int c);
virtual size_t dispose(Space& home);
};
template<class VX, class VB>
class ReLinBoolInt : public Propagator {
protected:
Council<Advisor> co;
ViewArray<VX> x;
int n_s;
int c;
VB b;
void normalize(void);
ReLinBoolInt(Space& home, ReLinBoolInt& p);
ReLinBoolInt(Home home, ViewArray<VX>& x, int c, VB b);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual size_t dispose(Space& home);
};
template<class BV>
class BoolNegTraits {};
template<class VX, class VB, ReifyMode rm>
class ReGqBoolInt : public ReLinBoolInt<VX,VB> {
protected:
using ReLinBoolInt<VX,VB>::co;
using ReLinBoolInt<VX,VB>::x;
using ReLinBoolInt<VX,VB>::c;
using ReLinBoolInt<VX,VB>::b;
using ReLinBoolInt<VX,VB>::n_s;
using ReLinBoolInt<VX,VB>::normalize;
ReGqBoolInt(Space& home, ReGqBoolInt& p);
ReGqBoolInt(Home home, ViewArray<VX>& x, int c, VB b);
public:
virtual Actor* copy(Space& home);
virtual void reschedule(Space& home);
virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, ViewArray<VX>& x, int c, VB b);
};
template<class VX, class VB, ReifyMode rm>
class ReEqBoolInt : public ReLinBoolInt<VX,VB> {
protected:
using ReLinBoolInt<VX,VB>::co;
using ReLinBoolInt<VX,VB>::x;
using ReLinBoolInt<VX,VB>::c;
using ReLinBoolInt<VX,VB>::b;
using ReLinBoolInt<VX,VB>::n_s;
using ReLinBoolInt<VX,VB>::normalize;
ReEqBoolInt(Space& home, ReEqBoolInt& p);
ReEqBoolInt(Home home, ViewArray<VX>& x, int c, VB b);
public:
virtual Actor* copy(Space& home);
virtual void reschedule(Space& home);
virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, ViewArray<VX>& x, int c, VB b);
};
}}}
#include <gecode/int/linear/bool-int.hpp>
namespace Gecode { namespace Int { namespace Linear {
template<class XV, class YV>
class LinBoolView : public Propagator {
protected:
ViewArray<XV> x;
YV y;
int c;
LinBoolView(Space& home, LinBoolView& p);
LinBoolView(Home home, ViewArray<XV>& x, YV y, int c);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
};
template<class XV, class YV>
class EqBoolView : public LinBoolView<XV,YV> {
protected:
using LinBoolView<XV,YV>::x;
using LinBoolView<XV,YV>::y;
using LinBoolView<XV,YV>::c;
EqBoolView(Space& home, EqBoolView& p);
EqBoolView(Home home, ViewArray<XV>& x, YV y, int c);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, ViewArray<XV>& x, YV y, int c);
};
template<class XV, class YV>
class NqBoolView : public LinBoolView<XV,YV> {
protected:
using LinBoolView<XV,YV>::x;
using LinBoolView<XV,YV>::y;
using LinBoolView<XV,YV>::c;
NqBoolView(Space& home, NqBoolView& p);
NqBoolView(Home home, ViewArray<XV>& x, YV y, int c);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, ViewArray<XV>& x, YV y, int c);
};
template<class XV, class YV>
class GqBoolView : public LinBoolView<XV,YV> {
protected:
using LinBoolView<XV,YV>::x;
using LinBoolView<XV,YV>::y;
using LinBoolView<XV,YV>::c;
GqBoolView(Space& home, GqBoolView& p);
GqBoolView(Home home, ViewArray<XV>& x, YV y, int c);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, ViewArray<XV>& x, YV y, int c);
};
}}}
#include <gecode/int/linear/bool-view.hpp>
namespace Gecode { namespace Int { namespace Linear {
class ScaleBool {
public:
int a;
BoolView x;
};
class ScaleBoolArray {
private:
ScaleBool* _fst;
ScaleBool* _lst;
public:
ScaleBoolArray(void);
ScaleBoolArray(Space& home, int n);
void subscribe(Space& home, Propagator& p);
void cancel(Space& home, Propagator& p);
void reschedule(Space& home, Propagator& p);
void update(Space& home, ScaleBoolArray& sba);
ScaleBool* fst(void) const;
ScaleBool* lst(void) const;
void fst(ScaleBool* f);
void lst(ScaleBool* l);
bool empty(void) const;
int size(void) const;
private:
class ScaleDec {
public:
bool
operator ()(const ScaleBool& x, const ScaleBool& y);
};
public:
void sort(void);
};
class EmptyScaleBoolArray {
public:
EmptyScaleBoolArray(void);
EmptyScaleBoolArray(Space& home, int n);
void subscribe(Space& home, Propagator& p);
void cancel(Space& home, Propagator& p);
void reschedule(Space& home, Propagator& p);
void update(Space& home, EmptyScaleBoolArray& esba);
ScaleBool* fst(void) const;
ScaleBool* lst(void) const;
void fst(ScaleBool* f);
void lst(ScaleBool* l);
bool empty(void) const;
int size(void) const;
void sort(void);
};
template<class SBAP, class SBAN, class VX, PropCond pcx>
class LinBoolScale : public Propagator {
protected:
SBAP p;
SBAN n;
VX x;
int c;
public:
LinBoolScale(Home home, SBAP& p, SBAN& n, VX x, int c);
LinBoolScale(Space& home, Propagator& pr,
SBAP& p, SBAN& n, VX x, int c);
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
};
template<class SBAP, class SBAN, class VX>
class EqBoolScale : public LinBoolScale<SBAP,SBAN,VX,PC_INT_BND> {
protected:
using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::p;
using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::n;
using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::x;
using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::c;
public:
EqBoolScale(Home home, SBAP& p, SBAN& n, VX x, int c);
EqBoolScale(Space& home, Propagator& pr,
SBAP& p, SBAN& n, VX x, int c);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, SBAP& p, SBAN& n, VX x, int c);
};
template<class SBAP, class SBAN, class VX>
class LqBoolScale : public LinBoolScale<SBAP,SBAN,VX,PC_INT_BND> {
protected:
using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::p;
using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::n;
using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::x;
using LinBoolScale<SBAP,SBAN,VX,PC_INT_BND>::c;
public:
LqBoolScale(Home home, SBAP& p, SBAN& n, VX x, int c);
LqBoolScale(Space& home, Propagator& pr,
SBAP& p, SBAN& n, VX x, int c);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, SBAP& p, SBAN& n, VX x, int c);
};
template<class SBAP, class SBAN, class VX>
class NqBoolScale : public LinBoolScale<SBAP,SBAN,VX,PC_INT_VAL> {
protected:
using LinBoolScale<SBAP,SBAN,VX,PC_INT_VAL>::p;
using LinBoolScale<SBAP,SBAN,VX,PC_INT_VAL>::n;
using LinBoolScale<SBAP,SBAN,VX,PC_INT_VAL>::x;
using LinBoolScale<SBAP,SBAN,VX,PC_INT_VAL>::c;
public:
NqBoolScale(Home home, SBAP& p, SBAN& n, VX x, int c);
NqBoolScale(Space& home, Propagator& pr,
SBAP& p, SBAN& n, VX x, int c);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, SBAP& p, SBAN& n, VX x, int c);
};
}}}
#include <gecode/int/linear/bool-scale.hpp>
namespace Gecode { namespace Int { namespace Linear {
template<class View>
class Term {
public:
int a;
View x;
int p;
};
template<class View>
void estimate(Term<View>* t, int n, int c,
int& l, int& u);
GECODE_INT_EXPORT void
post(Home home, Term<IntView>* t, int n, IntRelType irt, int c,
IntPropLevel=IPL_DEF);
GECODE_INT_EXPORT void
post(Home home, Term<IntView>* t, int n, IntRelType irt, int c, Reify r,
IntPropLevel=IPL_DEF);
GECODE_INT_EXPORT void
post(Home home, Term<BoolView>* t, int n, IntRelType irt, int c,
IntPropLevel=IPL_DEF);
GECODE_INT_EXPORT void
post(Home home, Term<BoolView>* t, int n, IntRelType irt, int c, Reify r,
IntPropLevel=IPL_DEF);
GECODE_INT_EXPORT void
post(Home home, Term<BoolView>* t, int n, IntRelType irt, IntView y, int c=0,
IntPropLevel=IPL_DEF);
GECODE_INT_EXPORT void
post(Home home, Term<BoolView>* t, int n, IntRelType irt, IntView y,
Reify r, IntPropLevel=IPL_DEF);
}}}
#include <gecode/int/linear/post.hpp>
#endif
// STATISTICS: int-prop
bool-int.hpp
bool-scale.hpp
bool-view.hpp
Gecode::ActorLink::Actor
friend class Actor
Definition core.hpp:590
Gecode::BinaryPropagator< VX, PC_INT_VAL >::x0
VX x0
Definition pattern.hpp:87
Gecode::BinaryPropagator< VX, PC_INT_VAL >::BinaryPropagator
BinaryPropagator(Space &home, BinaryPropagator &p)
Gecode::BinaryPropagator< VX, PC_INT_VAL >::x1
VX x1
Definition pattern.hpp:87
Gecode::Delta
Generic domain change information to be supplied to advisors.
Definition core.hpp:204
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::Int::BoolView
Boolean view for Boolean variables.
Definition view.hpp:1380
Gecode::Int::IntView
Integer view for integer variables.
Definition view.hpp:129
Gecode::Int::Linear::BoolNegTraits
Traits for Boolean negation view.
Definition linear.hh:946
Gecode::Int::Linear::DomEq::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition int-dom.hpp:382
Gecode::Int::Linear::DomEq::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-dom.hpp:376
Gecode::Int::Linear::DomEq::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-dom.hpp:391
Gecode::Int::Linear::DomEq::DomEq
DomEq(Space &home, DomEq &p)
Constructor for cloning p.
Gecode::Int::Linear::DomEq::post
static ExecStatus post(Home home, ViewArray< View > &x, ViewArray< View > &y, Val c)
Post propagator for .
Definition int-dom.hpp:362
Gecode::Int::Linear::EmptyScaleBoolArray::fst
ScaleBool * fst(void) const
Return pointer to first element.
Definition bool-scale.hpp:134
Gecode::Int::Linear::EmptyScaleBoolArray::sort
void sort(void)
Sort array in decreasing order of coefficients.
Definition bool-scale.hpp:146
Gecode::Int::Linear::EmptyScaleBoolArray::size
int size(void) const
Return number of elements.
Definition bool-scale.hpp:144
Gecode::Int::Linear::EmptyScaleBoolArray::reschedule
void reschedule(Space &home, Propagator &p)
Schedule propagator p.
Definition bool-scale.hpp:130
Gecode::Int::Linear::EmptyScaleBoolArray::update
void update(Space &home, EmptyScaleBoolArray &esba)
Update sba during copying.
Definition bool-scale.hpp:132
Gecode::Int::Linear::EmptyScaleBoolArray::cancel
void cancel(Space &home, Propagator &p)
Cancel propagator p.
Definition bool-scale.hpp:128
Gecode::Int::Linear::EmptyScaleBoolArray::EmptyScaleBoolArray
EmptyScaleBoolArray(void)
Default constructor.
Definition bool-scale.hpp:122
Gecode::Int::Linear::EmptyScaleBoolArray::empty
bool empty(void) const
Test whether array is empty.
Definition bool-scale.hpp:142
Gecode::Int::Linear::EmptyScaleBoolArray::subscribe
void subscribe(Space &home, Propagator &p)
Subscribe propagator p.
Definition bool-scale.hpp:126
Gecode::Int::Linear::EmptyScaleBoolArray::lst
ScaleBool * lst(void) const
Return pointer after last element.
Definition bool-scale.hpp:136
Gecode::Int::Linear::EqBin::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-bin.hpp:188
Gecode::Int::Linear::EqBin::EqBin
EqBin(Space &home, EqBin &p)
Constructor for cloning p.
Gecode::Int::Linear::EqBin::post
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
Definition int-bin.hpp:147
Gecode::Int::Linear::EqBin::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-bin.hpp:166
Gecode::Int::Linear::EqBoolInt::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-int.hpp:297
Gecode::Int::Linear::EqBoolInt::advise
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition bool-int.hpp:254
Gecode::Int::Linear::EqBoolInt::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition bool-int.hpp:289
Gecode::Int::Linear::EqBoolInt::post
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
Definition bool-int.hpp:321
Gecode::Int::Linear::EqBoolInt::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition bool-int.hpp:248
Gecode::Int::Linear::EqBoolInt::EqBoolInt
EqBoolInt(Space &home, EqBoolInt &p)
Constructor for cloning p.
Definition bool-int.hpp:243
Gecode::Int::Linear::EqBoolScale::post
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
Definition bool-scale.hpp:398
Gecode::Int::Linear::EqBoolScale::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition bool-scale.hpp:224
Gecode::Int::Linear::EqBoolScale::EqBoolScale
EqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
Definition bool-scale.hpp:209
Gecode::Int::Linear::EqBoolScale::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-scale.hpp:252
Gecode::Int::Linear::EqBoolView::EqBoolView
EqBoolView(Space &home, EqBoolView &p)
Constructor for cloning p.
Definition bool-view.hpp:124
Gecode::Int::Linear::EqBoolView::post
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
Definition bool-view.hpp:91
Gecode::Int::Linear::EqBoolView::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-view.hpp:135
Gecode::Int::Linear::EqBoolView::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition bool-view.hpp:129
Gecode::Int::Linear::EqTer::EqTer
EqTer(Space &home, EqTer &p)
Constructor for cloning p.
Gecode::Int::Linear::EqTer::post
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
Definition int-ter.hpp:104
Gecode::Int::Linear::EqTer::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-ter.hpp:147
Gecode::Int::Linear::EqTer::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-ter.hpp:123
Gecode::Int::Linear::Eq::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-nary.hpp:381
Gecode::Int::Linear::Eq::Eq
Eq(Space &home, Eq &p)
Constructor for cloning p.
Gecode::Int::Linear::Eq::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-nary.hpp:394
Gecode::Int::Linear::Eq::post
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
Definition int-nary.hpp:280
Gecode::Int::Linear::GqBin::post
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
Definition int-bin.hpp:378
Gecode::Int::Linear::GqBin::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-bin.hpp:391
Gecode::Int::Linear::GqBin::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-bin.hpp:403
Gecode::Int::Linear::GqBin::GqBin
GqBin(Space &home, GqBin &p)
Constructor for cloning p.
Gecode::Int::Linear::GqBoolInt::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition bool-int.hpp:172
Gecode::Int::Linear::GqBoolInt::GqBoolInt
GqBoolInt(Space &home, GqBoolInt &p)
Constructor for cloning p.
Definition bool-int.hpp:120
Gecode::Int::Linear::GqBoolInt::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition bool-int.hpp:125
Gecode::Int::Linear::GqBoolInt::advise
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition bool-int.hpp:131
Gecode::Int::Linear::GqBoolInt::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-int.hpp:180
Gecode::Int::Linear::GqBoolInt::post
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
Definition bool-int.hpp:198
Gecode::Int::Linear::GqBoolView::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-view.hpp:298
Gecode::Int::Linear::GqBoolView::GqBoolView
GqBoolView(Space &home, GqBoolView &p)
Constructor for cloning p.
Definition bool-view.hpp:287
Gecode::Int::Linear::GqBoolView::post
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
Definition bool-view.hpp:260
Gecode::Int::Linear::GqBoolView::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition bool-view.hpp:292
Gecode::Int::Linear::LinBin::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition int-bin.hpp:80
Gecode::Int::Linear::LinBin::c
Val c
Value of type Val.
Definition linear.hh:72
Gecode::Int::Linear::LinBin::x1
B x1
View of type B.
Definition linear.hh:70
Gecode::Int::Linear::LinBin::x0
A x0
View of type A.
Definition linear.hh:68
Gecode::Int::Linear::LinBin::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition int-bin.hpp:73
Gecode::Int::Linear::LinBin::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary).
Definition int-bin.hpp:67
Gecode::Int::Linear::LinBin::LinBin
LinBin(Space &home, LinBin &p)
Constructor for cloning p.
Gecode::Int::Linear::LinBoolInt::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high unary).
Definition bool-int.hpp:94
Gecode::Int::Linear::LinBoolInt::n_as
int n_as
Number of active subscriptions.
Definition linear.hh:794
Gecode::Int::Linear::LinBoolInt::normalize
void normalize(void)
Normalize by removing unused views.
Definition bool-int.hpp:58
Gecode::Int::Linear::LinBoolInt::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition bool-int.hpp:100
Gecode::Int::Linear::LinBoolInt::c
int c
Righthandside.
Definition linear.hh:798
Gecode::Int::Linear::LinBoolInt::co
Council< Advisor > co
Council for managing single advisor.
Definition linear.hh:790
Gecode::Int::Linear::LinBoolInt::n_hs
int n_hs
Number of views that have or had subscriptions.
Definition linear.hh:796
Gecode::Int::Linear::LinBoolInt::x
ViewArray< VX > x
Boolean views.
Definition linear.hh:792
Gecode::Int::Linear::LinBoolInt::LinBoolInt
LinBoolInt(Space &home, LinBoolInt &p)
Constructor for cloning p.
Definition bool-int.hpp:84
Gecode::Int::Linear::LinBoolScale::LinBoolScale
LinBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
Definition bool-scale.hpp:156
Gecode::Int::Linear::LinBoolScale::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition bool-scale.hpp:182
Gecode::Int::Linear::LinBoolScale::p
SBAP p
Positive Boolean views with coefficients on left-hand side.
Definition linear.hh:1223
Gecode::Int::Linear::LinBoolScale::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear).
Definition bool-scale.hpp:167
Gecode::Int::Linear::LinBoolScale::x
VX x
Integer view on right-hand side.
Definition linear.hh:1227
Gecode::Int::Linear::LinBoolScale::c
int c
Integer constant on right-hand side.
Definition linear.hh:1229
Gecode::Int::Linear::LinBoolScale::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition bool-scale.hpp:174
Gecode::Int::Linear::LinBoolScale::n
SBAN n
Negative Boolean views with coefficients on left-hand side.
Definition linear.hh:1225
Gecode::Int::Linear::LinBoolView::LinBoolView
LinBoolView(Space &home, LinBoolView &p)
Constructor for cloning p.
Definition bool-view.hpp:60
Gecode::Int::Linear::LinBoolView::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition bool-view.hpp:51
Gecode::Int::Linear::LinBoolView::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition bool-view.hpp:74
Gecode::Int::Linear::LinBoolView::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear).
Definition bool-view.hpp:68
Gecode::Int::Linear::LinBoolView::y
YV y
View to compare number of assigned Boolean views to.
Definition linear.hh:1028
Gecode::Int::Linear::LinBoolView::x
ViewArray< XV > x
Boolean views.
Definition linear.hh:1026
Gecode::Int::Linear::LinBoolView::c
int c
Righthandside (constant part from Boolean views assigned to 1).
Definition linear.hh:1030
Gecode::Int::Linear::LinTer::x2
C x2
View of type C.
Definition linear.hh:353
Gecode::Int::Linear::LinTer::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low ternary).
Definition int-ter.hpp:70
Gecode::Int::Linear::LinTer::LinTer
LinTer(Space &home, LinTer &p)
Constructor for cloning p.
Gecode::Int::Linear::LinTer::x0
A x0
View of type A.
Definition linear.hh:349
Gecode::Int::Linear::LinTer::c
Val c
Value of type Val.
Definition linear.hh:355
Gecode::Int::Linear::LinTer::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition int-ter.hpp:84
Gecode::Int::Linear::LinTer::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition int-ter.hpp:76
Gecode::Int::Linear::LinTer::x1
B x1
View of type B.
Definition linear.hh:351
Gecode::Int::Linear::Lin::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition int-nary.hpp:90
Gecode::Int::Linear::Lin::Lin
Lin(Space &home, Lin< Val, P, N, pc > &p)
Constructor for cloning p.
Definition int-nary.hpp:69
Gecode::Int::Linear::Lin::y
ViewArray< N > y
Array of negative views.
Definition linear.hh:502
Gecode::Int::Linear::Lin::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear).
Definition int-nary.hpp:77
Gecode::Int::Linear::Lin::x
ViewArray< P > x
Array of positive views.
Definition linear.hh:500
Gecode::Int::Linear::Lin::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition int-nary.hpp:83
Gecode::Int::Linear::Lin::c
Val c
Constant value.
Definition linear.hh:504
Gecode::Int::Linear::LqBin::post
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
Definition int-bin.hpp:332
Gecode::Int::Linear::LqBin::LqBin
LqBin(Space &home, LqBin &p)
Constructor for cloning p.
Gecode::Int::Linear::LqBin::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-bin.hpp:345
Gecode::Int::Linear::LqBin::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-bin.hpp:357
Gecode::Int::Linear::LqBoolScale::LqBoolScale
LqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
Definition bool-scale.hpp:424
Gecode::Int::Linear::LqBoolScale::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition bool-scale.hpp:439
Gecode::Int::Linear::LqBoolScale::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-scale.hpp:467
Gecode::Int::Linear::LqBoolScale::post
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
Definition bool-scale.hpp:553
Gecode::Int::Linear::LqTer::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-ter.hpp:252
Gecode::Int::Linear::LqTer::post
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
Definition int-ter.hpp:239
Gecode::Int::Linear::LqTer::LqTer
LqTer(Space &home, LqTer &p)
Constructor for cloning p.
Gecode::Int::Linear::LqTer::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-ter.hpp:265
Gecode::Int::Linear::Lq::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-nary.hpp:732
Gecode::Int::Linear::Lq::Lq
Lq(Space &home, Lq &p)
Constructor for cloning p.
Gecode::Int::Linear::Lq::post
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
Definition int-nary.hpp:631
Gecode::Int::Linear::Lq::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-nary.hpp:745
Gecode::Int::Linear::NqBin::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-bin.hpp:309
Gecode::Int::Linear::NqBin::NqBin
NqBin(Space &home, NqBin &p)
Constructor for cloning p.
Gecode::Int::Linear::NqBin::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low unary).
Definition int-bin.hpp:303
Gecode::Int::Linear::NqBin::post
static ExecStatus post(Home home, A x0, B x1, Val c)
Post propagator for .
Definition int-bin.hpp:276
Gecode::Int::Linear::NqBin::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-bin.hpp:289
Gecode::Int::Linear::NqBoolInt::post
static ExecStatus post(Home home, ViewArray< VX > &b, int c)
Post propagator for .
Definition bool-int.hpp:394
Gecode::Int::Linear::NqBoolInt::resubscribe
bool resubscribe(Space &home, VX &y)
Update subscription.
Definition bool-int.hpp:433
Gecode::Int::Linear::NqBoolInt::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear).
Definition bool-int.hpp:427
Gecode::Int::Linear::NqBoolInt::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition bool-int.hpp:368
Gecode::Int::Linear::NqBoolInt::c
int c
Righthandside.
Definition linear.hh:890
Gecode::Int::Linear::NqBoolInt::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-int.hpp:458
Gecode::Int::Linear::NqBoolInt::NqBoolInt
NqBoolInt(Home home, ViewArray< VX > &b, int c)
Constructor for posting.
Definition bool-int.hpp:358
Gecode::Int::Linear::NqBoolInt::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition bool-int.hpp:421
Gecode::Int::Linear::NqBoolInt::x
ViewArray< VX > x
Views not yet subscribed to.
Definition linear.hh:888
Gecode::Int::Linear::NqBoolScale::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition bool-scale.hpp:593
Gecode::Int::Linear::NqBoolScale::post
static ExecStatus post(Home home, SBAP &p, SBAN &n, VX x, int c)
Post propagator.
Definition bool-scale.hpp:686
Gecode::Int::Linear::NqBoolScale::NqBoolScale
NqBoolScale(Home home, SBAP &p, SBAN &n, VX x, int c)
Constructor for creation.
Definition bool-scale.hpp:578
Gecode::Int::Linear::NqBoolScale::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-scale.hpp:621
Gecode::Int::Linear::NqBoolView::NqBoolView
NqBoolView(Space &home, NqBoolView &p)
Constructor for cloning p.
Definition bool-view.hpp:210
Gecode::Int::Linear::NqBoolView::post
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
Definition bool-view.hpp:177
Gecode::Int::Linear::NqBoolView::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-view.hpp:221
Gecode::Int::Linear::NqBoolView::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition bool-view.hpp:215
Gecode::Int::Linear::NqTer::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-ter.hpp:196
Gecode::Int::Linear::NqTer::post
static ExecStatus post(Home home, A x0, B x1, C x2, Val c)
Post propagator for .
Definition int-ter.hpp:183
Gecode::Int::Linear::NqTer::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-ter.hpp:209
Gecode::Int::Linear::NqTer::NqTer
NqTer(Space &home, NqTer &p)
Constructor for cloning p.
Gecode::Int::Linear::Nq::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-nary.hpp:583
Gecode::Int::Linear::Nq::Nq
Nq(Space &home, Nq &p)
Constructor for cloning p.
Gecode::Int::Linear::Nq::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-nary.hpp:596
Gecode::Int::Linear::Nq::post
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c)
Post propagator for .
Definition int-nary.hpp:482
Gecode::Int::Linear::ReEqBin::post
static ExecStatus post(Home home, A x0, B x1, Val c, Ctrl b)
Post propagator for .
Definition int-bin.hpp:217
Gecode::Int::Linear::ReEqBin::ReEqBin
ReEqBin(Space &home, ReEqBin &p)
Constructor for cloning p.
Gecode::Int::Linear::ReEqBin::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-bin.hpp:237
Gecode::Int::Linear::ReEqBin::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-bin.hpp:231
Gecode::Int::Linear::ReEqBoolInt::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition bool-int.hpp:693
Gecode::Int::Linear::ReEqBoolInt::post
static ExecStatus post(Home home, ViewArray< VX > &x, int c, VB b)
Post propagator for .
Definition bool-int.hpp:744
Gecode::Int::Linear::ReEqBoolInt::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition bool-int.hpp:712
Gecode::Int::Linear::ReEqBoolInt::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-int.hpp:720
Gecode::Int::Linear::ReEqBoolInt::advise
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition bool-int.hpp:699
Gecode::Int::Linear::ReEqBoolInt::ReEqBoolInt
ReEqBoolInt(Space &home, ReEqBoolInt &p)
Constructor for cloning p.
Definition bool-int.hpp:688
Gecode::Int::Linear::ReEq::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-nary.hpp:438
Gecode::Int::Linear::ReEq::post
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c, Ctrl b)
Post propagator for .
Definition int-nary.hpp:411
Gecode::Int::Linear::ReEq::ReEq
ReEq(Space &home, ReEq &p)
Constructor for cloning p.
Gecode::Int::Linear::ReEq::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-nary.hpp:432
Gecode::Int::Linear::ReGqBoolInt::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition bool-int.hpp:602
Gecode::Int::Linear::ReGqBoolInt::post
static ExecStatus post(Home home, ViewArray< VX > &x, int c, VB b)
Post propagator for .
Definition bool-int.hpp:639
Gecode::Int::Linear::ReGqBoolInt::advise
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition bool-int.hpp:590
Gecode::Int::Linear::ReGqBoolInt::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition bool-int.hpp:584
Gecode::Int::Linear::ReGqBoolInt::ReGqBoolInt
ReGqBoolInt(Space &home, ReGqBoolInt &p)
Constructor for cloning p.
Definition bool-int.hpp:579
Gecode::Int::Linear::ReGqBoolInt::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition bool-int.hpp:610
Gecode::Int::Linear::ReLinBin::b
Ctrl b
Control view for reification.
Definition linear.hh:107
Gecode::Int::Linear::ReLinBin::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition int-bin.hpp:127
Gecode::Int::Linear::ReLinBin::x1
B x1
View of type B.
Definition linear.hh:103
Gecode::Int::Linear::ReLinBin::c
Val c
Value of type Val.
Definition linear.hh:105
Gecode::Int::Linear::ReLinBin::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary).
Definition int-bin.hpp:113
Gecode::Int::Linear::ReLinBin::ReLinBin
ReLinBin(Space &home, ReLinBin &p)
Constructor for cloning p.
Gecode::Int::Linear::ReLinBin::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition int-bin.hpp:119
Gecode::Int::Linear::ReLinBin::x0
A x0
View of type A.
Definition linear.hh:101
Gecode::Int::Linear::ReLinBoolInt::co
Council< Advisor > co
Council for single advisor.
Definition linear.hh:919
Gecode::Int::Linear::ReLinBoolInt::normalize
void normalize(void)
Normalize by removing unused views.
Definition bool-int.hpp:505
Gecode::Int::Linear::ReLinBoolInt::b
VB b
Control variable.
Definition linear.hh:927
Gecode::Int::Linear::ReLinBoolInt::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high unary).
Definition bool-int.hpp:539
Gecode::Int::Linear::ReLinBoolInt::c
int c
Righthandside.
Definition linear.hh:925
Gecode::Int::Linear::ReLinBoolInt::n_s
int n_s
Number of subscriptions.
Definition linear.hh:923
Gecode::Int::Linear::ReLinBoolInt::ReLinBoolInt
ReLinBoolInt(Space &home, ReLinBoolInt &p)
Constructor for cloning p.
Definition bool-int.hpp:518
Gecode::Int::Linear::ReLinBoolInt::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition bool-int.hpp:528
Gecode::Int::Linear::ReLinBoolInt::x
ViewArray< VX > x
Views.
Definition linear.hh:921
Gecode::Int::Linear::ReLin::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition int-nary.hpp:127
Gecode::Int::Linear::ReLin::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition int-nary.hpp:119
Gecode::Int::Linear::ReLin::ReLin
ReLin(Space &home, ReLin &p)
Constructor for cloning p.
Gecode::Int::Linear::ReLin::b
Ctrl b
Control view for reification.
Definition linear.hh:534
Gecode::Int::Linear::ReLqBin::post
static ExecStatus post(Home home, A x0, B x1, Val c, BoolView b)
Post propagator for .
Definition int-bin.hpp:424
Gecode::Int::Linear::ReLqBin::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-bin.hpp:443
Gecode::Int::Linear::ReLqBin::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-bin.hpp:437
Gecode::Int::Linear::ReLqBin::ReLqBin
ReLqBin(Space &home, ReLqBin &p)
Constructor for cloning p.
Gecode::Int::Linear::ReLq::post
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, Val c, BoolView b)
Post propagator for .
Definition int-nary.hpp:828
Gecode::Int::Linear::ReLq::ReLq
ReLq(Space &home, ReLq &p)
Constructor for cloning p.
Gecode::Int::Linear::ReLq::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition int-nary.hpp:849
Gecode::Int::Linear::ReLq::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition int-nary.hpp:855
Gecode::Int::Linear::ScaleBoolArray::cancel
void cancel(Space &home, Propagator &p)
Cancel propagator p.
Definition bool-scale.hpp:57
Gecode::Int::Linear::ScaleBoolArray::sort
void sort(void)
Sort array in decreasing order of coefficients.
Definition bool-scale.hpp:111
Gecode::Int::Linear::ScaleBoolArray::reschedule
void reschedule(Space &home, Propagator &p)
Schedule propagator p.
Definition bool-scale.hpp:62
Gecode::Int::Linear::ScaleBoolArray::lst
ScaleBool * lst(void) const
Return pointer after last element.
Definition bool-scale.hpp:85
Gecode::Int::Linear::ScaleBoolArray::subscribe
void subscribe(Space &home, Propagator &p)
Subscribe propagator p.
Definition bool-scale.hpp:52
Gecode::Int::Linear::ScaleBoolArray::size
int size(void) const
Return number of elements.
Definition bool-scale.hpp:101
Gecode::Int::Linear::ScaleBoolArray::fst
ScaleBool * fst(void) const
Return pointer to first element.
Definition bool-scale.hpp:81
Gecode::Int::Linear::ScaleBoolArray::ScaleBoolArray
ScaleBoolArray(void)
Default constructor.
Definition bool-scale.hpp:41
Gecode::Int::Linear::ScaleBoolArray::empty
bool empty(void) const
Test whether array is empty.
Definition bool-scale.hpp:97
Gecode::Int::Linear::ScaleBoolArray::update
void update(Space &home, ScaleBoolArray &sba)
Update sba during copying.
Definition bool-scale.hpp:67
Gecode::Int::Linear::ScaleBool
Coefficient and Boolean view.
Definition linear.hh:1130
Gecode::Int::Linear::ScaleBool::a
int a
Integer coefficient.
Definition linear.hh:1133
Gecode::Int::Linear::ScaleBool::x
BoolView x
Boolean view.
Definition linear.hh:1135
Gecode::Int::Linear::Term
Class for describing linear term .
Definition linear.hh:1336
Gecode::Int::Linear::Term::x
View x
View.
Definition linear.hh:1341
Gecode::Int::Linear::Term::a
int a
Coefficient.
Definition linear.hh:1339
Gecode::Int::Linear::Term::p
int p
Original position in array (for sorting into canonical order).
Definition linear.hh:1343
Gecode::PropCost
Propagation cost.
Definition core.hpp:486
Gecode::Propagator
Base-class for propagators.
Definition core.hpp:1064
Gecode::Propagator::Space
friend class Space
Definition core.hpp:1066
Gecode::Propagator::Advisor
friend class Advisor
Definition core.hpp:1068
Gecode::Propagator::Council
friend class Council
Definition core.hpp:1069
Gecode::Propagator::disabled
bool disabled(void) const
Whether propagator is currently disabled.
Definition core.hpp:3476
Gecode::Propagator::med
ModEventDelta med
A set of modification events (used during propagation).
Definition core.hpp:1075
Gecode::Propagator::Propagator
Propagator(Home home)
Constructor for posting.
Definition core.hpp:3498
Gecode::Reify
Reification specification.
Definition int.hh:876
Gecode::Space
Computation spaces.
Definition core.hpp:1742
Gecode::Val
Gecode::View
Gecode::ViewArray
View arrays.
Definition array.hpp:253
int.hh
GECODE_INT_EXPORT
#define GECODE_INT_EXPORT
Definition int.hh:81
Gecode::Int::Linear::post
void post(Home home, Term< IntView > *t, int n, IntRelType irt, int c, IntPropLevel=IPL_DEF)
Post propagator for linear constraint over integers.
Definition int-post.cpp:219
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
Gecode::IntRelType
IntRelType
Relation types for integers.
Definition int.hh:925
Gecode::IntPropLevel
IntPropLevel
Propagation levels for integer propagators.
Definition int.hh:974
Gecode::IPL_DEF
@ IPL_DEF
Simple propagation levels.
Definition int.hh:976
int-bin.hpp
int-dom.hpp
int-nary.hpp
int-ter.hpp
post.hpp
Gecode::Int::Linear
Linear propagators
Gecode::Int::Linear::estimate
void estimate(Term< View > *t, int n, int c, int &l, int &u)
Estimate lower and upper bounds.
Definition post.hpp:41
Gecode::Int::Linear::bounds_n
void bounds_n(ModEventDelta med, ViewArray< View > &y, Val &c, Val &sl, Val &su)
Definition int-nary.hpp:161
Gecode::Int::Linear::bounds_p
void bounds_p(ModEventDelta med, ViewArray< View > &x, Val &c, Val &sl, Val &su)
Definition int-nary.hpp:140
Gecode::Int
Finite domain integers.
Gecode::Int::PC_INT_VAL
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value).
Definition var-type.hpp:82
Gecode::Int::PC_INT_BND
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
Definition var-type.hpp:91
Gecode::Int::PC_INT_DOM
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Definition var-type.hpp:100
Gecode
Gecode toplevel namespace
Gecode::ExecStatus
ExecStatus
Definition core.hpp:472