Gecode::Int::GCC::Dom< Card > Class Template Reference
Other available functionality » Integer propagators

Domain consistent global cardinality propagator. More...

`#include <gcc.hh>`

## Public Member Functions

virtual Actor * | copy (Space &home)
| Copy propagator during cloning.
virtual PropCost | cost (const Space &home, const ModEventDelta &med) const
| Cost function.
virtual void | reschedule (Space &home)
| Schedule function.
virtual ExecStatus | propagate (Space &home, const ModEventDelta &med)
| Perform propagation.
virtual size_t | dispose (Space &home)
| Destructor.
ModEventDelta | modeventdelta (void) const
| Return the modification event delta.
virtual ExecStatus | advise (Space &home, Advisor &a, const Delta &d)
| Advise function.
virtual void | advise (Space &home, Advisor &a)
| Run advisor a to be run on failure in failed space.
double | afc (void) const
| Return the accumlated failure count.
unsigned int | id (void) const
| Return propagator id.
PropagatorGroup | group (void) const
| Return group propagator belongs to.
void | group (PropagatorGroup g)
| Add propagator to group g.
bool | disabled (void) const
| Whether propagator is currently disabled.
virtual | ~Actor (void)
| To avoid warnings.

## Static Public Member Functions

static ExecStatus | post (Home home, ViewArray< IntView > &x, ViewArray< Card > &k)
| Post propagator for views x and cardinalities k.
static void * | operator new (size_t s, Space &home)
| Allocate memory from space.
static void | operator delete (void *p, Space &home)
| No-op for exceptions.
static void * | operator new (size_t s)
| Not used.
static void | operator delete (void *p)
| Not used.

## Protected Member Functions

| Dom (Space &home, Dom< Card > &p)
| Constructor for cloning p.
| Dom (Home home, ViewArray< IntView > &, ViewArray< Card > &, bool)
| Constructor for posting.
Protected Member Functions inherited from Gecode::Propagator
| Propagator (Home home)
| Constructor for posting.
| Propagator (Space &home, Propagator &p)
| Constructor for cloning p.
Propagator * | fwd (void) const
| Return forwarding pointer during copying.
Kernel::GPI::Info & | gpi (void)
| Provide access to global propagator information.

## Protected Attributes

ViewArray< IntView > | x
| Views on which to perform domain-propagation.
ViewArray< IntView > | y
| Views used to channel information between `x` and `k` ( ).
ViewArray< Card > | k
| Array containing either fixed cardinalities or CardViews.
VarValGraph< Card > * | vvg
| Propagation is performed on a variable-value graph (used as cache).
bool | card_fixed
| Stores whether cardinalities are all assigned.

## Detailed Description

template<class Card>
class Gecode::Int::GCC::Dom< Card >

Domain consistent global cardinality propagator.

The algorithm is taken from: Claude-Guy Quimper, Peter van Beek, Alejandro López-Ortiz, and Alexander Golynski. Improved Algorithms for the Global Cardinality Constraint, CP 2004, pages 542-556.

Requires

#include <gecode/int/gcc.hh>
gcc.hh

Definition at line 219 of file gcc.hh.

## Constructor & Destructor Documentation

## Dom() [1/2]

template<class Card>

Gecode::Int::GCC::Dom< Card >::Dom | ( | Space & | home,
|  | Dom< Card > & | p )

inline protected

Constructor for cloning p.

Definition at line 79 of file dom.hpp.

## Dom() [2/2]

template<class Card>

Gecode::Int::GCC::Dom< Card >::Dom | ( | Home | home,
|  | ViewArray< IntView > & | x0,
|  | ViewArray< Card > & | k0,
|  | bool | cf )

inline protected

Constructor for posting.

Definition at line 67 of file dom.hpp.

## Member Function Documentation

## copy()

template<class Card>

Actor * Gecode::Int::GCC::Dom< Card >::copy | ( | Space & | home | ) |

virtual

Copy propagator during cloning.

Implements Gecode::Actor.

Definition at line 97 of file dom.hpp.

## cost()

template<class Card>

PropCost Gecode::Int::GCC::Dom< Card >::cost | ( | const Space & | home,
|  | const ModEventDelta & | med ) const

virtual

Cost function.

Implements Gecode::Propagator.

Definition at line 103 of file dom.hpp.

## reschedule()

template<class Card>

void Gecode::Int::GCC::Dom< Card >::reschedule | ( | Space & | home | ) |

virtual

Schedule function.

Implements Gecode::Propagator.

Definition at line 109 of file dom.hpp.

## propagate()

template<class Card>

ExecStatus Gecode::Int::GCC::Dom< Card >::propagate | ( | Space & | home,
|  | const ModEventDelta & | med )

virtual

Perform propagation.

Implements Gecode::Propagator.

Definition at line 116 of file dom.hpp.

## dispose()

template<class Card>

size_t Gecode::Int::GCC::Dom< Card >::dispose | ( | Space & | home | ) |

inline virtual

Destructor.

Reimplemented from Gecode::Actor.

Definition at line 88 of file dom.hpp.

## post()

template<class Card>

ExecStatus Gecode::Int::GCC::Dom< Card >::post | ( | Home | home,
|  | ViewArray< IntView > & | x,
|  | ViewArray< Card > & | k )

inline static

Post propagator for views x and cardinalities k.

Definition at line 299 of file dom.hpp.

## Member Data Documentation

## x

template<class Card>

ViewArray<IntView> Gecode::Int::GCC::Dom< Card >::x

protected

Views on which to perform domain-propagation.

Definition at line 222 of file gcc.hh.

## y

template<class Card>

ViewArray<IntView> Gecode::Int::GCC::Dom< Card >::y

protected

Views used to channel information between `x` and `k` ( ).

Definition at line 227 of file gcc.hh.

## k

template<class Card>

ViewArray<Card> Gecode::Int::GCC::Dom< Card >::k

protected

Array containing either fixed cardinalities or CardViews.

Definition at line 229 of file gcc.hh.

## vvg

template<class Card>

VarValGraph<Card>* Gecode::Int::GCC::Dom< Card >::vvg

protected

Propagation is performed on a variable-value graph (used as cache).

Definition at line 231 of file gcc.hh.

## card_fixed

template<class Card>

bool Gecode::Int::GCC::Dom< Card >::card_fixed

protected

Stores whether cardinalities are all assigned.

If all cardinalities are assigned the propagation algorithm only has to perform propagation for the upper bounds.

Definition at line 238 of file gcc.hh.

The documentation for this class was generated from the following files:

- gecode/int/gcc.hh
- gecode/int/gcc/dom.hpp