pattern.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>
* 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.
*
*/
namespace Gecode {
template<class View, PropCond pc>
class UnaryPropagator : public Propagator {
protected:
View x0;
UnaryPropagator(Space& home, UnaryPropagator& p);
UnaryPropagator(Space& home, Propagator& p, View x0);
UnaryPropagator(Home home, View x0);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
};
template<class View, PropCond pc>
class BinaryPropagator : public Propagator {
protected:
View x0, x1;
BinaryPropagator(Space& home, BinaryPropagator& p);
BinaryPropagator(Home home, View x0, View x1);
BinaryPropagator(Space& home, Propagator& p, View x0, View x1);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
};
template<class View, PropCond pc>
class TernaryPropagator : public Propagator {
protected:
View x0, x1, x2;
TernaryPropagator(Space& home, TernaryPropagator& p);
TernaryPropagator(Home home, View x0, View x1, View x2);
TernaryPropagator(Space& home, Propagator& p, View x0, View x1, View x2);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
};
template<class View, PropCond pc>
class NaryPropagator : public Propagator {
protected:
ViewArray<View> x;
NaryPropagator(Space& home, NaryPropagator& p);
NaryPropagator(Space& home, Propagator& p, ViewArray<View>& x);
NaryPropagator(Home home, ViewArray<View>& x);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
};
template<class View, PropCond pc>
class NaryOnePropagator : public Propagator {
protected:
ViewArray<View> x;
View y;
NaryOnePropagator(Space& home, NaryOnePropagator& p);
NaryOnePropagator(Space& home, Propagator& p, ViewArray<View>& x, View y);
NaryOnePropagator(Home home, ViewArray<View>& x, View y);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
};
template<class View0, PropCond pc0, class View1, PropCond pc1>
class MixBinaryPropagator : public Propagator {
protected:
View0 x0;
View1 x1;
MixBinaryPropagator(Space& home, MixBinaryPropagator& p);
MixBinaryPropagator(Home home, View0 x0, View1 x1);
MixBinaryPropagator(Space& home, Propagator& p, View0 x0, View1 x1);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
};
template<class View0, PropCond pc0, class View1, PropCond pc1,
class View2, PropCond pc2>
class MixTernaryPropagator : public Propagator {
protected:
View0 x0;
View1 x1;
View2 x2;
MixTernaryPropagator(Space& home, MixTernaryPropagator& p);
MixTernaryPropagator(Home home, View0 x0, View1 x1, View2 x2);
MixTernaryPropagator(Space& home, Propagator& p,
View0 x0, View1 x1, View2 x2);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
};
template<class View0, PropCond pc0, class View1, PropCond pc1>
class MixNaryOnePropagator : public Propagator {
protected:
ViewArray<View0> x;
View1 y;
MixNaryOnePropagator(Space& home, MixNaryOnePropagator& p);
MixNaryOnePropagator(Home home, ViewArray<View0>& x, View1 y);
MixNaryOnePropagator(Space& home, Propagator& p,
ViewArray<View0>& x, View1 y);
public:
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
};
/*
* Unary propagators
*
*/
template<class View, PropCond pc>
UnaryPropagator<View,pc>::UnaryPropagator(Home home, View y0)
: Propagator(home), x0(y0) {
if (pc != PC_GEN_NONE)
x0.subscribe(home,*this,pc);
}
template<class View, PropCond pc>
forceinline
UnaryPropagator<View,pc>::UnaryPropagator
(Space& home, UnaryPropagator<View,pc>& p)
: Propagator(home,p) {
x0.update(home,p.x0);
}
template<class View, PropCond pc>
forceinline
UnaryPropagator<View,pc>::UnaryPropagator
(Space& home, Propagator& p, View y0)
: Propagator(home,p) {
x0.update(home,y0);
}
template<class View, PropCond pc>
PropCost
UnaryPropagator<View,pc>::cost(const Space&, const ModEventDelta&) const {
return PropCost::unary(PropCost::LO);
}
template<class View, PropCond pc>
void
UnaryPropagator<View,pc>::reschedule(Space& home) {
if (pc != PC_GEN_NONE)
x0.reschedule(home,*this,pc);
}
template<class View, PropCond pc>
forceinline size_t
UnaryPropagator<View,pc>::dispose(Space& home) {
if (pc != PC_GEN_NONE)
x0.cancel(home,*this,pc);
(void) Propagator::dispose(home);
return sizeof(*this);
}
/*
* Binary propagators
*
*/
template<class View, PropCond pc>
BinaryPropagator<View,pc>::BinaryPropagator(Home home, View y0, View y1)
: Propagator(home), x0(y0), x1(y1) {
if (pc != PC_GEN_NONE) {
x0.subscribe(home,*this,pc);
x1.subscribe(home,*this,pc);
}
}
template<class View, PropCond pc>
forceinline
BinaryPropagator<View,pc>::BinaryPropagator
(Space& home, BinaryPropagator<View,pc>& p)
: Propagator(home,p) {
x0.update(home,p.x0);
x1.update(home,p.x1);
}
template<class View, PropCond pc>
forceinline
BinaryPropagator<View,pc>::BinaryPropagator
(Space& home, Propagator& p, View y0, View y1)
: Propagator(home,p) {
x0.update(home,y0);
x1.update(home,y1);
}
template<class View, PropCond pc>
PropCost
BinaryPropagator<View,pc>::cost(const Space&, const ModEventDelta&) const {
return PropCost::binary(PropCost::LO);
}
template<class View, PropCond pc>
void
BinaryPropagator<View,pc>::reschedule(Space& home) {
if (pc != PC_GEN_NONE) {
x0.reschedule(home,*this,pc);
x1.reschedule(home,*this,pc);
}
}
template<class View, PropCond pc>
forceinline size_t
BinaryPropagator<View,pc>::dispose(Space& home) {
if (pc != PC_GEN_NONE) {
x0.cancel(home,*this,pc);
x1.cancel(home,*this,pc);
}
(void) Propagator::dispose(home);
return sizeof(*this);
}
/*
* Ternary propagators
*
*/
template<class View, PropCond pc>
TernaryPropagator<View,pc>::TernaryPropagator
(Home home, View y0, View y1, View y2)
: Propagator(home), x0(y0), x1(y1), x2(y2) {
if (pc != PC_GEN_NONE) {
x0.subscribe(home,*this,pc);
x1.subscribe(home,*this,pc);
x2.subscribe(home,*this,pc);
}
}
template<class View, PropCond pc>
forceinline
TernaryPropagator<View,pc>::TernaryPropagator
(Space& home, TernaryPropagator<View,pc>& p)
: Propagator(home,p) {
x0.update(home,p.x0);
x1.update(home,p.x1);
x2.update(home,p.x2);
}
template<class View, PropCond pc>
forceinline
TernaryPropagator<View,pc>::TernaryPropagator
(Space& home, Propagator& p, View y0, View y1, View y2)
: Propagator(home,p) {
x0.update(home,y0);
x1.update(home,y1);
x2.update(home,y2);
}
template<class View, PropCond pc>
PropCost
TernaryPropagator<View,pc>::cost(const Space&, const ModEventDelta&) const {
return PropCost::ternary(PropCost::LO);;
}
template<class View, PropCond pc>
void
TernaryPropagator<View,pc>::reschedule(Space& home) {
if (pc != PC_GEN_NONE) {
x0.reschedule(home,*this,pc);
x1.reschedule(home,*this,pc);
x2.reschedule(home,*this,pc);
}
}
template<class View, PropCond pc>
forceinline size_t
TernaryPropagator<View,pc>::dispose(Space& home) {
if (pc != PC_GEN_NONE) {
x0.cancel(home,*this,pc);
x1.cancel(home,*this,pc);
x2.cancel(home,*this,pc);
}
(void) Propagator::dispose(home);
return sizeof(*this);
}
/*
* Nary propagators
*
*/
template<class View, PropCond pc>
NaryPropagator<View,pc>::NaryPropagator
(Home home, ViewArray<View>& y)
: Propagator(home), x(y) {
if (pc != PC_GEN_NONE)
x.subscribe(home,*this,pc);
}
template<class View, PropCond pc>
forceinline
NaryPropagator<View,pc>::NaryPropagator
(Space& home, NaryPropagator<View,pc>& p)
: Propagator(home,p) {
x.update(home,p.x);
}
template<class View, PropCond pc>
forceinline
NaryPropagator<View,pc>::NaryPropagator
(Space& home, Propagator& p, ViewArray<View>& x0)
: Propagator(home,p) {
x.update(home,x0);
}
template<class View, PropCond pc>
PropCost
NaryPropagator<View,pc>::cost(const Space&, const ModEventDelta&) const {
return PropCost::linear(PropCost::LO,x.size());
}
template<class View, PropCond pc>
void
NaryPropagator<View,pc>::reschedule(Space& home) {
if (pc != PC_GEN_NONE)
x.reschedule(home,*this,pc);
}
template<class View, PropCond pc>
forceinline size_t
NaryPropagator<View,pc>::dispose(Space& home) {
if (pc != PC_GEN_NONE)
x.cancel(home,*this,pc);
(void) Propagator::dispose(home);
return sizeof(*this);
}
/*
* NaryOne (one additional variable) propagators
*
*/
template<class View, PropCond pc>
NaryOnePropagator<View,pc>::NaryOnePropagator
(Home home, ViewArray<View>& x0, View y0)
: Propagator(home), x(x0), y(y0) {
if (pc != PC_GEN_NONE) {
x.subscribe(home,*this,pc);
y.subscribe(home,*this,pc);
}
}
template<class View, PropCond pc>
forceinline
NaryOnePropagator<View,pc>::NaryOnePropagator
(Space& home, NaryOnePropagator<View,pc>& p)
: Propagator(home,p) {
x.update(home,p.x);
y.update(home,p.y);
}
template<class View, PropCond pc>
forceinline
NaryOnePropagator<View,pc>::NaryOnePropagator
(Space& home, Propagator& p, ViewArray<View>& x0, View y0)
: Propagator(home,p) {
x.update(home,x0);
y.update(home,y0);
}
template<class View, PropCond pc>
PropCost
NaryOnePropagator<View,pc>::cost(const Space&, const ModEventDelta&) const {
return PropCost::linear(PropCost::LO,x.size()+1);
}
template<class View, PropCond pc>
void
NaryOnePropagator<View,pc>::reschedule(Space& home) {
if (pc != PC_GEN_NONE) {
x.reschedule(home,*this,pc);
y.reschedule(home,*this,pc);
}
}
template<class View, PropCond pc>
forceinline size_t
NaryOnePropagator<View,pc>::dispose(Space& home) {
if (pc != PC_GEN_NONE) {
x.cancel(home,*this,pc);
y.cancel(home,*this,pc);
}
(void) Propagator::dispose(home);
return sizeof(*this);
}
/*
* Mixed binary propagators
*
*/
template<class View0, PropCond pc0, class View1, PropCond pc1>
MixBinaryPropagator<View0,pc0,View1,pc1>::MixBinaryPropagator
(Home home, View0 y0, View1 y1)
: Propagator(home), x0(y0), x1(y1) {
if (pc0 != PC_GEN_NONE)
x0.subscribe(home,*this,pc0);
if (pc1 != PC_GEN_NONE)
x1.subscribe(home,*this,pc1);
}
template<class View0, PropCond pc0, class View1, PropCond pc1>
forceinline
MixBinaryPropagator<View0,pc0,View1,pc1>::MixBinaryPropagator
(Space& home, MixBinaryPropagator<View0,pc0,View1,pc1>& p)
: Propagator(home,p) {
x0.update(home,p.x0);
x1.update(home,p.x1);
}
template<class View0, PropCond pc0, class View1, PropCond pc1>
forceinline
MixBinaryPropagator<View0,pc0,View1,pc1>::MixBinaryPropagator
(Space& home, Propagator& p, View0 y0, View1 y1)
: Propagator(home,p) {
x0.update(home,y0);
x1.update(home,y1);
}
template<class View0, PropCond pc0, class View1, PropCond pc1>
PropCost
MixBinaryPropagator<View0,pc0,View1,pc1>::cost(const Space&,
const ModEventDelta&) const {
return PropCost::binary(PropCost::LO);
}
template<class View0, PropCond pc0, class View1, PropCond pc1>
void
MixBinaryPropagator<View0,pc0,View1,pc1>::reschedule(Space& home) {
if (pc0 != PC_GEN_NONE)
x0.reschedule(home,*this,pc0);
if (pc1 != PC_GEN_NONE)
x1.reschedule(home,*this,pc1);
}
template<class View0, PropCond pc0, class View1, PropCond pc1>
forceinline size_t
MixBinaryPropagator<View0,pc0,View1,pc1>::dispose(Space& home) {
if (pc0 != PC_GEN_NONE)
x0.cancel(home,*this,pc0);
if (pc1 != PC_GEN_NONE)
x1.cancel(home,*this,pc1);
(void) Propagator::dispose(home);
return sizeof(*this);
}
/*
* Mixed ternary propagators
*
*/
template<class View0, PropCond pc0, class View1, PropCond pc1,
class View2, PropCond pc2>
MixTernaryPropagator<View0,pc0,View1,pc1,View2,pc2>::
MixTernaryPropagator(Home home, View0 y0, View1 y1, View2 y2)
: Propagator(home), x0(y0), x1(y1), x2(y2) {
if (pc0 != PC_GEN_NONE)
x0.subscribe(home,*this,pc0);
if (pc1 != PC_GEN_NONE)
x1.subscribe(home,*this,pc1);
if (pc2 != PC_GEN_NONE)
x2.subscribe(home,*this,pc2);
}
template<class View0, PropCond pc0, class View1, PropCond pc1,
class View2, PropCond pc2>
forceinline
MixTernaryPropagator<View0,pc0,View1,pc1,View2,pc2>::
MixTernaryPropagator(Space& home,
MixTernaryPropagator<View0,pc0,View1,pc1,
View2,pc2>& p)
: Propagator(home,p) {
x0.update(home,p.x0);
x1.update(home,p.x1);
x2.update(home,p.x2);
}
template<class View0, PropCond pc0, class View1, PropCond pc1,
class View2, PropCond pc2>
forceinline
MixTernaryPropagator<View0,pc0,View1,pc1,View2,pc2>::MixTernaryPropagator
(Space& home, Propagator& p, View0 y0, View1 y1, View2 y2)
: Propagator(home,p) {
x0.update(home,y0);
x1.update(home,y1);
x2.update(home,y2);
}
template<class View0, PropCond pc0, class View1, PropCond pc1,
class View2, PropCond pc2>
PropCost
MixTernaryPropagator<View0,pc0,View1,pc1,View2,pc2>::
cost(const Space&, const ModEventDelta&) const {
return PropCost::ternary(PropCost::LO);
}
template<class View0, PropCond pc0, class View1, PropCond pc1,
class View2, PropCond pc2>
void
MixTernaryPropagator<View0,pc0,View1,pc1,View2,pc2>::reschedule(Space& home) {
if (pc0 != PC_GEN_NONE)
x0.reschedule(home,*this,pc0);
if (pc1 != PC_GEN_NONE)
x1.reschedule(home,*this,pc1);
if (pc2 != PC_GEN_NONE)
x2.reschedule(home,*this,pc2);
}
template<class View0, PropCond pc0, class View1, PropCond pc1,
class View2, PropCond pc2>
forceinline size_t
MixTernaryPropagator<View0,pc0,View1,pc1,View2,pc2>::dispose(Space& home) {
if (pc0 != PC_GEN_NONE)
x0.cancel(home,*this,pc0);
if (pc1 != PC_GEN_NONE)
x1.cancel(home,*this,pc1);
if (pc2 != PC_GEN_NONE)
x2.cancel(home,*this,pc2);
(void) Propagator::dispose(home);
return sizeof(*this);
}
/*
* MixNaryOne (one additional variable) propagators
*
*/
template<class View0, PropCond pc0, class View1, PropCond pc1>
MixNaryOnePropagator<View0,pc0,View1,pc1>::MixNaryOnePropagator
(Home home, ViewArray<View0>& x0, View1 y0)
: Propagator(home), x(x0), y(y0) {
if (pc0 != PC_GEN_NONE)
x.subscribe(home,*this,pc0);
if (pc1 != PC_GEN_NONE)
y.subscribe(home,*this,pc1);
}
template<class View0, PropCond pc0, class View1, PropCond pc1>
forceinline
MixNaryOnePropagator<View0,pc0,View1,pc1>::MixNaryOnePropagator
(Space& home, MixNaryOnePropagator<View0,pc0,View1,pc1>& p)
: Propagator(home,p) {
x.update(home,p.x);
y.update(home,p.y);
}
template<class View0, PropCond pc0, class View1, PropCond pc1>
forceinline
MixNaryOnePropagator<View0,pc0,View1,pc1>::MixNaryOnePropagator
(Space& home, Propagator& p, ViewArray<View0>& x0, View1 y0)
: Propagator(home,p) {
x.update(home,x0);
y.update(home,y0);
}
template<class View0, PropCond pc0, class View1, PropCond pc1>
PropCost
MixNaryOnePropagator<View0,pc0,View1,pc1>::cost(const Space&,
const ModEventDelta&) const {
return PropCost::linear(PropCost::LO,x.size()+1);
}
template<class View0, PropCond pc0, class View1, PropCond pc1>
void
MixNaryOnePropagator<View0,pc0,View1,pc1>::reschedule(Space& home) {
if (pc0 != PC_GEN_NONE)
x.reschedule(home,*this,pc0);
if (pc1 != PC_GEN_NONE)
y.reschedule(home,*this,pc1);
}
template<class View0, PropCond pc0, class View1, PropCond pc1>
forceinline size_t
MixNaryOnePropagator<View0,pc0,View1,pc1>::dispose(Space& home) {
if (pc0 != PC_GEN_NONE)
x.cancel(home,*this,pc0);
if (pc1 != PC_GEN_NONE)
y.cancel(home,*this,pc1);
(void) Propagator::dispose(home);
return sizeof(*this);
}
}
// STATISTICS: kernel-prop
Gecode::Actor::dispose
virtual size_t dispose(Space &home)
Delete actor and return its size.
Definition core.hpp:3252
Gecode::BinaryPropagator
Binary propagator.
Definition pattern.hpp:84
Gecode::BinaryPropagator::x0
View x0
Two views.
Definition pattern.hpp:87
Gecode::BinaryPropagator::BinaryPropagator
BinaryPropagator(Space &home, BinaryPropagator &p)
Constructor for cloning p.
Gecode::BinaryPropagator::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition pattern.hpp:387
Gecode::BinaryPropagator::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition pattern.hpp:396
Gecode::BinaryPropagator::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary).
Definition pattern.hpp:381
Gecode::BinaryPropagator::x1
View x1
Definition pattern.hpp:87
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::MixBinaryPropagator::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition pattern.hpp:621
Gecode::MixBinaryPropagator::x1
View1 x1
View of type View1.
Definition pattern.hpp:209
Gecode::MixBinaryPropagator::MixBinaryPropagator
MixBinaryPropagator(Space &home, MixBinaryPropagator &p)
Constructor for cloning.
Definition pattern.hpp:597
Gecode::MixBinaryPropagator::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary).
Definition pattern.hpp:614
Gecode::MixBinaryPropagator::x0
View0 x0
View of type View0.
Definition pattern.hpp:207
Gecode::MixBinaryPropagator::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition pattern.hpp:630
Gecode::MixNaryOnePropagator::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition pattern.hpp:766
Gecode::MixNaryOnePropagator::MixNaryOnePropagator
MixNaryOnePropagator(Space &home, MixNaryOnePropagator &p)
Constructor for cloning p.
Definition pattern.hpp:733
Gecode::MixNaryOnePropagator< Gecode::Int::BoolView, Gecode::Int::PC_BOOL_VAL, View, PC_GEN_NONE >::x
ViewArray< Gecode::Int::BoolView > x
Definition pattern.hpp:275
Gecode::MixNaryOnePropagator::MixNaryOnePropagator
MixNaryOnePropagator(Home home, ViewArray< View0 > &x, View1 y)
Constructor for creation.
Definition pattern.hpp:722
Gecode::MixNaryOnePropagator::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear).
Definition pattern.hpp:750
Gecode::MixNaryOnePropagator< Gecode::Int::BoolView, Gecode::Int::PC_BOOL_VAL, View, PC_GEN_NONE >::y
View y
Definition pattern.hpp:277
Gecode::MixNaryOnePropagator::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition pattern.hpp:757
Gecode::MixNaryOnePropagator::MixNaryOnePropagator
MixNaryOnePropagator(Space &home, Propagator &p, ViewArray< View0 > &x, View1 y)
Constructor for rewriting p during cloning.
Definition pattern.hpp:742
Gecode::MixTernaryPropagator::x0
View0 x0
View of type View0.
Definition pattern.hpp:240
Gecode::MixTernaryPropagator::x1
View1 x1
View of type View1.
Definition pattern.hpp:242
Gecode::MixTernaryPropagator::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition pattern.hpp:704
Gecode::MixTernaryPropagator::x2
View2 x2
View of type View2.
Definition pattern.hpp:244
Gecode::MixTernaryPropagator::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition pattern.hpp:692
Gecode::MixTernaryPropagator::MixTernaryPropagator
MixTernaryPropagator(Space &home, MixTernaryPropagator &p)
Constructor for cloning.
Definition pattern.hpp:661
Gecode::MixTernaryPropagator::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low ternary).
Definition pattern.hpp:685
Gecode::NaryOnePropagator
(n+1)-ary propagator
Definition pattern.hpp:172
Gecode::NaryOnePropagator::x
ViewArray< View > x
Array of views.
Definition pattern.hpp:175
Gecode::NaryOnePropagator::NaryOnePropagator
NaryOnePropagator(Space &home, NaryOnePropagator &p)
Constructor for cloning p.
Gecode::NaryOnePropagator::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition pattern.hpp:561
Gecode::NaryOnePropagator::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear).
Definition pattern.hpp:555
Gecode::NaryOnePropagator::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition pattern.hpp:570
Gecode::NaryOnePropagator::y
View y
Single view.
Definition pattern.hpp:177
Gecode::NaryPropagator
n-ary propagator
Definition pattern.hpp:142
Gecode::NaryPropagator::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition pattern.hpp:513
Gecode::NaryPropagator::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear).
Definition pattern.hpp:500
Gecode::NaryPropagator::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition pattern.hpp:506
Gecode::NaryPropagator::x
ViewArray< View > x
Array of views.
Definition pattern.hpp:145
Gecode::NaryPropagator::NaryPropagator
NaryPropagator(Space &home, NaryPropagator &p)
Constructor for cloning p.
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::ternary
static PropCost ternary(PropCost::Mod m)
Three variables for modifier pcm.
Definition core.hpp:4805
Gecode::PropCost::linear
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Definition core.hpp:4796
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::Propagator
Base-class for propagators.
Definition core.hpp:1064
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::Space
Computation spaces.
Definition core.hpp:1742
Gecode::TernaryPropagator
Ternary propagator.
Definition pattern.hpp:113
Gecode::TernaryPropagator::x2
View x2
Definition pattern.hpp:116
Gecode::TernaryPropagator::x1
View x1
Definition pattern.hpp:116
Gecode::TernaryPropagator::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition pattern.hpp:459
Gecode::TernaryPropagator::x0
View x0
Three views.
Definition pattern.hpp:116
Gecode::TernaryPropagator::TernaryPropagator
TernaryPropagator(Space &home, TernaryPropagator &p)
Constructor for cloning p.
Gecode::TernaryPropagator::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low ternary).
Definition pattern.hpp:443
Gecode::TernaryPropagator::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition pattern.hpp:449
Gecode::UnaryPropagator
Unary propagator.
Definition pattern.hpp:55
Gecode::UnaryPropagator::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as PC_UNARY_LO).
Definition pattern.hpp:326
Gecode::UnaryPropagator::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition pattern.hpp:332
Gecode::UnaryPropagator::x0
View x0
Single view.
Definition pattern.hpp:58
Gecode::UnaryPropagator::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition pattern.hpp:339
Gecode::UnaryPropagator::UnaryPropagator
UnaryPropagator(Space &home, UnaryPropagator &p)
Constructor for cloning p.
Gecode::View
Gecode::ViewArray
View arrays.
Definition array.hpp:253
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
Gecode
Gecode toplevel namespace
Gecode::PropCond
int PropCond
Type for propagation conditions.
Definition core.hpp:72
Gecode::PC_GEN_NONE
const PropCond PC_GEN_NONE
Propagation condition to be ignored (convenience).
Definition core.hpp:74
forceinline
#define forceinline
Definition config.hpp:187