arithmetic.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>
*
* Copyright:
* Christian Schulte, 2002
* Guido Tack, 2004
*
* 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_ARITHMETIC_HH__
#define __GECODE_INT_ARITHMETIC_HH__
#include <gecode/int.hh>
#include <gecode/int/idx-view.hh>
#include <gecode/int/rel.hh>
#include <gecode/int/linear.hh>
namespace Gecode { namespace Int { namespace Arithmetic {
template<class View>
class AbsBnd : public BinaryPropagator<View,PC_INT_BND> {
protected:
using BinaryPropagator<View,PC_INT_BND>::x0;
using BinaryPropagator<View,PC_INT_BND>::x1;
AbsBnd(Space& home, AbsBnd& p);
AbsBnd(Home home, View x0, View x1);
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, View x0, View x1);
};
template<class View>
class AbsDom : public BinaryPropagator<View,PC_INT_DOM> {
protected:
using BinaryPropagator<View,PC_INT_DOM>::x0;
using BinaryPropagator<View,PC_INT_DOM>::x1;
AbsDom(Space& home, AbsDom& p);
AbsDom(Home home, View x0, View x1);
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, View x0, View x1);
};
}}}
#include <gecode/int/arithmetic/abs.hpp>
namespace Gecode { namespace Int { namespace Arithmetic {
template<class View>
class MaxBnd : public TernaryPropagator<View,PC_INT_BND> {
protected:
using TernaryPropagator<View,PC_INT_BND>::x0;
using TernaryPropagator<View,PC_INT_BND>::x1;
using TernaryPropagator<View,PC_INT_BND>::x2;
MaxBnd(Space& home, MaxBnd& p);
MaxBnd(Home home, View x0, View x1, View x2);
public:
MaxBnd(Space& home, Propagator& p, View x0, View x1, View x2);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, View x0, View x1, View x2);
};
template<class View>
class NaryMaxBnd : public NaryOnePropagator<View,PC_INT_BND> {
protected:
using NaryOnePropagator<View,PC_INT_BND>::x;
using NaryOnePropagator<View,PC_INT_BND>::y;
NaryMaxBnd(Space& home, NaryMaxBnd& p);
NaryMaxBnd(Home home, ViewArray<View>& x, View y);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, ViewArray<View>& x, View y);
};
template<class View>
class MaxDom : public TernaryPropagator<View,PC_INT_DOM> {
protected:
using TernaryPropagator<View,PC_INT_DOM>::x0;
using TernaryPropagator<View,PC_INT_DOM>::x1;
using TernaryPropagator<View,PC_INT_DOM>::x2;
MaxDom(Space& home, MaxDom& p);
MaxDom(Home home, View x0, View x1, View x2);
public:
MaxDom(Space& home, Propagator& p, View x0, View x1, View x2);
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, View x0, View x1, View x2);
};
template<class View>
class NaryMaxDom : public NaryOnePropagator<View,PC_INT_DOM> {
protected:
using NaryOnePropagator<View,PC_INT_DOM>::x;
using NaryOnePropagator<View,PC_INT_DOM>::y;
NaryMaxDom(Space& home, NaryMaxDom& p);
NaryMaxDom(Home home, ViewArray<View>& x, View y);
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<View>& x, View y);
};
}}}
#include <gecode/int/arithmetic/max.hpp>
namespace Gecode { namespace Int { namespace Arithmetic {
template<class VA, class VB, bool tiebreak>
class ArgMax : public Propagator {
protected:
IdxViewArray<VA> x;
VB y;
ArgMax(Space& home, ArgMax& p);
ArgMax(Home home, IdxViewArray<VA>& x, VB y);
public:
virtual Actor* copy(Space& home);
// Cost function (defined as low linear)
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
virtual size_t dispose(Space& home);
static ExecStatus post(Home home, IdxViewArray<VA>& x, VB y);
};
}}}
#include <gecode/int/arithmetic/argmax.hpp>
namespace Gecode { namespace Int { namespace Arithmetic {
class SqrOps {
public:
bool even(void) const;
int exp(void) const;
void exp(int m);
template<class IntType>
IntType pow(IntType x) const;
int tpow(int x) const;
int fnroot(int x) const;
int cnroot(int x) const;
};
class PowOps {
protected:
int n;
static bool even(int m);
bool powgr(long long int r, int x) const;
bool powle(long long int r, int x) const;
public:
PowOps(int n);
bool even(void) const;
int exp(void) const;
void exp(int m);
template<class IntType>
IntType pow(IntType x) const;
int tpow(int x) const;
int fnroot(int x) const;
int cnroot(int x) const;
};
}}}
#include <gecode/int/arithmetic/pow-ops.hpp>
namespace Gecode { namespace Int { namespace Arithmetic {
template<class VA, class VB, class Ops>
class PowPlusBnd : public MixBinaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND> {
protected:
using MixBinaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND>::x0;
using MixBinaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND>::x1;
Ops ops;
PowPlusBnd(Home home, VA x0, VB x1, const Ops& ops);
PowPlusBnd(Space& home, PowPlusBnd<VA,VB,Ops>& p);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, VA x0, VB x1, Ops ops);
};
template<class Ops>
class PowBnd : public BinaryPropagator<IntView,PC_INT_BND> {
protected:
using BinaryPropagator<IntView,PC_INT_BND>::x0;
using BinaryPropagator<IntView,PC_INT_BND>::x1;
Ops ops;
PowBnd(Space& home, PowBnd& p);
PowBnd(Home home, IntView x0, IntView x1, const Ops& ops);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
};
template<class VA, class VB, class Ops>
class PowPlusDom : public MixBinaryPropagator<VA,PC_INT_DOM,VB,PC_INT_DOM> {
protected:
using MixBinaryPropagator<VA,PC_INT_DOM,VB,PC_INT_DOM>::x0;
using MixBinaryPropagator<VA,PC_INT_DOM,VB,PC_INT_DOM>::x1;
Ops ops;
PowPlusDom(Home home, VA x0, VB x1, const Ops& ops);
PowPlusDom(Space& home, PowPlusDom<VA,VB,Ops>& 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, VA x0, VB x1, Ops ops);
};
template<class Ops>
class PowDom : public BinaryPropagator<IntView,PC_INT_DOM> {
protected:
using BinaryPropagator<IntView,PC_INT_DOM>::x0;
using BinaryPropagator<IntView,PC_INT_DOM>::x1;
Ops ops;
PowDom(Space& home, PowDom<Ops>& p);
PowDom(Home home, IntView x0, IntView x1, const Ops& ops);
public:
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, IntView x0, IntView x1, Ops ops);
};
}}}
#include <gecode/int/arithmetic/pow.hpp>
namespace Gecode { namespace Int { namespace Arithmetic {
template<class Ops, bool minus>
class NrootPlusBnd : public BinaryPropagator<IntView,PC_INT_BND> {
protected:
using BinaryPropagator<IntView,PC_INT_BND>::x0;
using BinaryPropagator<IntView,PC_INT_BND>::x1;
Ops ops;
NrootPlusBnd(Space& home, NrootPlusBnd<Ops,minus>& p);
NrootPlusBnd(Home home, IntView x0, IntView x1, const Ops& ops);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
};
template<class Ops>
class NrootBnd : public BinaryPropagator<IntView,PC_INT_BND> {
protected:
using BinaryPropagator<IntView,PC_INT_BND>::x0;
using BinaryPropagator<IntView,PC_INT_BND>::x1;
Ops ops;
NrootBnd(Space& home, NrootBnd<Ops>& p);
NrootBnd(Home home, IntView x0, IntView x1, const Ops& ops);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
};
template<class Ops, bool minus>
class NrootPlusDom : public BinaryPropagator<IntView,PC_INT_DOM> {
protected:
using BinaryPropagator<IntView,PC_INT_DOM>::x0;
using BinaryPropagator<IntView,PC_INT_DOM>::x1;
Ops ops;
NrootPlusDom(Space& home, NrootPlusDom<Ops,minus>& p);
NrootPlusDom(Home home, IntView x0, IntView x1, const Ops& ops);
public:
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, IntView x0, IntView x1, Ops ops);
};
template<class Ops>
class NrootDom : public BinaryPropagator<IntView,PC_INT_DOM> {
protected:
using BinaryPropagator<IntView,PC_INT_DOM>::x0;
using BinaryPropagator<IntView,PC_INT_DOM>::x1;
Ops ops;
NrootDom(Space& home, NrootDom<Ops>& p);
NrootDom(Home home, IntView x0, IntView x1, const Ops& ops);
public:
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, IntView x0, IntView x1, Ops ops);
};
}}}
#include <gecode/int/arithmetic/nroot.hpp>
namespace Gecode { namespace Int { namespace Arithmetic {
template<class View, PropCond pc>
class MultZeroOne : public BinaryPropagator<View,pc> {
protected:
using BinaryPropagator<View,pc>::x0;
using BinaryPropagator<View,pc>::x1;
MultZeroOne(Space& home, MultZeroOne<View,pc>& p);
MultZeroOne(Home home, View x0, View x1);
static RelTest equal(View x, int n);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, View x0, View x1);
};
template<class VA, class VB, class VC>
class MultPlusBnd :
public MixTernaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND,VC,PC_INT_BND> {
protected:
using MixTernaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND,VC,PC_INT_BND>::x0;
using MixTernaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND,VC,PC_INT_BND>::x1;
using MixTernaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND,VC,PC_INT_BND>::x2;
public:
MultPlusBnd(Home home, VA x0, VB x1, VC x2);
MultPlusBnd(Space& home, MultPlusBnd<VA,VB,VC>& p);
static ExecStatus post(Home home, VA x0, VB x1, VC x2);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
};
class MultBnd : public TernaryPropagator<IntView,PC_INT_BND> {
protected:
using TernaryPropagator<IntView,PC_INT_BND>::x0;
using TernaryPropagator<IntView,PC_INT_BND>::x1;
using TernaryPropagator<IntView,PC_INT_BND>::x2;
MultBnd(Space& home, MultBnd& p);
public:
MultBnd(Home home, IntView x0, IntView x1, IntView x2);
GECODE_INT_EXPORT
static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2);
GECODE_INT_EXPORT
virtual Actor* copy(Space& home);
GECODE_INT_EXPORT
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
};
template<class VA, class VB, class VC>
class MultPlusDom :
public MixTernaryPropagator<VA,PC_INT_DOM,VB,PC_INT_DOM,VC,PC_INT_DOM> {
protected:
using MixTernaryPropagator<VA,PC_INT_DOM,VB,PC_INT_DOM,VC,PC_INT_DOM>::x0;
using MixTernaryPropagator<VA,PC_INT_DOM,VB,PC_INT_DOM,VC,PC_INT_DOM>::x1;
using MixTernaryPropagator<VA,PC_INT_DOM,VB,PC_INT_DOM,VC,PC_INT_DOM>::x2;
public:
MultPlusDom(Home home, VA x0, VB x1, VC x2);
MultPlusDom(Space& home, MultPlusDom<VA,VB,VC>& p);
static ExecStatus post(Home home, VA x0, VB x1, VC x2);
virtual Actor* copy(Space& home);
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
};
class MultDom : public TernaryPropagator<IntView,PC_INT_DOM> {
protected:
using TernaryPropagator<IntView,PC_INT_DOM>::x0;
using TernaryPropagator<IntView,PC_INT_DOM>::x1;
using TernaryPropagator<IntView,PC_INT_DOM>::x2;
MultDom(Space& home, MultDom& p);
public:
MultDom(Home home, IntView x0, IntView x1, IntView x2);
GECODE_INT_EXPORT
static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2);
GECODE_INT_EXPORT
virtual Actor* copy(Space& home);
GECODE_INT_EXPORT
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
GECODE_INT_EXPORT
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
};
}}}
#include <gecode/int/arithmetic/mult.hpp>
namespace Gecode { namespace Int { namespace Arithmetic {
template<class VA, class VB, class VC>
class DivPlusBnd :
public MixTernaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND,VC,PC_INT_BND> {
protected:
using MixTernaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND,VC,PC_INT_BND>::x0;
using MixTernaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND,VC,PC_INT_BND>::x1;
using MixTernaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND,VC,PC_INT_BND>::x2;
public:
DivPlusBnd(Home home, VA x0, VB x1, VC x2);
DivPlusBnd(Space& home, DivPlusBnd<VA,VB,VC>& p);
static ExecStatus post(Home home, VA x0, VB x1, VC x2);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
};
template<class View>
class DivBnd : public TernaryPropagator<View,PC_INT_BND> {
protected:
using TernaryPropagator<View,PC_INT_BND>::x0;
using TernaryPropagator<View,PC_INT_BND>::x1;
using TernaryPropagator<View,PC_INT_BND>::x2;
DivBnd(Space& home, DivBnd<View>& p);
public:
DivBnd(Home home, View x0, View x1, View x2);
static ExecStatus post(Home home, View x0, View x1, View x2);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
};
template<class View>
class DivMod : public TernaryPropagator<View,PC_INT_BND> {
protected:
using TernaryPropagator<View,PC_INT_BND>::x0;
using TernaryPropagator<View,PC_INT_BND>::x1;
using TernaryPropagator<View,PC_INT_BND>::x2;
DivMod(Space& home, DivMod<View>& p);
public:
DivMod(Home home, View x0, View x1, View x2);
static ExecStatus post(Home home, View x0, View x1, View x2);
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
};
}}}
#include <gecode/int/arithmetic/divmod.hpp>
#endif
// STATISTICS: int-prop
argmax.hpp
Gecode::ActorLink::Actor
friend class Actor
Definition core.hpp:590
Gecode::BinaryPropagator< View, PC_INT_BND >::x0
View x0
Definition pattern.hpp:87
Gecode::BinaryPropagator< View, PC_INT_BND >::BinaryPropagator
BinaryPropagator(Space &home, BinaryPropagator &p)
Gecode::BinaryPropagator< View, PC_INT_BND >::x1
View x1
Definition pattern.hpp:87
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::Int::Arithmetic::AbsBnd::AbsBnd
AbsBnd(Space &home, AbsBnd &p)
Constructor for cloning p.
Gecode::Int::Arithmetic::AbsBnd::post
static ExecStatus post(Home home, View x0, View x1)
Post bounds consistent propagator .
Definition abs.hpp:93
Gecode::Int::Arithmetic::AbsBnd::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition abs.hpp:120
Gecode::Int::Arithmetic::AbsBnd::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition abs.hpp:126
Gecode::Int::Arithmetic::AbsBnd::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition abs.hpp:135
Gecode::Int::Arithmetic::AbsDom::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition abs.hpp:191
Gecode::Int::Arithmetic::AbsDom::AbsDom
AbsDom(Space &home, AbsDom &p)
Constructor for cloning p.
Gecode::Int::Arithmetic::AbsDom::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition abs.hpp:181
Gecode::Int::Arithmetic::AbsDom::post
static ExecStatus post(Home home, View x0, View x1)
Post domain consistent propagator .
Definition abs.hpp:148
Gecode::Int::Arithmetic::AbsDom::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition abs.hpp:175
Gecode::Int::Arithmetic::ArgMax::x
IdxViewArray< VA > x
Map of index and views.
Definition arithmetic.hh:263
Gecode::Int::Arithmetic::ArgMax::y
VB y
Position of maximum view (maximal argument).
Definition arithmetic.hh:265
Gecode::Int::Arithmetic::ArgMax::ArgMax
ArgMax(Space &home, ArgMax &p)
Constructor for cloning p.
Definition argmax.hpp:76
Gecode::Int::Arithmetic::ArgMax::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition argmax.hpp:103
Gecode::Int::Arithmetic::ArgMax::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition argmax.hpp:84
Gecode::Int::Arithmetic::ArgMax::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition argmax.hpp:90
Gecode::Int::Arithmetic::ArgMax::post
static ExecStatus post(Home home, IdxViewArray< VA > &x, VB y)
Post propagator .
Definition argmax.hpp:48
Gecode::Int::Arithmetic::ArgMax::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition argmax.hpp:255
Gecode::Int::Arithmetic::ArgMax::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition argmax.hpp:96
Gecode::Int::Arithmetic::DivBnd::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition divmod.hpp:112
Gecode::Int::Arithmetic::DivBnd::DivBnd
DivBnd(Space &home, DivBnd< View > &p)
Constructor for cloning p.
Definition divmod.hpp:107
Gecode::Int::Arithmetic::DivBnd::post
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator (rounding towards 0).
Definition divmod.hpp:235
Gecode::Int::Arithmetic::DivBnd::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition divmod.hpp:118
Gecode::Int::Arithmetic::DivMod::post
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
Definition divmod.hpp:280
Gecode::Int::Arithmetic::DivMod::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition divmod.hpp:293
Gecode::Int::Arithmetic::DivMod::DivMod
DivMod(Space &home, DivMod< View > &p)
Constructor for cloning p.
Definition divmod.hpp:288
Gecode::Int::Arithmetic::DivMod::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition divmod.hpp:299
Gecode::Int::Arithmetic::DivPlusBnd::post
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator (rounding towards 0).
Definition divmod.hpp:87
Gecode::Int::Arithmetic::DivPlusBnd::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition divmod.hpp:57
Gecode::Int::Arithmetic::DivPlusBnd::DivPlusBnd
DivPlusBnd(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
Definition divmod.hpp:45
Gecode::Int::Arithmetic::DivPlusBnd::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition divmod.hpp:63
Gecode::Int::Arithmetic::MaxBnd::MaxBnd
MaxBnd(Space &home, MaxBnd &p)
Constructor for cloning p.
Gecode::Int::Arithmetic::MaxBnd::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition max.hpp:112
Gecode::Int::Arithmetic::MaxBnd::post
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
Definition max.hpp:80
Gecode::Int::Arithmetic::MaxBnd::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition max.hpp:106
Gecode::Int::Arithmetic::MaxDom::post
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
Definition max.hpp:242
Gecode::Int::Arithmetic::MaxDom::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition max.hpp:281
Gecode::Int::Arithmetic::MaxDom::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition max.hpp:268
Gecode::Int::Arithmetic::MaxDom::MaxDom
MaxDom(Space &home, MaxDom &p)
Constructor for cloning p.
Gecode::Int::Arithmetic::MaxDom::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition max.hpp:274
Gecode::Int::Arithmetic::MultBnd::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition mult.cpp:48
Gecode::Int::Arithmetic::MultBnd::MultBnd
MultBnd(Space &home, MultBnd &p)
Constructor for cloning p.
Definition mult.hpp:263
Gecode::Int::Arithmetic::MultBnd::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition mult.cpp:43
Gecode::Int::Arithmetic::MultBnd::post
static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2)
Post propagator .
Definition mult.cpp:144
Gecode::Int::Arithmetic::MultDom::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition mult.cpp:197
Gecode::Int::Arithmetic::MultDom::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition mult.cpp:202
Gecode::Int::Arithmetic::MultDom::post
static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2)
Post propagator .
Definition mult.cpp:311
Gecode::Int::Arithmetic::MultDom::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition mult.cpp:210
Gecode::Int::Arithmetic::MultDom::MultDom
MultDom(Space &home, MultDom &p)
Constructor for cloning p.
Definition mult.hpp:350
Gecode::Int::Arithmetic::MultPlusBnd::post
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator .
Definition mult.hpp:244
Gecode::Int::Arithmetic::MultPlusBnd::MultPlusBnd
MultPlusBnd(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
Definition mult.hpp:220
Gecode::Int::Arithmetic::MultPlusBnd::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition mult.hpp:232
Gecode::Int::Arithmetic::MultPlusBnd::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition mult.hpp:238
Gecode::Int::Arithmetic::MultPlusDom::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition mult.hpp:304
Gecode::Int::Arithmetic::MultPlusDom::post
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator .
Definition mult.hpp:331
Gecode::Int::Arithmetic::MultPlusDom::MultPlusDom
MultPlusDom(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
Definition mult.hpp:292
Gecode::Int::Arithmetic::MultPlusDom::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition mult.hpp:310
Gecode::Int::Arithmetic::MultPlusDom::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition mult.hpp:320
Gecode::Int::Arithmetic::MultZeroOne::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition mult.hpp:141
Gecode::Int::Arithmetic::MultZeroOne::MultZeroOne
MultZeroOne(Space &home, MultZeroOne< View, pc > &p)
Constructor for cloning p.
Definition mult.hpp:136
Gecode::Int::Arithmetic::MultZeroOne::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition mult.hpp:147
Gecode::Int::Arithmetic::MultZeroOne::post
static ExecStatus post(Home home, View x0, View x1)
Post propagator .
Definition mult.hpp:109
Gecode::Int::Arithmetic::MultZeroOne::equal
static RelTest equal(View x, int n)
Test whether x is equal to n.
Definition mult.hpp:99
Gecode::Int::Arithmetic::NaryMaxBnd::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition max.hpp:166
Gecode::Int::Arithmetic::NaryMaxBnd::NaryMaxBnd
NaryMaxBnd(Space &home, NaryMaxBnd &p)
Constructor for cloning p.
Gecode::Int::Arithmetic::NaryMaxBnd::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition max.hpp:221
Gecode::Int::Arithmetic::NaryMaxBnd::post
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
Definition max.hpp:134
Gecode::Int::Arithmetic::NaryMaxDom::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition max.hpp:350
Gecode::Int::Arithmetic::NaryMaxDom::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition max.hpp:360
Gecode::Int::Arithmetic::NaryMaxDom::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition max.hpp:369
Gecode::Int::Arithmetic::NaryMaxDom::post
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
Definition max.hpp:318
Gecode::Int::Arithmetic::NaryMaxDom::NaryMaxDom
NaryMaxDom(Space &home, NaryMaxDom &p)
Constructor for cloning p.
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::PowBnd::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition pow.hpp:216
Gecode::Int::Arithmetic::PowBnd::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition pow.hpp:222
Gecode::Int::Arithmetic::PowBnd::post
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition pow.hpp:149
Gecode::Int::Arithmetic::PowBnd::ops
Ops ops
Operations.
Definition arithmetic.hh:400
Gecode::Int::Arithmetic::PowBnd::PowBnd
PowBnd(Space &home, PowBnd &p)
Constructor for cloning p.
Definition pow.hpp:210
Gecode::Int::Arithmetic::PowDom::post
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition pow.hpp:386
Gecode::Int::Arithmetic::PowDom::ops
Ops ops
Operations.
Definition arithmetic.hh:459
Gecode::Int::Arithmetic::PowDom::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition pow.hpp:453
Gecode::Int::Arithmetic::PowDom::PowDom
PowDom(Space &home, PowDom< Ops > &p)
Constructor for cloning p.
Definition pow.hpp:447
Gecode::Int::Arithmetic::PowDom::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition pow.hpp:459
Gecode::Int::Arithmetic::PowDom::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition pow.hpp:470
Gecode::Int::Arithmetic::PowOps::cnroot
int cnroot(int x) const
Return where x must be non-negative and .
Definition pow-ops.hpp:153
Gecode::Int::Arithmetic::PowOps::tpow
int tpow(int x) const
Return where truncated to integer limits.
Definition pow-ops.hpp:75
Gecode::Int::Arithmetic::PowOps::powgr
bool powgr(long long int r, int x) const
Test whether .
Definition pow-ops.hpp:94
Gecode::Int::Arithmetic::PowOps::pow
IntType pow(IntType x) const
Return where .
Definition pow-ops.hpp:61
Gecode::Int::Arithmetic::PowOps::exp
int exp(void) const
Return exponent.
Definition pow-ops.hpp:50
Gecode::Int::Arithmetic::PowOps::powle
bool powle(long long int r, int x) const
Test whether .
Definition pow-ops.hpp:132
Gecode::Int::Arithmetic::PowOps::n
int n
The exponent and root index.
Definition arithmetic.hh:330
Gecode::Int::Arithmetic::PowOps::PowOps
PowOps(int n)
Initialize with exponent n.
Definition pow-ops.hpp:37
Gecode::Int::Arithmetic::PowOps::fnroot
int fnroot(int x) const
Return where x must be non-negative and .
Definition pow-ops.hpp:115
Gecode::Int::Arithmetic::PowOps::even
bool even(void) const
Return whether exponent is even.
Definition pow-ops.hpp:45
Gecode::Int::Arithmetic::PowPlusBnd::post
static ExecStatus post(Home home, VA x0, VB x1, Ops ops)
Post propagator.
Definition pow.hpp:83
Gecode::Int::Arithmetic::PowPlusBnd::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition pow.hpp:108
Gecode::Int::Arithmetic::PowPlusBnd::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition pow.hpp:102
Gecode::Int::Arithmetic::PowPlusBnd::ops
Ops ops
Operations.
Definition arithmetic.hh:374
Gecode::Int::Arithmetic::PowPlusBnd::PowPlusBnd
PowPlusBnd(Home home, VA x0, VB x1, const Ops &ops)
Constructor for posting.
Definition pow.hpp:77
Gecode::Int::Arithmetic::PowPlusDom::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition pow.hpp:337
Gecode::Int::Arithmetic::PowPlusDom::ops
Ops ops
Operations.
Definition arithmetic.hh:425
Gecode::Int::Arithmetic::PowPlusDom::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition pow.hpp:348
Gecode::Int::Arithmetic::PowPlusDom::post
static ExecStatus post(Home home, VA x0, VB x1, Ops ops)
Post propagator.
Definition pow.hpp:312
Gecode::Int::Arithmetic::PowPlusDom::PowPlusDom
PowPlusDom(Home home, VA x0, VB x1, const Ops &ops)
Constructor for posting.
Definition pow.hpp:306
Gecode::Int::Arithmetic::PowPlusDom::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition pow.hpp:331
Gecode::Int::Arithmetic::SqrOps
Operations for square and square-root propagators.
Definition arithmetic.hh:302
Gecode::Int::Arithmetic::SqrOps::tpow
int tpow(int x) const
Return truncated to integer limits.
Definition pow-ops.hpp:193
Gecode::Int::Arithmetic::SqrOps::fnroot
int fnroot(int x) const
Return where x must be non-negative and .
Definition pow-ops.hpp:203
Gecode::Int::Arithmetic::SqrOps::even
bool even(void) const
Return whether exponent is even.
Definition pow-ops.hpp:172
Gecode::Int::Arithmetic::SqrOps::pow
IntType pow(IntType x) const
Return .
Definition pow-ops.hpp:188
Gecode::Int::Arithmetic::SqrOps::cnroot
int cnroot(int x) const
Return where x must be non-negative and .
Definition pow-ops.hpp:220
Gecode::Int::Arithmetic::SqrOps::exp
int exp(void) const
Return exponent.
Definition pow-ops.hpp:177
Gecode::Int::IdxViewArray
An array of IdxView pairs.
Definition idx-view.hh:67
Gecode::Int::IntView
Integer view for integer variables.
Definition view.hpp:129
Gecode::MixBinaryPropagator< VA, PC_INT_BND, VB, PC_INT_BND >::x1
VB x1
Definition pattern.hpp:209
Gecode::MixBinaryPropagator< VA, PC_INT_BND, VB, PC_INT_BND >::MixBinaryPropagator
MixBinaryPropagator(Space &home, MixBinaryPropagator &p)
Definition pattern.hpp:597
Gecode::MixBinaryPropagator< VA, PC_INT_BND, VB, PC_INT_BND >::x0
VA x0
Definition pattern.hpp:207
Gecode::MixTernaryPropagator< VA, PC_INT_BND, VB, PC_INT_BND, VC, PC_INT_BND >::x0
VA x0
Definition pattern.hpp:240
Gecode::MixTernaryPropagator< VA, PC_INT_BND, VB, PC_INT_BND, VC, PC_INT_BND >::x1
VB x1
Definition pattern.hpp:242
Gecode::MixTernaryPropagator< VA, PC_INT_BND, VB, PC_INT_BND, VC, PC_INT_BND >::x2
VC x2
Definition pattern.hpp:244
Gecode::MixTernaryPropagator< VA, PC_INT_BND, VB, PC_INT_BND, VC, PC_INT_BND >::MixTernaryPropagator
MixTernaryPropagator(Space &home, MixTernaryPropagator &p)
Definition pattern.hpp:661
Gecode::NaryOnePropagator< View, PC_INT_BND >::x
ViewArray< View > x
Definition pattern.hpp:175
Gecode::NaryOnePropagator< View, PC_INT_BND >::NaryOnePropagator
NaryOnePropagator(Space &home, NaryOnePropagator &p)
Gecode::NaryOnePropagator< View, PC_INT_BND >::y
View y
Definition pattern.hpp:177
Gecode::PropCost
Propagation cost.
Definition core.hpp:486
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::Propagator::Propagator
Propagator(Home home)
Constructor for posting.
Definition core.hpp:3498
Gecode::TernaryPropagator< View, PC_INT_BND >::x2
View x2
Definition pattern.hpp:116
Gecode::TernaryPropagator< View, PC_INT_BND >::x1
View x1
Definition pattern.hpp:116
Gecode::TernaryPropagator< View, PC_INT_BND >::x0
View x0
Definition pattern.hpp:116
Gecode::TernaryPropagator< View, PC_INT_BND >::TernaryPropagator
TernaryPropagator(Space &home, TernaryPropagator &p)
Gecode::View
Gecode::ViewArray
View arrays.
Definition array.hpp:253
divmod.hpp
int.hh
GECODE_INT_EXPORT
#define GECODE_INT_EXPORT
Definition int.hh:81
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
idx-view.hh
abs.hpp
mult.hpp
linear.hh
rel.hh
max.hpp
Gecode::Int::Arithmetic
Numerical (arithmetic) propagators.
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::RelTest
RelTest
Result of testing relation.
Definition view.hpp:1734
Gecode
Gecode toplevel namespace
Gecode::ExecStatus
ExecStatus
Definition core.hpp:472
nroot.hpp
pow-ops.hpp
pow.hpp