Gecode::Int::Sorted::Sorted< View, Perm > Class Template Reference
Other available functionality » Integer propagators

Bounds consistent sortedness propagator. More...

`#include <sorted.hh>`

## Public Member Functions

virtual size_t | dispose (Space &home)
| Delete propagator and return its size.
virtual Actor * | copy (Space &home)
| Copy propagator during cloning.
virtual PropCost | cost (const Space &home, const ModEventDelta &med) const
| Cost function returning low linear.
virtual void | reschedule (Space &home)
| Schedule function.
virtual ExecStatus | propagate (Space &home, const ModEventDelta &med)
| Perform propagation.
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< View > &x, ViewArray< View > &y, ViewArray< View > &z)
| Post propagator for views x, y, and z.
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

| Sorted (Home home, ViewArray< View > &x, ViewArray< View > &y, ViewArray< View > &z)
| Constructor for posting.
| Sorted (Space &home, Sorted< View, Perm > &p)
| Constructor for cloning.
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< View > | x
| Views to be sorted.
ViewArray< View > | y
| Views denoting the sorted version of x.
ViewArray< View > | z
| Permutation variables (none, if Perm is false).
ViewArray< View > | w
| Original y array.
int | reachable
| connection to dropped view

## Detailed Description

template<class View, bool Perm>
class Gecode::Int::Sorted::Sorted< View, Perm >

Bounds consistent sortedness propagator.

The algorithm is taken from: Sven Thiel, Efficient Algorithms for Constraint Propagation and for Processing Tree Descriptions, PhD thesis, Universität des Saarlandes, Germany, 2004, pages 39-59.

Requires

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

Definition at line 59 of file sorted.hh.

## Constructor & Destructor Documentation

## Sorted() [1/2]

template<class View, bool Perm>

Gecode::Int::Sorted::Sorted< View, Perm >::Sorted | ( | Home | home,
|  | ViewArray< View > & | x,
|  | ViewArray< View > & | y,
|  | ViewArray< View > & | z )

protected

Constructor for posting.

Definition at line 349 of file propagate.hpp.

## Sorted() [2/2]

template<class View, bool Perm>

Gecode::Int::Sorted::Sorted< View, Perm >::Sorted | ( | Space & | home,
|  | Sorted< View, Perm > & | p )

inline protected

Constructor for cloning.

Definition at line 338 of file propagate.hpp.

## Member Function Documentation

## dispose()

template<class View, bool Perm>

size_t Gecode::Int::Sorted::Sorted< View, Perm >::dispose | ( | Space & | home | ) |

inline virtual

Delete propagator and return its size.

Reimplemented from Gecode::Actor.

Definition at line 361 of file propagate.hpp.

## copy()

template<class View, bool Perm>

Actor * Gecode::Int::Sorted::Sorted< View, Perm >::copy | ( | Space & | home | ) |

virtual

Copy propagator during cloning.

Implements Gecode::Actor.

Definition at line 371 of file propagate.hpp.

## cost()

template<class View, bool Perm>

PropCost Gecode::Int::Sorted::Sorted< View, Perm >::cost | ( | const Space & | home,
|  | const ModEventDelta & | med ) const

virtual

Cost function returning low linear.

Implements Gecode::Propagator.

Definition at line 376 of file propagate.hpp.

## reschedule()

template<class View, bool Perm>

void Gecode::Int::Sorted::Sorted< View, Perm >::reschedule | ( | Space & | home | ) |

virtual

Schedule function.

Implements Gecode::Propagator.

Definition at line 382 of file propagate.hpp.

## propagate()

template<class View, bool Perm>

ExecStatus Gecode::Int::Sorted::Sorted< View, Perm >::propagate | ( | Space & | home,
|  | const ModEventDelta & | med )

virtual

Perform propagation.

Implements Gecode::Propagator.

Definition at line 391 of file propagate.hpp.

## post()

template<class View, bool Perm>

ExecStatus Gecode::Int::Sorted::Sorted< View, Perm >::post | ( | Home | home,
|  | ViewArray< View > & | x,
|  | ViewArray< View > & | y,
|  | ViewArray< View > & | z )

static

Post propagator for views x, y, and z.

Definition at line 628 of file propagate.hpp.

## Member Data Documentation

## x

template<class View, bool Perm>

ViewArray<View> Gecode::Int::Sorted::Sorted< View, Perm >::x

protected

Views to be sorted.

Definition at line 62 of file sorted.hh.

## y

template<class View, bool Perm>

ViewArray<View> Gecode::Int::Sorted::Sorted< View, Perm >::y

protected

Views denoting the sorted version of x.

Definition at line 64 of file sorted.hh.

## z

template<class View, bool Perm>

ViewArray<View> Gecode::Int::Sorted::Sorted< View, Perm >::z

protected

Permutation variables (none, if Perm is false).

Definition at line 66 of file sorted.hh.

## w

template<class View, bool Perm>

ViewArray<View> Gecode::Int::Sorted::Sorted< View, Perm >::w

protected

Original y array.

Definition at line 68 of file sorted.hh.

## reachable

template<class View, bool Perm>

int Gecode::Int::Sorted::Sorted< View, Perm >::reachable

protected

connection to dropped view

Definition at line 70 of file sorted.hh.

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

- gecode/int/sorted.hh
- gecode/int/sorted/propagate.hpp