Generated on for Gecode by doxygen 1.15.0
Gecode::Int::Extensional::SparseInc< View, pos > Class Template Reference

Public Member Functions

 SparseInc (Home home, ViewArray< View > &x0, const TupleSet &ts0)
 SparseInc (Space &home, SparseInc< View, pos > &p)
virtual Actorcopy (Space &home)
 Create copy.
virtual PropCost cost (const Space &, const ModEventDelta &) const
 Cost function.
virtual void reschedule (Space &home)
 Schedule function.
virtual size_t dispose (Space &home)
 Delete actor and return its size.
virtual ExecStatus propagate (Space &home, const ModEventDelta &)
 Propagation function.
virtual ExecStatus advise (Space &home, Advisor &a0, const Delta &d)
 Advise function.
ModEventDelta modeventdelta (void) const
 Return the modification event delta.
virtual void advise (Space &home, Advisor &a)
 Run advisor a to be run on failure in failed space.
double afc (void) const
 Return the accumulated 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, const TupleSet &ts)
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 Types

typedef Extensional::SparseAdvisor< ViewSparseAdvisor
typedef SparseTupleState< SparseInc< View, pos >, ViewState

Protected Member Functions

void enqueue_zero (unsigned int gid)
void init_gid_maps (void)
void init_support_counts (void)
void deactivate_tuple (unsigned int tid)
bool support_active (unsigned int gid) const
ExecStatus process_zero_queue (Space &home)
bool atmostone (void) const
void deactivate_for_all_domains (const ViewArray< View > &x)
void deactivate_for_domain (int variable, const View &view)
void deactivate_removed_values (int variable, const View &view, const Delta &delta)
bool remove_tuple (unsigned int tid)
const unsigned int * tuple_gids (unsigned int tid) const
Protected Member Functions inherited from Gecode::Propagator
 Propagator (Home home)
 Constructor for posting.
 Propagator (Space &home, Propagator &p)
 Constructor for cloning p.
Propagatorfwd (void) const
 Return forwarding pointer during copying.
Kernel::GPI::Infogpi (void)
 Provide access to global propagator information.
Protected Member Functions inherited from Gecode::Int::Extensional::SparseTupleState< SparseInc< View, pos >, View >
SparseInc< View, pos > & derived (void)
const unsigned int * tuple_gids (unsigned int tid) const
unsigned int tuple_gid (unsigned int tid, int variable) const
bool remove_tuple (unsigned int tid)
void deactivate_value_support (int variable, int value)
void deactivate_for_domain (int variable, const View &view)
void deactivate_removed_values (int variable, const View &view, const Delta &delta)
void deactivate_for_all_domains (const ViewArray< View > &x)
 SparseTupleState (Home home, ViewArray< View > &x, const TupleSet &ts0)
 SparseTupleState (Space &home, const SparseTupleState &state)

Protected Attributes

ViewArray< Viewx
Council< SparseAdvisorc
unsigned int * support_count
int * gid_var
unsigned int * zero_queue
unsigned int zero_queue_size
unsigned char * queued
bool in_propagate
unsigned int active_limit
int arity
int * gid_val
unsigned int n_tuples
unsigned int n_vals
TupleSet ts
const unsigned int * tv
Protected Attributes inherited from Gecode::Int::Extensional::SparseTupleState< SparseInc< View, pos >, View >
TupleSet ts
int arity
unsigned int n_tuples
unsigned int n_vals
unsigned int * active_ids
unsigned int * pos_in_active
unsigned int active_limit
int * gid_val
const unsigned int * tv

Detailed Description

template<class View, bool pos>
class Gecode::Int::Extensional::SparseInc< View, pos >

Definition at line 319 of file extensional-tuple-set.cpp.

Member Typedef Documentation

◆ SparseAdvisor

template<class View, bool pos>
typedef Extensional::SparseAdvisor<View> Gecode::Int::Extensional::SparseInc< View, pos >::SparseAdvisor
protected

Definition at line 323 of file extensional-tuple-set.cpp.

◆ State

template<class View, bool pos>
typedef SparseTupleState<SparseInc<View,pos>,View> Gecode::Int::Extensional::SparseInc< View, pos >::State
protected

Definition at line 324 of file extensional-tuple-set.cpp.

Constructor & Destructor Documentation

◆ SparseInc() [1/2]

template<class View, bool pos>
Gecode::Int::Extensional::SparseInc< View, pos >::SparseInc ( Home home,
ViewArray< View > & x0,
const TupleSet & ts0 )
inline

Definition at line 499 of file extensional-tuple-set.cpp.

◆ SparseInc() [2/2]

template<class View, bool pos>
Gecode::Int::Extensional::SparseInc< View, pos >::SparseInc ( Space & home,
SparseInc< View, pos > & p )
inline

Definition at line 521 of file extensional-tuple-set.cpp.

Member Function Documentation

◆ enqueue_zero()

template<class View, bool pos>
void Gecode::Int::Extensional::SparseInc< View, pos >::enqueue_zero ( unsigned int gid)
inlineprotected

Definition at line 349 of file extensional-tuple-set.cpp.

◆ init_gid_maps()

template<class View, bool pos>
void Gecode::Int::Extensional::SparseInc< View, pos >::init_gid_maps ( void )
inlineprotected

Definition at line 357 of file extensional-tuple-set.cpp.

◆ init_support_counts()

template<class View, bool pos>
void Gecode::Int::Extensional::SparseInc< View, pos >::init_support_counts ( void )
inlineprotected

Definition at line 379 of file extensional-tuple-set.cpp.

◆ deactivate_tuple()

template<class View, bool pos>
void Gecode::Int::Extensional::SparseInc< View, pos >::deactivate_tuple ( unsigned int tid)
inlineprotected

Definition at line 400 of file extensional-tuple-set.cpp.

◆ support_active()

template<class View, bool pos>
bool Gecode::Int::Extensional::SparseInc< View, pos >::support_active ( unsigned int gid) const
inlineprotected

Definition at line 416 of file extensional-tuple-set.cpp.

◆ process_zero_queue()

template<class View, bool pos>
ExecStatus Gecode::Int::Extensional::SparseInc< View, pos >::process_zero_queue ( Space & home)
inlineprotected

Definition at line 422 of file extensional-tuple-set.cpp.

◆ atmostone()

template<class View, bool pos>
bool Gecode::Int::Extensional::SparseInc< View, pos >::atmostone ( void ) const
inlineprotected

Definition at line 490 of file extensional-tuple-set.cpp.

◆ post()

template<class View, bool pos>
ExecStatus Gecode::Int::Extensional::SparseInc< View, pos >::post ( Home home,
ViewArray< View > & x,
const TupleSet & ts )
inlinestatic

Definition at line 541 of file extensional-tuple-set.cpp.

◆ copy()

template<class View, bool pos>
virtual Actor * Gecode::Int::Extensional::SparseInc< View, pos >::copy ( Space & home)
inlinevirtual

Create copy.

Implements Gecode::Actor.

Definition at line 597 of file extensional-tuple-set.cpp.

◆ cost()

template<class View, bool pos>
virtual PropCost Gecode::Int::Extensional::SparseInc< View, pos >::cost ( const Space & home,
const ModEventDelta & med ) const
inlinevirtual

Cost function.

Implements Gecode::Propagator.

Definition at line 602 of file extensional-tuple-set.cpp.

◆ reschedule()

template<class View, bool pos>
virtual void Gecode::Int::Extensional::SparseInc< View, pos >::reschedule ( Space & home)
inlinevirtual

Schedule function.

The function is executed when a propagator is enabled again. Note that a propagator should be scheduled with the right modification event delta and should only be scheduled if it is legal to execute the propagator.

Implements Gecode::Propagator.

Definition at line 607 of file extensional-tuple-set.cpp.

◆ dispose()

template<class View, bool pos>
virtual size_t Gecode::Int::Extensional::SparseInc< View, pos >::dispose ( Space & home)
inlinevirtual

Delete actor and return its size.

Reimplemented from Gecode::Actor.

Definition at line 612 of file extensional-tuple-set.cpp.

◆ propagate()

template<class View, bool pos>
virtual ExecStatus Gecode::Int::Extensional::SparseInc< View, pos >::propagate ( Space & home,
const ModEventDelta & med )
inlinevirtual

Propagation function.

The propagation function must return an execution status as follows:

  • ES_FAILED: the propagator has detected failure
  • ES_NOFIX: the propagator has done propagation
  • ES_FIX: the propagator has done propagation and has computed a fixpoint. That is, running the propagator immediately again will do nothing.

Apart from the above values, a propagator can return the result from calling one of the functions defined by a space:

  • ES_SUBSUMED: the propagator is subsumed and has been already deleted.
  • ES_NOFIX_PARTIAL: the propagator has consumed some of its propagation events.
  • ES_FIX_PARTIAL: the propagator has consumed some of its propagation events and with respect to these events is at fixpoint For more details, see the individual functions.

Implements Gecode::Propagator.

Definition at line 621 of file extensional-tuple-set.cpp.

◆ advise()

template<class View, bool pos>
virtual ExecStatus Gecode::Int::Extensional::SparseInc< View, pos >::advise ( Space & home,
Advisor & a,
const Delta & d )
inlinevirtual

Advise function.

The advisor is passed as argument a.

A propagator must specialize this advise function, if it uses advisors. The advise function must return an execution status as follows:

  • ES_FAILED: the advisor has detected failure.
  • ES_FIX: the advisor's propagator (that is, this propagator) does not need to be run.
  • ES_NOFIX: the advisor's propagator (that is, this propagator) must be run.
  • ES_NOFIX_FORCE: the advisor's propagator (that is, this propagator) must be run and it must forcefully be rescheduled (including recomputation of cost).

Apart from the above values, an advisor can return the result from calling the function defined by a space:

  • ES_FIX_DISPOSE: the advisor's propagator does not need to be run and the advisor will be disposed.
  • ES_NOFIX_DISPOSE: the advisor's propagator must be run and the advisor will be disposed.
  • ES_NOFIX_FORCE_DISPOSE: the advisor's propagator must be run , it must forcefully be rescheduled (including recomputation of cost), and the adviser will be disposed. For more details, see the function documentation.

The delta d describes how the variable has been changed by an operation on the advisor's variable. Typically, the delta information can only be utilized by either static or member functions of views as the actual delta information is both domain and view dependent.

Reimplemented from Gecode::Propagator.

Definition at line 697 of file extensional-tuple-set.cpp.

◆ deactivate_for_all_domains()

template<class View, bool pos>
void Gecode::Int::Extensional::SparseTupleState< SparseInc< View, pos >, View >::deactivate_for_all_domains ( const ViewArray< View > & x)
inlineprotected

Definition at line 250 of file extensional-tuple-set.cpp.

◆ deactivate_for_domain()

template<class View, bool pos>
void Gecode::Int::Extensional::SparseTupleState< SparseInc< View, pos >, View >::deactivate_for_domain ( int variable,
const View & view )
inlineprotected

Definition at line 212 of file extensional-tuple-set.cpp.

◆ deactivate_removed_values()

template<class View, bool pos>
void Gecode::Int::Extensional::SparseTupleState< SparseInc< View, pos >, View >::deactivate_removed_values ( int variable,
const View & view,
const Delta & delta )
inlineprotected

Definition at line 225 of file extensional-tuple-set.cpp.

◆ remove_tuple()

template<class View, bool pos>
bool Gecode::Int::Extensional::SparseTupleState< SparseInc< View, pos >, View >::remove_tuple ( unsigned int tid)
inlineprotected

Definition at line 184 of file extensional-tuple-set.cpp.

◆ tuple_gids()

template<class View, bool pos>
const unsigned int * Gecode::Int::Extensional::SparseTupleState< SparseInc< View, pos >, View >::tuple_gids ( unsigned int tid) const
inlineprotected

Definition at line 169 of file extensional-tuple-set.cpp.

Member Data Documentation

◆ x

template<class View, bool pos>
ViewArray<View> Gecode::Int::Extensional::SparseInc< View, pos >::x
protected

Definition at line 339 of file extensional-tuple-set.cpp.

◆ c

template<class View, bool pos>
Council<SparseAdvisor> Gecode::Int::Extensional::SparseInc< View, pos >::c
protected

Definition at line 340 of file extensional-tuple-set.cpp.

◆ support_count

template<class View, bool pos>
unsigned int* Gecode::Int::Extensional::SparseInc< View, pos >::support_count
protected

Definition at line 341 of file extensional-tuple-set.cpp.

◆ gid_var

template<class View, bool pos>
int* Gecode::Int::Extensional::SparseInc< View, pos >::gid_var
protected

Definition at line 342 of file extensional-tuple-set.cpp.

◆ zero_queue

template<class View, bool pos>
unsigned int* Gecode::Int::Extensional::SparseInc< View, pos >::zero_queue
protected

Definition at line 343 of file extensional-tuple-set.cpp.

◆ zero_queue_size

template<class View, bool pos>
unsigned int Gecode::Int::Extensional::SparseInc< View, pos >::zero_queue_size
protected

Definition at line 344 of file extensional-tuple-set.cpp.

◆ queued

template<class View, bool pos>
unsigned char* Gecode::Int::Extensional::SparseInc< View, pos >::queued
protected

Definition at line 345 of file extensional-tuple-set.cpp.

◆ in_propagate

template<class View, bool pos>
bool Gecode::Int::Extensional::SparseInc< View, pos >::in_propagate
protected

Definition at line 346 of file extensional-tuple-set.cpp.

◆ active_limit

template<class View, bool pos>
unsigned int Gecode::Int::Extensional::SparseTupleState< SparseInc< View, pos >, View >::active_limit
protected

Definition at line 159 of file extensional-tuple-set.cpp.

◆ arity

template<class View, bool pos>
int Gecode::Int::Extensional::SparseTupleState< SparseInc< View, pos >, View >::arity
protected

Definition at line 154 of file extensional-tuple-set.cpp.

◆ gid_val

template<class View, bool pos>
int* Gecode::Int::Extensional::SparseTupleState< SparseInc< View, pos >, View >::gid_val
protected

Definition at line 160 of file extensional-tuple-set.cpp.

◆ n_tuples

template<class View, bool pos>
unsigned int Gecode::Int::Extensional::SparseTupleState< SparseInc< View, pos >, View >::n_tuples
protected

Definition at line 155 of file extensional-tuple-set.cpp.

◆ n_vals

template<class View, bool pos>
unsigned int Gecode::Int::Extensional::SparseTupleState< SparseInc< View, pos >, View >::n_vals
protected

Definition at line 156 of file extensional-tuple-set.cpp.

◆ ts

template<class View, bool pos>
TupleSet Gecode::Int::Extensional::SparseTupleState< SparseInc< View, pos >, View >::ts
protected

Definition at line 153 of file extensional-tuple-set.cpp.

◆ tv

template<class View, bool pos>
const unsigned int* Gecode::Int::Extensional::SparseTupleState< SparseInc< View, pos >, View >::tv
protected

Definition at line 161 of file extensional-tuple-set.cpp.


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