40 namespace Gecode {
namespace Int {
namespace Arithmetic {
42 template<
class VA,
class VB,
bool tiebreak>
50 template<
class VA,
class VB,
bool tiebreak>
56 }
else if (y.assigned()) {
58 while (x[max].idx < y.val())
60 assert(x[max].idx == y.val());
64 x[
i].view,x[max].view));
68 x[
i].view,x[max].view));
69 for (
int i=max+1;
i<x.
size();
i++)
71 x[
i].view,x[max].view));
78 template<
class VA,
class VB,
bool tiebreak>
84 y.update(home,share,p.
y);
87 template<
class VA,
class VB,
bool tiebreak>
93 template<
class VA,
class VB,
bool tiebreak>
100 template<
class VA,
class VB,
bool tiebreak>
110 int l =
x[0].view.min();
111 int u =
x[0].view.max();
112 for (
int i=1;
i<
x.size();
i++) {
113 if (l <
x[
i].view.min()) {
114 p =
x[
i].idx; l =
x[
i].view.min();
116 if (u <
x[
i].view.max())
125 int*
d=r.
alloc<
int>(y.size());
132 while ((i <
x.size()) && iy()) {
133 if (
x[i].idx == iy.
val()) {
134 if (
x[i].view.max() <
l) {
142 assert(
x[i].idx < iy.
val());
143 if (
x[i].view.max() <
l) {
152 if (
x[i].view.max() <
l) {
176 while (
x[max].idx < y.val())
178 assert(
x[max].idx == y.val());
182 x[
i].view,
x[max].view));
186 x[
i].view,
x[max].view));
187 for (
int i=max+1;
i<
x.size();
i++)
189 x[
i].view,
x[max].view));
198 while (
x[i].idx < y.min())
204 if (
x[i].idx == iy.
val()) {
208 assert(
x[i].idx < iy.
val());
219 while ((i <
x.size()) && (
x[i].idx < y.min())) {
224 while ((i <
x.size()) && (
x[i].idx < y.min())) {
228 assert(
x[i].idx == y.min());
234 while ((i <
x.size()) && iy()) {
235 if (
x[i].idx == iy.val()) {
238 assert(
x[i].idx < iy.val());
243 while (i <
x.size()) {
244 assert(
x[i].idx > y.max());
252 template<
class VA,
class VB,
bool tiebreak>
258 return sizeof(*this);
ArgMax(Space &home, bool share, ArgMax &p)
Constructor for cloning p.
static ExecStatus post(Home home, IdxViewArray< VA > &x, VB y)
Post propagator .
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
ExecStatus ES_SUBSUMED(Propagator &p)
const FloatNum max
Largest allowed float value.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
Value iterator for array of integers
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Base-class for propagators.
VB y
Position of maximum view (maximal argument)
Value iterator for integer views.
Propagation has computed fixpoint.
Base-class for both propagators and branchers.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Execution has resulted in failure.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
Less or equal propagator.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Argument maximum propagator.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
union Gecode::@518::NNF::@57 u
Union depending on nodetype t.
TieBreak< VarBranch > tiebreak(VarBranch a, VarBranch b)
Combine variable selection criteria a and b for tie-breaking.
Node * x
Pointer to corresponding Boolean expression node.
virtual size_t dispose(Space &home)
Delete actor and return its size.
void subscribe(Space &home, Propagator &p, PropCond pc, bool process=true)
IdxViewArray< VA > x
Map of index and views.
Propagation has not computed fixpoint.
int val(void) const
Return current value.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Gecode toplevel namespace
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
int size(void) const
Return the current size.
void update(Space &home, bool share, IdxViewArray< View > &x)
Cloning.