nroot.hpp
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Christian Schulte, 2012
*
* 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.
*
*/
#include <gecode/int/rel.hh>
#include <climits>
#include <algorithm>
namespace Gecode { namespace Int { namespace Arithmetic {
/*
* Positive bounds consistent nth root
*
*/
template<class Ops, bool minus>
forceinline ExecStatus
prop_nroot_plus_bnd(Space& home, IntView x0, IntView x1, const Ops& ops) {
if (minus) {
bool mod;
do {
mod = false;
{
ModEvent me = x1.gq(home,-ops.cnroot(-x0.min()));
if (me_failed(me)) return ES_FAILED;
mod |= me_modified(me);
}
{
ModEvent me = x1.lq(home,-ops.cnroot(-x0.max()));
if (me_failed(me)) return ES_FAILED;
mod |= me_modified(me);
}
{
ModEvent me = x0.gq(home,-ops.tpow(-x1.min()));
if (me_failed(me)) return ES_FAILED;
mod |= me_modified(me);
}
{
ModEvent me = x0.lq(home,-(ops.tpow(-x1.max()-1)+1));
if (me_failed(me)) return ES_FAILED;
mod |= me_modified(me);
}
} while (mod);
} else {
bool mod;
do {
mod = false;
{
ModEvent me = x1.lq(home,ops.fnroot(x0.max()));
if (me_failed(me)) return ES_FAILED;
mod |= me_modified(me);
}
{
ModEvent me = x1.gq(home,ops.fnroot(x0.min()));
if (me_failed(me)) return ES_FAILED;
mod |= me_modified(me);
}
{
ModEvent me = x0.le(home,ops.tpow(x1.max()+1));
if (me_failed(me)) return ES_FAILED;
mod |= me_modified(me);
}
{
ModEvent me = x0.gq(home,ops.tpow(x1.min()));
if (me_failed(me)) return ES_FAILED;
mod |= me_modified(me);
}
} while (mod);
}
return ES_OK;
}
template<class Ops, bool minus>
forceinline
NrootPlusBnd<Ops,minus>::NrootPlusBnd(Home home, IntView x0, IntView x1,
const Ops& o)
: BinaryPropagator<IntView,PC_INT_BND>(home,x0,x1),
ops(o) {}
template<class Ops, bool minus>
forceinline ExecStatus
NrootPlusBnd<Ops,minus>::post(Home home, IntView x0, IntView x1, Ops ops) {
if (minus) {
GECODE_ME_CHECK(x0.lq(home,0));
GECODE_ME_CHECK(x1.lq(home,0));
} else {
GECODE_ME_CHECK(x0.gq(home,0));
GECODE_ME_CHECK(x1.gq(home,0));
}
(void) new (home) NrootPlusBnd<Ops,minus>(home,x0,x1,ops);
return ES_OK;
}
template<class Ops, bool minus>
forceinline
NrootPlusBnd<Ops,minus>::NrootPlusBnd(Space& home,
NrootPlusBnd<Ops,minus>& p)
: BinaryPropagator<IntView,PC_INT_BND>(home,p),
ops(p.ops) {}
template<class Ops, bool minus>
Actor*
NrootPlusBnd<Ops,minus>::copy(Space& home) {
return new (home) NrootPlusBnd<Ops,minus>(home,*this);
}
template<class Ops, bool minus>
ExecStatus
NrootPlusBnd<Ops,minus>::propagate(Space& home, const ModEventDelta&) {
GECODE_ES_CHECK((prop_nroot_plus_bnd<Ops,minus>(home,x0,x1,ops)));
return x1.assigned() ? home.ES_SUBSUMED(*this) : ES_FIX;
}
/*
* Bounds consistent nth root
*
*/
template<class Ops>
forceinline ExecStatus
prop_nroot_bnd(Space& home, IntView x0, IntView x1, const Ops& ops) {
assert((x0.min() < 0) && (x0.max() > 0));
assert((x1.min() < 0) && (x1.max() > 0));
GECODE_ME_CHECK(x1.lq(home,ops.fnroot(x0.max())));
GECODE_ME_CHECK(x1.gq(home,-ops.cnroot(-x0.min())));
GECODE_ME_CHECK(x0.le(home,ops.tpow(x1.max()+1)));
GECODE_ME_CHECK(x0.gq(home,ops.tpow(x1.min()-1)+1));
return ES_OK;
}
template<class Ops>
forceinline
NrootBnd<Ops>::NrootBnd(Home home, IntView x0, IntView x1, const Ops& o)
: BinaryPropagator<IntView,PC_INT_BND>(home,x0,x1),
ops(o) {}
template<class Ops>
forceinline ExecStatus
NrootBnd<Ops>::post(Home home, IntView x0, IntView x1, Ops ops) {
if (static_cast<unsigned int>(ops.exp()) >= sizeof(int) * CHAR_BIT) {
// The integer limits allow only -2, -1, 0, 1 for x1
GECODE_ME_CHECK(x1.lq(home,1));
GECODE_ME_CHECK(x1.gq(home,-2));
// Just rewrite to values that can be handeled without overflow
ops.exp(ops.even() ? 30 : 31);
}
if (ops.exp() == 0) {
GECODE_ME_CHECK(x1.eq(home,1));
return ES_OK;
} else if (ops.exp() == 1) {
return Rel::EqBnd<IntView,IntView>::post(home,x0,x1);
}
if (x0 == x1) {
assert(ops.exp() > 1);
GECODE_ME_CHECK(x0.lq(home,1));
GECODE_ME_CHECK(x0.gq(home,ops.even() ? 0 : -2));
return ES_OK;
}
// Limits values such that no overflow can occur
GECODE_ME_CHECK(x1.lq(home,ops.fnroot(Limits::max)));
GECODE_ME_CHECK(x1.gq(home,-ops.cnroot(-Limits::min)));
if (ops.even()) {
GECODE_ME_CHECK(x0.gq(home,0));
GECODE_ME_CHECK(x1.gq(home,0));
}
if ((x0.min() >= 0) || (x1.min() >= 0))
return NrootPlusBnd<Ops,false>::post(home,x0,x1,ops);
if ((x0.max() <= 0) || (x1.max() <= 0))
return NrootPlusBnd<Ops,true>::post(home,x0,x1,ops);
assert((x0.min() < 0) && (x0.max() > 0));
assert((x1.min() < 0) && (x1.max() > 0));
GECODE_ES_CHECK(prop_nroot_bnd<Ops>(home,x0,x1,ops));
(void) new (home) NrootBnd(home,x0,x1,ops);
return ES_OK;
}
template<class Ops>
forceinline
NrootBnd<Ops>::NrootBnd(Space& home, NrootBnd<Ops>& p)
: BinaryPropagator<IntView,PC_INT_BND>(home,p),
ops(p.ops) {}
template<class Ops>
Actor*
NrootBnd<Ops>::copy(Space& home) {
return new (home) NrootBnd<Ops>(home,*this);
}
template<class Ops>
ExecStatus
NrootBnd<Ops>::propagate(Space& home, const ModEventDelta&) {
assert(!ops.even());
if ((x0.min() >= 0) || (x1.min() >= 0))
GECODE_REWRITE(*this,(NrootPlusBnd<Ops,false>::post(home(*this),x0,x1,ops)));
if ((x0.max() <= 0) || (x1.max() <= 0))
GECODE_REWRITE(*this,(NrootPlusBnd<Ops,true>::post(home(*this),x0,x1,ops)));
GECODE_ES_CHECK(prop_nroot_bnd(home,x0,x1,ops));
return x0.assigned() && x1.assigned() ? home.ES_SUBSUMED(*this) : ES_NOFIX;
}
/*
* Domain consistent nth root
*
*/
template<class Ops>
class RangesMapPow {
protected:
Ops ops;
public:
forceinline RangesMapPow(const Ops& o) : ops(o) {}
forceinline int min(int x) const {
return ops.tpow(x);
}
forceinline int max(int x) const {
return ops.tpow(x+1)-1;
}
};
template<class Ops>
class RangesMapNroot {
protected:
Ops ops;
public:
forceinline RangesMapNroot(const Ops& o) : ops(o) {}
forceinline int min(int x) const {
return (x < 0) ? -ops.cnroot(-x) : ops.fnroot(x);
}
forceinline int max(int x) const {
return (x < 0) ? -ops.cnroot(-x) : ops.fnroot(x);
}
};
template<class Ops, bool minus>
forceinline
NrootPlusDom<Ops,minus>::NrootPlusDom(Home home, IntView x0, IntView x1,
const Ops& o)
: BinaryPropagator<IntView,PC_INT_DOM>(home,x0,x1),
ops(o) {}
template<class Ops, bool minus>
forceinline ExecStatus
NrootPlusDom<Ops,minus>::post(Home home, IntView x0, IntView x1, Ops ops) {
if (minus) {
GECODE_ME_CHECK(x0.lq(home,0));
GECODE_ME_CHECK(x1.lq(home,0));
} else {
GECODE_ME_CHECK(x0.gq(home,0));
GECODE_ME_CHECK(x1.gq(home,0));
}
GECODE_ES_CHECK((prop_nroot_plus_bnd<Ops,minus>(home,x0,x1,ops)));
(void) new (home) NrootPlusDom<Ops,minus>(home,x0,x1,ops);
return ES_OK;
}
template<class Ops, bool minus>
forceinline
NrootPlusDom<Ops,minus>::NrootPlusDom(Space& home,
NrootPlusDom<Ops,minus>& p)
: BinaryPropagator<IntView,PC_INT_DOM>(home,p),
ops(p.ops) {}
template<class Ops, bool minus>
Actor*
NrootPlusDom<Ops,minus>::copy(Space& home) {
return new (home) NrootPlusDom<Ops,minus>(home,*this);
}
template<class Ops, bool minus>
PropCost
NrootPlusDom<Ops,minus>::cost(const Space&, const ModEventDelta& med) const {
if (IntView::me(med) == ME_INT_VAL)
return PropCost::unary(PropCost::LO);
else if (IntView::me(med) == ME_INT_DOM)
return PropCost::binary(PropCost::HI);
else
return PropCost::binary(PropCost::LO);
}
template<class Ops, bool minus>
ExecStatus
NrootPlusDom<Ops,minus>::propagate(Space& home, const ModEventDelta& med) {
if (IntView::me(med) != ME_INT_DOM) {
GECODE_ES_CHECK((prop_nroot_plus_bnd<Ops,minus>(home,x0,x1,ops)));
return x1.assigned() ? home.ES_SUBSUMED(*this)
: home.ES_NOFIX_PARTIAL(*this,IntView::med(ME_INT_DOM));
}
{
ViewRanges<IntView> r(x0);
RangesMapNroot<Ops> rmn(ops);
Iter::Ranges::Map<ViewRanges<IntView>,RangesMapNroot<Ops>,false>
m(r,rmn);
GECODE_ME_CHECK(x1.inter_r(home,m,false));
}
{
ViewRanges<IntView> r(x1);
RangesMapPow<Ops> rmp(ops);
Iter::Ranges::Map<ViewRanges<IntView>,RangesMapPow<Ops>,true>
m(r,rmp);
GECODE_ME_CHECK(x0.inter_r(home,m,false));
}
return x1.assigned() ? home.ES_SUBSUMED(*this) : ES_FIX;
}
template<class Ops>
forceinline
NrootDom<Ops>::NrootDom(Home home, IntView x0, IntView x1, const Ops& o)
: BinaryPropagator<IntView,PC_INT_DOM>(home,x0,x1),
ops(o) {}
template<class Ops>
forceinline ExecStatus
NrootDom<Ops>::post(Home home, IntView x0, IntView x1, Ops ops) {
if (static_cast<unsigned int>(ops.exp()) >= sizeof(int) * CHAR_BIT) {
// The integer limits allow only -2, -1, 0, 1 for x1
GECODE_ME_CHECK(x1.lq(home,1));
GECODE_ME_CHECK(x1.gq(home,-2));
// Just rewrite to values that can be handeled without overflow
ops.exp(ops.even() ? 30 : 31);
}
if (ops.exp() == 0) {
GECODE_ME_CHECK(x1.eq(home,1));
return ES_OK;
} else if (ops.exp() == 1) {
return Rel::EqDom<IntView,IntView>::post(home,x0,x1);
}
if (x0 == x1) {
assert(ops.exp() > 1);
GECODE_ME_CHECK(x0.lq(home,1));
GECODE_ME_CHECK(x0.gq(home,ops.even() ? 0 : -2));
return ES_OK;
}
// Limits values such that no overflow can occur
GECODE_ME_CHECK(x1.lq(home,ops.fnroot(Limits::max)));
GECODE_ME_CHECK(x1.gq(home,-ops.cnroot(-Limits::min)));
if (ops.even()) {
GECODE_ME_CHECK(x0.gq(home,0));
GECODE_ME_CHECK(x1.gq(home,0));
}
if ((x0.min() >= 0) || (x1.min() >= 0))
return NrootPlusDom<Ops,false>::post(home,x0,x1,ops);
if ((x0.max() <= 0) || (x1.max() <= 0))
return NrootPlusDom<Ops,true>::post(home,x0,x1,ops);
assert((x0.min() < 0) && (x0.max() > 0));
assert((x1.min() < 0) && (x1.max() > 0));
GECODE_ES_CHECK(prop_nroot_bnd<Ops>(home,x0,x1,ops));
(void) new (home) NrootDom(home,x0,x1,ops);
return ES_OK;
}
template<class Ops>
forceinline
NrootDom<Ops>::NrootDom(Space& home, NrootDom<Ops>& p)
: BinaryPropagator<IntView,PC_INT_DOM>(home,p),
ops(p.ops) {}
template<class Ops>
Actor*
NrootDom<Ops>::copy(Space& home) {
return new (home) NrootDom<Ops>(home,*this);
}
template<class Ops>
PropCost
NrootDom<Ops>::cost(const Space&, const ModEventDelta& med) const {
if (IntView::me(med) == ME_INT_VAL)
return PropCost::unary(PropCost::LO);
else if (IntView::me(med) == ME_INT_DOM)
return PropCost::binary(PropCost::HI);
else
return PropCost::binary(PropCost::LO);
}
template<class Ops>
ExecStatus
NrootDom<Ops>::propagate(Space& home, const ModEventDelta& med) {
assert(!ops.even());
if ((x0.min() >= 0) || (x1.min() >= 0))
GECODE_REWRITE(*this,(NrootPlusDom<Ops,false>::post(home(*this),x0,x1,ops)));
if ((x0.max() <= 0) || (x1.max() <= 0))
GECODE_REWRITE(*this,(NrootPlusDom<Ops,true>::post(home(*this),x0,x1,ops)));
if (IntView::me(med) != ME_INT_DOM) {
GECODE_ES_CHECK(prop_nroot_bnd<Ops>(home,x0,x1,ops));
return x0.assigned() && x1.assigned() ? home.ES_SUBSUMED(*this)
: home.ES_NOFIX_PARTIAL(*this,IntView::med(ME_INT_DOM));
}
{
ViewRanges<IntView> r(x0);
RangesMapNroot<Ops> rmn(ops);
Iter::Ranges::Map<ViewRanges<IntView>,RangesMapNroot<Ops>,false>
m(r,rmn);
GECODE_ME_CHECK(x1.inter_r(home,m,false));
}
{
ViewRanges<IntView> r(x1);
RangesMapPow<Ops> rmp(ops);
Iter::Ranges::Map<ViewRanges<IntView>,RangesMapPow<Ops>,true>
m(r,rmp);
GECODE_ME_CHECK(x0.inter_r(home,m,false));
}
return x0.assigned() && x1.assigned() ? home.ES_SUBSUMED(*this) : ES_FIX;
}
}}}
// STATISTICS: int-prop
Gecode::Actor
Base-class for both propagators and branchers.
Definition core.hpp:628
Gecode::BinaryPropagator< IntView, PC_INT_BND >::x0
IntView x0
Definition pattern.hpp:87
Gecode::BinaryPropagator< IntView, PC_INT_BND >::BinaryPropagator
BinaryPropagator(Space &home, BinaryPropagator &p)
Gecode::BinaryPropagator< IntView, PC_INT_BND >::x1
IntView x1
Definition pattern.hpp:87
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::Int::Arithmetic::NrootBnd::ops
Ops ops
Operations.
Definition arithmetic.hh:525
Gecode::Int::Arithmetic::NrootBnd::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition nroot.hpp:231
Gecode::Int::Arithmetic::NrootBnd::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition nroot.hpp:225
Gecode::Int::Arithmetic::NrootBnd::NrootBnd
NrootBnd(Space &home, NrootBnd< Ops > &p)
Constructor for cloning p.
Definition nroot.hpp:219
Gecode::Int::Arithmetic::NrootBnd::post
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition nroot.hpp:172
Gecode::Int::Arithmetic::NrootDom::NrootDom
NrootDom(Space &home, NrootDom< Ops > &p)
Constructor for cloning p.
Definition nroot.hpp:418
Gecode::Int::Arithmetic::NrootDom::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition nroot.hpp:430
Gecode::Int::Arithmetic::NrootDom::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition nroot.hpp:441
Gecode::Int::Arithmetic::NrootDom::post
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition nroot.hpp:371
Gecode::Int::Arithmetic::NrootDom::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition nroot.hpp:424
Gecode::Int::Arithmetic::NrootDom::ops
Ops ops
Operations.
Definition arithmetic.hh:585
Gecode::Int::Arithmetic::NrootPlusBnd::ops
Ops ops
Operations.
Definition arithmetic.hh:499
Gecode::Int::Arithmetic::NrootPlusBnd::NrootPlusBnd
NrootPlusBnd(Space &home, NrootPlusBnd< Ops, minus > &p)
Constructor for cloning p.
Definition nroot.hpp:126
Gecode::Int::Arithmetic::NrootPlusBnd::post
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition nroot.hpp:112
Gecode::Int::Arithmetic::NrootPlusBnd::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition nroot.hpp:133
Gecode::Int::Arithmetic::NrootPlusBnd::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition nroot.hpp:139
Gecode::Int::Arithmetic::NrootPlusDom::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition nroot.hpp:318
Gecode::Int::Arithmetic::NrootPlusDom::ops
Ops ops
Operations.
Definition arithmetic.hh:551
Gecode::Int::Arithmetic::NrootPlusDom::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition nroot.hpp:335
Gecode::Int::Arithmetic::NrootPlusDom::post
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition nroot.hpp:296
Gecode::Int::Arithmetic::NrootPlusDom::NrootPlusDom
NrootPlusDom(Space &home, NrootPlusDom< Ops, minus > &p)
Constructor for cloning p.
Definition nroot.hpp:311
Gecode::Int::Arithmetic::NrootPlusDom::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition nroot.hpp:324
Gecode::Int::Arithmetic::RangesMapNroot
Mapping integer to n-th root.
Definition nroot.hpp:270
Gecode::Int::Arithmetic::RangesMapNroot::ops
Ops ops
Power operations.
Definition nroot.hpp:273
Gecode::Int::Arithmetic::RangesMapNroot::max
int max(int x) const
Perform mapping of maximum.
Definition nroot.hpp:282
Gecode::Int::Arithmetic::RangesMapNroot::RangesMapNroot
RangesMapNroot(const Ops &o)
Initialize with operations o.
Definition nroot.hpp:276
Gecode::Int::Arithmetic::RangesMapNroot::min
int min(int x) const
Perform mapping of minimum.
Definition nroot.hpp:278
Gecode::Int::Arithmetic::RangesMapPow
Mapping ranges to powers.
Definition nroot.hpp:251
Gecode::Int::Arithmetic::RangesMapPow::min
int min(int x) const
Perform mapping of minimum.
Definition nroot.hpp:259
Gecode::Int::Arithmetic::RangesMapPow::RangesMapPow
RangesMapPow(const Ops &o)
Initialize with operations o.
Definition nroot.hpp:257
Gecode::Int::Arithmetic::RangesMapPow::ops
Ops ops
Power operations.
Definition nroot.hpp:254
Gecode::Int::Arithmetic::RangesMapPow::max
int max(int x) const
Perform mapping of maximum.
Definition nroot.hpp:263
Gecode::Int::IntView
Integer view for integer variables.
Definition view.hpp:129
Gecode::Int::IntView::min
int min(void) const
Return minimum of domain.
Definition int.hpp:58
Gecode::Int::IntView::lq
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
Definition int.hpp:121
Gecode::Int::IntView::med
int med(void) const
Return median of domain (greatest element not greater than the median).
Definition int.hpp:66
Gecode::Int::IntView::le
ModEvent le(Space &home, int n)
Restrict domain values to be less than n.
Definition int.hpp:130
Gecode::Int::IntView::gq
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
Definition int.hpp:139
Gecode::Int::IntView::max
int max(void) const
Return maximum of domain.
Definition int.hpp:62
Gecode::Int::Rel::EqBnd::post
static ExecStatus post(Home home, View0 x0, View1 x1)
Post bounds consistent propagator .
Definition eq.hpp:108
Gecode::Int::Rel::EqDom::post
static ExecStatus post(Home home, View0 x0, View1 x1)
Post domain consistent propagator .
Definition eq.hpp:176
Gecode::Int::ViewRanges
Range iterator for integer views.
Definition view.hpp:54
Gecode::Iter::Ranges::Map
Range iterator for mapping ranges.
Definition ranges-map.hpp:45
Gecode::PropCost
Propagation cost.
Definition core.hpp:486
Gecode::PropCost::unary
static PropCost unary(PropCost::Mod m)
Single variable for modifier pcm.
Definition core.hpp:4813
Gecode::PropCost::binary
static PropCost binary(PropCost::Mod m)
Two variables for modifier pcm.
Definition core.hpp:4809
Gecode::PropCost::LO
@ LO
Cheap.
Definition core.hpp:513
Gecode::PropCost::HI
@ HI
Expensive.
Definition core.hpp:514
Gecode::Propagator::Space
friend class Space
Definition core.hpp:1066
Gecode::Propagator::med
ModEventDelta med
A set of modification events (used during propagation).
Definition core.hpp:1075
Gecode::Space
Computation spaces.
Definition core.hpp:1742
Gecode::VarImpView< IntVar >::me
static ModEvent me(const ModEventDelta &med)
Definition view.hpp:552
Gecode::Space::ES_NOFIX_PARTIAL
ExecStatus ES_NOFIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has not computed partial fixpoint
Definition core.hpp:3576
Gecode::Space::ES_SUBSUMED
ExecStatus ES_SUBSUMED(Propagator &p)
Definition core.hpp:3563
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
GECODE_ME_CHECK
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
Definition macros.hpp:52
GECODE_REWRITE
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
Definition macros.hpp:116
Gecode::me_failed
bool me_failed(ModEvent me)
Check whether modification event me is failed.
Definition modevent.hpp:54
GECODE_ES_CHECK
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Definition macros.hpp:91
Gecode::me_modified
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
Definition modevent.hpp:59
rel.hh
Gecode::Int::Arithmetic
Numerical (arithmetic) propagators.
Gecode::Int::Arithmetic::prop_nroot_bnd
ExecStatus prop_nroot_bnd(Space &home, IntView x0, IntView x1, const Ops &ops)
Definition nroot.hpp:152
Gecode::Int::Arithmetic::prop_nroot_plus_bnd
ExecStatus prop_nroot_plus_bnd(Space &home, IntView x0, IntView x1, const Ops &ops)
Definition nroot.hpp:48
Gecode::Int::Limits::min
const int min
Smallest allowed integer value.
Definition int.hh:118
Gecode::Int::Limits::max
const int max
Largest allowed integer value.
Definition int.hh:116
Gecode::Int
Finite domain integers.
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::Int::ME_INT_VAL
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable).
Definition var-type.hpp:56
Gecode::Int::ME_INT_DOM
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
Definition var-type.hpp:72
Gecode
Gecode toplevel namespace
Gecode::mod
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl=IPL_DEF)
Post propagator for .
Definition arithmetic.cpp:360
Gecode::ExecStatus
ExecStatus
Definition core.hpp:472
Gecode::ES_OK
@ ES_OK
Execution is okay.
Definition core.hpp:476
Gecode::ES_FIX
@ ES_FIX
Propagation has computed fixpoint.
Definition core.hpp:477
Gecode::ES_FAILED
@ ES_FAILED
Execution has resulted in failure.
Definition core.hpp:474
Gecode::ES_NOFIX
@ ES_NOFIX
Propagation has not computed fixpoint.
Definition core.hpp:475
Gecode::ModEvent
int ModEvent
Type for modification events.
Definition core.hpp:62
forceinline
#define forceinline
Definition config.hpp:187