36namespace Gecode {
namespace Int {
namespace Arithmetic {
38 template<
class VA,
class VB,
bool tiebreak>
46 template<
class VA,
class VB,
bool tiebreak>
54 while (
x[
max].idx <
y.val())
56 assert(
x[
max].idx ==
y.val());
58 for (
int i=0; i<
max; i++)
60 x[i].view,
x[
max].view)));
62 for (
int i=0; i<
max; i++)
64 x[i].view,
x[
max].view)));
65 for (
int i=
max+1; i<
x.size(); i++)
67 x[i].view,
x[
max].view)));
74 template<
class VA,
class VB,
bool tiebreak>
82 template<
class VA,
class VB,
bool tiebreak>
88 template<
class VA,
class VB,
bool tiebreak>
94 template<
class VA,
class VB,
bool tiebreak>
101 template<
class VA,
class VB,
bool tiebreak>
111 int l =
x[0].view.min();
112 int u =
x[0].view.max();
113 for (
int i=1; i<
x.size(); i++) {
114 if (
l <
x[i].view.min()) {
115 p =
x[i].idx;
l =
x[i].view.min();
117 if (
u <
x[i].view.max())
126 int* d=
r.alloc<
int>(
y.size());
133 while ((i <
x.size()) && iy()) {
134 if (
x[i].idx == iy.
val()) {
135 if (
x[i].view.max() <
l) {
143 assert(
x[i].idx < iy.
val());
144 if (
x[i].view.max() <
l) {
153 if (
x[i].view.max() <
l) {
160 if (
static_cast<unsigned int>(
n) ==
y.size())
177 while (
x[
max].idx <
y.val())
179 assert(
x[
max].idx ==
y.val());
181 for (
int i=0; i<
max; i++)
183 x[i].view,
x[
max].view)));
185 for (
int i=0; i<
max; i++)
187 x[i].view,
x[
max].view)));
188 for (
int i=
max+1; i<
x.size(); i++)
190 x[i].view,
x[
max].view)));
199 while (
x[i].idx <
y.min())
205 if (
x[i].idx == iy.
val()) {
206 u = std::max(
u,
x[i].view.max());
209 assert(
x[i].idx < iy.
val());
220 while ((i <
x.size()) && (
x[i].idx <
y.min())) {
225 while ((i <
x.size()) && (
x[i].idx <
y.min())) {
229 assert(
x[i].idx ==
y.min());
235 while ((i <
x.size()) && iy()) {
236 if (
x[i].idx == iy.
val()) {
239 assert(
x[i].idx < iy.
val());
244 while (i <
x.size()) {
245 assert(
x[i].idx >
y.max());
253 template<
class VA,
class VB,
bool tiebreak>
259 return sizeof(*this);
union Gecode::@603::NNF::@65 u
Union depending on nodetype t.
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
Base-class for both propagators and branchers.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Home class for posting propagators
Argument maximum propagator.
IdxViewArray< VA > x
Map of index and views.
VB y
Position of maximum view (maximal argument)
ArgMax(Space &home, ArgMax &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
static ExecStatus post(Home home, IdxViewArray< VA > &x, VB y)
Post propagator .
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual void reschedule(Space &home)
Schedule function.
An array of IdxView pairs.
void subscribe(Space &home, Propagator &p, PropCond pc, bool process=true)
void update(Space &home, IdxViewArray< View > &x)
Cloning.
Less or equal propagator.
Value iterator for integer views.
int val(void) const
Return current value.
Value iterator for array of integers
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Base-class for propagators.
bool assigned(void) const
Test whether view is assigned.
ExecStatus ES_SUBSUMED(Propagator &p)
int ModEventDelta
Modification event deltas.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
TieBreak< VarBranch > tiebreak(VarBranch a, VarBranch b)
Combine variable selection criteria a and b for tie-breaking.
Post propagator for SetVar SetOpType SetVar y
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
@ ES_FAILED
Execution has resulted in failure.
@ ES_NOFIX
Propagation has not computed fixpoint.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Post propagator for SetVar x