Generated on Tue Jan 28 2020 00:00:00 for Gecode by doxygen 1.8.17
Gecode::VarImpView< Var > Class Template Reference

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

#include <view.hpp>

Public Types

typedef Var VarType
 The variable type corresponding to the view. More...
 
typedef Var::VarImpType VarImpType
 The variable implementation type corresponding to the view. More...
 

Protected Member Functions

 VarImpView (void)
 Default constructor. More...
 
 VarImpView (VarImpType *y)
 Initialize with variable implementation y. More...
 
void varimp (VarImpType *y)
 Set variable implementation to y. More...
 

Protected Attributes

VarImpTypex
 Pointer to variable implementation. More...
 

View comparison

template<class VarA , class VarB >
bool same (const VarImpView< VarA > &x, const VarImpView< VarB > &y)
 Test whether views x and y are the same. More...
 
template<class ViewA , class ViewB >
bool before (const ViewA &x, const ViewB &y)
 Test whether view x comes before y (arbitrary order) More...
 
template<class ViewA , class ViewB >
bool shared (const ConstView< ViewA > &, const ConstView< ViewB > &)
 Test whether views share same variable. More...
 
template<class Var , class View >
bool shared (const VarImpView< Var > &, const ConstView< View > &)
 Test whether views share same variable. More...
 
template<class ViewA , class ViewB >
bool shared (const DerivedView< ViewA > &, const ConstView< ViewB > &)
 Test whether views share same variable. More...
 
template<class View , class Var >
bool shared (const ConstView< View > &, const VarImpView< Var > &)
 Test whether views share same variable. More...
 
template<class ViewA , class ViewB >
bool shared (const ConstView< ViewA > &, const DerivedView< ViewB > &)
 Test whether views share same variable. More...
 
template<class VarA , class VarB >
bool shared (const VarImpView< VarA > &, const VarImpView< VarB > &)
 Test whether views share same variable. More...
 
template<class Var , class View >
bool shared (const VarImpView< Var > &, const DerivedView< View > &)
 Test whether views share same variable. More...
 
template<class View , class Var >
bool shared (const DerivedView< View > &, const VarImpView< Var > &)
 Test whether views share same variable. More...
 
template<class ViewA , class ViewB >
bool shared (const DerivedView< ViewA > &, const DerivedView< ViewB > &)
 Test whether views share same variable. More...
 
template<class ViewA , class ViewB >
bool same (const ConstView< ViewA > &, const ConstView< ViewB > &)
 Test whether two views are the same. More...
 
template<class Var , class View >
bool same (const VarImpView< Var > &, const ConstView< View > &)
 Test whether two views are the same. More...
 
template<class ViewA , class ViewB >
bool same (const ConstView< ViewA > &, const DerivedView< ViewB > &)
 Test whether two views are the same. More...
 
template<class Var , class View >
bool same (const VarImpView< Var > &, const DerivedView< View > &)
 Test whether two views are the same. More...
 
template<class View , class Var >
bool same (const DerivedView< View > &, const VarImpView< Var > &)
 Test whether two views are the same. More...
 
template<class Var >
bool same (const VarImpView< Var > &x, const VarImpView< Var > &y)
 Test whether two views are the same. More...
 
template<class ViewA , class ViewB >
bool same (const DerivedView< ViewA > &x, const DerivedView< ViewB > &y)
 Test whether two views are the same. More...
 

Generic view information

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

Domain tests

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

View-dependent propagator support

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

Dependencies

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

Delta information for advisors

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

Cloning

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

Detailed Description

template<class Var>
class Gecode::VarImpView< Var >

Base-class for variable implementation views.

Definition at line 123 of file view.hpp.

Member Typedef Documentation

◆ VarType

template<class Var >
typedef Var Gecode::VarImpView< Var >::VarType

The variable type corresponding to the view.

Definition at line 126 of file view.hpp.

◆ VarImpType

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

The variable implementation type corresponding to the view.

Definition at line 128 of file view.hpp.

Constructor & Destructor Documentation

◆ VarImpView() [1/2]

template<class Var >
Gecode::VarImpView< Var >::VarImpView ( void  )
protected

Default constructor.

◆ VarImpView() [2/2]

template<class Var >
Gecode::VarImpView< Var >::VarImpView ( VarImpType y)
protected

Initialize with variable implementation y.

Member Function Documentation

◆ varimp() [1/2]

template<class Var >
void Gecode::VarImpView< Var >::varimp ( VarImpType y)
protected

Set variable implementation to y.

◆ varderived()

template<class Var >
static bool Gecode::VarImpView< Var >::varderived ( void  )
static

Return whether this view is derived from a VarImpView.

◆ varimp() [2/2]

template<class Var >
VarImpType* Gecode::VarImpView< Var >::varimp ( void  ) const

Return variable implementation of view.

◆ degree()

template<class Var >
unsigned int Gecode::VarImpView< Var >::degree ( void  ) const

Return degree (number of subscribed propagators and advisors)

◆ afc()

template<class Var >
double Gecode::VarImpView< Var >::afc ( void  ) const

Return accumulated failure count.

◆ assigned()

template<class Var >
bool Gecode::VarImpView< Var >::assigned ( void  ) const

Test whether view is assigned.

◆ schedule()

template<class Var >
static void Gecode::VarImpView< Var >::schedule ( Space home,
Propagator p,
ModEvent  me 
)
static

Schedule propagator p with modification event me.

◆ me()

template<class Var >
static ModEvent Gecode::VarImpView< Var >::me ( const ModEventDelta med)
static

Return modification event for view type in med.

◆ med()

template<class Var >
static ModEventDelta Gecode::VarImpView< Var >::med ( ModEvent  me)
static

Translate modification event me to modification event delta for view.

◆ subscribe() [1/2]

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

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).

◆ cancel() [1/2]

template<class Var >
void Gecode::VarImpView< Var >::cancel ( Space home,
Propagator p,
PropCond  pc 
)

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

◆ reschedule()

template<class Var >
void Gecode::VarImpView< Var >::reschedule ( Space home,
Propagator p,
PropCond  pc 
)

Re-schedule propagator p with propagation condition pc.

◆ subscribe() [2/2]

template<class Var >
void Gecode::VarImpView< Var >::subscribe ( Space home,
Advisor a,
bool  fail = false 
)

Subscribe advisor a to view.

If fail is true, run the advisor also on failure. This feature is undocumented.

◆ cancel() [2/2]

template<class Var >
void Gecode::VarImpView< Var >::cancel ( Space home,
Advisor a,
bool  fail = false 
)

Cancel subscription of advisor a.

◆ modevent()

template<class Var >
static ModEvent Gecode::VarImpView< Var >::modevent ( const Delta d)
static

Return modification event.

◆ update()

template<class Var >
void Gecode::VarImpView< Var >::update ( Space home,
bool  share,
VarImpView< Var > &  y 
)

Update this view to be a clone of view y.

Friends And Related Function Documentation

◆ same() [1/8]

template<class VarA , class VarB >
bool same ( const VarImpView< VarA > &  x,
const VarImpView< VarB > &  y 
)
related

Test whether views x and y are the same.

◆ before()

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

Test whether view x comes before y (arbitrary order)

◆ same() [2/8]

template<class ViewA , class ViewB >
bool same ( const ConstView< ViewA > &  ,
const ConstView< ViewB > &   
)
related

Test whether two views are the same.

Definition at line 643 of file view.hpp.

◆ same() [3/8]

template<class Var , class View >
bool same ( const VarImpView< Var > &  ,
const ConstView< View > &   
)
related

Test whether two views are the same.

Definition at line 649 of file view.hpp.

◆ same() [4/8]

template<class ViewA , class ViewB >
bool same ( const ConstView< ViewA > &  ,
const DerivedView< ViewB > &   
)
related

Test whether two views are the same.

Definition at line 655 of file view.hpp.

◆ same() [5/8]

template<class Var , class View >
bool same ( const VarImpView< Var > &  ,
const DerivedView< View > &   
)
related

Test whether two views are the same.

Definition at line 661 of file view.hpp.

◆ same() [6/8]

template<class View , class Var >
bool same ( const DerivedView< View > &  ,
const VarImpView< Var > &   
)
related

Test whether two views are the same.

Definition at line 667 of file view.hpp.

◆ same() [7/8]

template<class Var >
bool same ( const VarImpView< Var > &  x,
const VarImpView< Var > &  y 
)
related

Test whether two views are the same.

Definition at line 673 of file view.hpp.

◆ same() [8/8]

template<class ViewA , class ViewB >
bool same ( const DerivedView< ViewA > &  x,
const DerivedView< ViewB > &  y 
)
related

Test whether two views are the same.

Definition at line 679 of file view.hpp.

Member Data Documentation

◆ x

template<class Var >
VarImpType* Gecode::VarImpView< Var >::x
protected

Pointer to variable implementation.

Definition at line 131 of file view.hpp.


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