Gecode::Int::Distinct::Bnd< View > Class Template Reference
[Integer propagators]
#include <distinct.hh>
Inherits Gecode::Propagator.
Detailed Description
template<class View>
class Gecode::Int::Distinct::Bnd< View >
Bounds consistent distinct propagator.
The propagator uses staging: first it uses naive value-based propagation and only then uses bounds consistent propagation. Due to using naive value-based propagation, the propagator might actually achieve stronger consistency than just bounds consistency.
The algorithm is taken from: A. Lopez-Ortiz, C.-G. Quimper, J. Tromp, and P. van Beek. A fast and simple algorithm for bounds consistency of the alldifferent constraint. IJCAI-2003.
This implementation uses the code that is provided by Peter Van Beek: http://ai.uwaterloo.ca/~vanbeek/software/software.html The code (originally by John Tromp) here has only been slightly modified to fit Gecode (taking idempotent/non-idempotent propagation into account) and uses a more efficient layout of datastructures (keeping the number of different arrays small).
Requires
#include "gecode/int/distinct.hh"
Definition at line 136 of file distinct.hh.
Public Member Functions | |
virtual ExecStatus | propagate (Space *home, ModEventDelta med) |
Perform propagation. | |
virtual PropCost | cost (ModEventDelta med) const |
Cost function. | |
virtual Actor * | copy (Space *home, bool share) |
Copy propagator during cloning. | |
virtual size_t | dispose (Space *home) |
Destructor. | |
virtual Reflection::ActorSpec | spec (const Space *home, Reflection::VarMap &m) const |
Specification for this propagator. | |
Static Public Member Functions | |
static ExecStatus | post (Space *home, ViewArray< View > &x) |
Post propagator for view array x. | |
static void | post (Space *home, Reflection::VarMap &vars, const Reflection::ActorSpec &spec) |
Post propagator for specification. | |
static Support::Symbol | ati (void) |
Name of this propagator. | |
Protected Member Functions | |
Bnd (Space *home, ViewArray< View > &x) | |
Constructor for posting. | |
Bnd (Space *home, bool share, Bnd< View > &p) | |
Constructor for cloning p. | |
Protected Attributes | |
ViewArray< View > | x |
Views on which to perform bounds-propagation. | |
ViewArray< View > | y |
Views on which to perform value-propagation (subset of x ). |
Constructor & Destructor Documentation
Gecode::Int::Distinct::Bnd< View >::Bnd | ( | Space * | home, | |
ViewArray< View > & | x | |||
) | [inline, protected] |
Gecode::Int::Distinct::Bnd< View >::Bnd | ( | Space * | home, | |
bool | share, | |||
Bnd< View > & | p | |||
) | [inline, protected] |
Member Function Documentation
ExecStatus Gecode::Int::Distinct::Bnd< View >::post | ( | Space * | home, | |
ViewArray< View > & | x | |||
) | [inline, static] |
void Gecode::Int::Distinct::Bnd< View >::post | ( | Space * | home, | |
Reflection::VarMap & | vars, | |||
const Reflection::ActorSpec & | spec | |||
) | [inline, static] |
ExecStatus Gecode::Int::Distinct::Bnd< View >::propagate | ( | Space * | home, | |
ModEventDelta | med | |||
) | [inline, virtual] |
PropCost Gecode::Int::Distinct::Bnd< View >::cost | ( | ModEventDelta | med | ) | const [inline, virtual] |
Cost function.
If in stage for naive value propagation, the cost is dynamic PC_LINEAR_LO. Otherwise it is dynamic PC_LINEAR_HI.
Implements Gecode::Propagator.
Actor * Gecode::Int::Distinct::Bnd< View >::copy | ( | Space * | home, | |
bool | share | |||
) | [inline, virtual] |
size_t Gecode::Int::Distinct::Bnd< View >::dispose | ( | Space * | home | ) | [inline, virtual] |
Reflection::ActorSpec Gecode::Int::Distinct::Bnd< View >::spec | ( | const Space * | home, | |
Reflection::VarMap & | m | |||
) | const [inline, virtual] |
Support::Symbol Gecode::Int::Distinct::Bnd< View >::ati | ( | void | ) | [inline, static] |
Member Data Documentation
ViewArray<View> Gecode::Int::Distinct::Bnd< View >::x [protected] |
ViewArray<View> Gecode::Int::Distinct::Bnd< View >::y [protected] |
Views on which to perform value-propagation (subset of x
).
Definition at line 141 of file distinct.hh.
The documentation for this class was generated from the following files:
- gecode/int/distinct.hh (Revision: 7285)
- gecode/int/distinct/bnd.icc (Revision: 6017)