Generated on Tue Jul 27 2010 21:59:26 for Gecode by doxygen 1.7.1

Gecode::VarImpView< VarImp > Class Template Reference
[Programming views for variables]

Base-class for variable implementation views. More...

#include <view.hpp>

List of all members.

Public Types

typedef VarImp VarImpType
 The variable implementation type corresponding to the view.

Protected Member Functions

 VarImpView (void)
 Default constructor.
 VarImpView (VarImp *y)
 Initialize with variable implementation y.

Protected Attributes

VarImpx
 Pointer to variable implementation.

Generic view information



static bool varderived (void)
 Return whether this view is derived from a VarImpView.
VarImpvarimp (void) const
 Return variable implementation of view.
unsigned int degree (void) const
 Return degree (number of subscribed propagators and advisors).
double afc (void) const
 Return accumulated failure count (plus degree).

View-dependent propagator support



static void schedule (Space &home, Propagator &p, ModEvent me)
 Schedule propagator p with modification event me.
static ModEvent me (const ModEventDelta &med)
 Return modification event for view type in med.
static ModEventDelta med (ModEvent me)
 Translate modification event me to modification event delta for view.

Delta information for advisors



static ModEvent modevent (const Delta &d)
 Return modification event.

Domain tests



bool assigned (void) const
 Test whether view is assigned.

Dependencies



void subscribe (Space &home, Propagator &p, PropCond pc, bool schedule=true)
 Subscribe propagator p with propagation condition pc to view.
void cancel (Space &home, Propagator &p, PropCond pc)
 Cancel subscription of propagator p with propagation condition pc to view.
void subscribe (Space &home, Advisor &a)
 Subscribe advisor a to view.
void cancel (Space &home, Advisor &a)
 Cancel subscription of advisor a.

Cloning



void update (Space &home, bool share, VarImpView< VarImp > &y)
 Update this view to be a clone of view y.

View comparison



template<class VarImpA , class VarImpB >
bool same (const VarImpView< VarImpA > &x, const VarImpView< VarImpB > &y)
 Test whether views x and y are the same.
template<class ViewA , class ViewB >
bool before (const ViewA &x, const ViewB &y)
 Test whether view x comes before y (arbitrary order).

Detailed Description

template<class VarImp>
class Gecode::VarImpView< VarImp >

Base-class for variable implementation views.

Definition at line 115 of file view.hpp.


Member Typedef Documentation

template<class VarImp>
typedef VarImp Gecode::VarImpView< VarImp >::VarImpType

The variable implementation type corresponding to the view.

Definition at line 125 of file view.hpp.


Constructor & Destructor Documentation

template<class VarImp >
Gecode::VarImpView< VarImp >::VarImpView ( void   )  [inline, protected]

Default constructor.

Definition at line 411 of file view.hpp.

template<class VarImp>
Gecode::VarImpView< VarImp >::VarImpView ( VarImp y  )  [inline, protected]

Initialize with variable implementation y.

Definition at line 415 of file view.hpp.


Member Function Documentation

template<class VarImp >
bool Gecode::VarImpView< VarImp >::varderived ( void   )  [inline, static]

Return whether this view is derived from a VarImpView.

Definition at line 419 of file view.hpp.

template<class VarImp >
VarImp * Gecode::VarImpView< VarImp >::varimp ( void   )  const [inline]

Return variable implementation of view.

Definition at line 424 of file view.hpp.

template<class VarImp >
unsigned int Gecode::VarImpView< VarImp >::degree ( void   )  const [inline]

Return degree (number of subscribed propagators and advisors).

Definition at line 429 of file view.hpp.

template<class VarImp >
double Gecode::VarImpView< VarImp >::afc ( void   )  const [inline]

Return accumulated failure count (plus degree).

Definition at line 434 of file view.hpp.

template<class VarImp >
bool Gecode::VarImpView< VarImp >::assigned ( void   )  const [inline]

Test whether view is assigned.

Definition at line 439 of file view.hpp.

template<class VarImp >
void Gecode::VarImpView< VarImp >::schedule ( Space home,
Propagator p,
ModEvent  me 
) [inline, static]

Schedule propagator p with modification event me.

Definition at line 465 of file view.hpp.

template<class VarImp >
ModEvent Gecode::VarImpView< VarImp >::me ( const ModEventDelta med  )  [inline, static]

Return modification event for view type in med.

Definition at line 470 of file view.hpp.

template<class VarImp >
ModEventDelta Gecode::VarImpView< VarImp >::med ( ModEvent  me  )  [inline, static]

Translate modification event me to modification event delta for view.

Reimplemented in Gecode::Int::IntView, and Gecode::Int::BoolView.

Definition at line 475 of file view.hpp.

template<class VarImp >
void Gecode::VarImpView< VarImp >::subscribe ( Space home,
Propagator p,
PropCond  pc,
bool  schedule = true 
) [inline]

Subscribe propagator p with propagation condition pc to view.

In case schedule is false, the propagator is just subscribed but not scheduled for execution (this must be used when creating subscriptions during propagation).

Definition at line 444 of file view.hpp.

template<class VarImp >
void Gecode::VarImpView< VarImp >::cancel ( Space home,
Propagator p,
PropCond  pc 
) [inline]

Cancel subscription of propagator p with propagation condition pc to view.

Definition at line 450 of file view.hpp.

template<class VarImp >
void Gecode::VarImpView< VarImp >::subscribe ( Space home,
Advisor a 
) [inline]

Subscribe advisor a to view.

Definition at line 455 of file view.hpp.

template<class VarImp >
void Gecode::VarImpView< VarImp >::cancel ( Space home,
Advisor a 
) [inline]

Cancel subscription of advisor a.

Definition at line 460 of file view.hpp.

template<class VarImp >
ModEvent Gecode::VarImpView< VarImp >::modevent ( const Delta d  )  [inline, static]

Return modification event.

Reimplemented in Gecode::Set::SetView.

Definition at line 480 of file view.hpp.

template<class VarImp>
void Gecode::VarImpView< VarImp >::update ( Space home,
bool  share,
VarImpView< VarImp > &  y 
) [inline]

Update this view to be a clone of view y.

Definition at line 485 of file view.hpp.


Friends And Related Function Documentation

template<class VarImpA , class VarImpB >
bool same ( const VarImpView< VarImpA > &  x,
const VarImpView< VarImpB > &  y 
) [related]

Test whether views x and y are the same.

template<class ViewA , class ViewB >
bool before ( const ViewA &  x,
const ViewB &  y 
) [related]

Test whether view x comes before y (arbitrary order).

Definition at line 641 of file view.hpp.


Member Data Documentation

template<class VarImp>
VarImp* Gecode::VarImpView< VarImp >::x [protected]

Pointer to variable implementation.

Definition at line 118 of file view.hpp.


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