Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0

Propagator for weight of a set More...

#include <int.hh>

Public Member Functions

virtual Actorcopy (Space &home)
 Copy propagator during cloning.
 
virtual PropCost cost (const Space &home, const ModEventDelta &med) const
 Cost function (defined as PC_LINEAR_LO)
 
virtual void reschedule (Space &home)
 Schedule function.
 
virtual size_t dispose (Space &home)
 Delete propagator and return its size.
 
virtual ExecStatus propagate (Space &home, const ModEventDelta &med)
 Perform propagation.
 
- Public Member Functions inherited from Gecode::Propagator
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.
 
- Public Member Functions inherited from Gecode::Actor
virtual ~Actor (void)
 To avoid warnings.
 

Static Public Member Functions

static ExecStatus post (Home home, const SharedArray< int > &elements, const SharedArray< int > &weights, View x, Gecode::Int::IntView y)
 Post propagator for $\sum_{i\in x} weights_i = y $.
 
- Static Public Member Functions inherited from Gecode::Actor
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

 Weights (Space &home, Weights &p)
 Constructor for cloning p.
 
 Weights (Home home, const SharedArray< int > &, const SharedArray< int > &, View, Gecode::Int::IntView)
 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.
 
Propagatorfwd (void) const
 Return forwarding pointer during copying.
 
Kernel::GPI::Infogpi (void)
 Provide access to global propagator information.
 

Protected Attributes

SharedArray< int > elements
 List of elements in the upper bound.
 
SharedArray< int > weights
 Weights for the elements in the upper bound.
 
View x
 The set view.
 
Gecode::Int::IntView y
 The integer view.
 

Detailed Description

template<class View>
class Gecode::Set::Int::Weights< View >

Propagator for weight of a set

Requires

Definition at line 257 of file int.hh.

Constructor & Destructor Documentation

◆ Weights() [1/2]

template<class View >
Gecode::Set::Int::Weights< View >::Weights ( Space & home,
Weights< View > & p )
inlineprotected

Constructor for cloning p.

Definition at line 159 of file weights.hpp.

◆ Weights() [2/2]

template<class View >
Gecode::Set::Int::Weights< View >::Weights ( Home home,
const SharedArray< int > & elements0,
const SharedArray< int > & weights0,
View x0,
Gecode::Int::IntView y0 )
inlineprotected

Constructor for posting.

Definition at line 146 of file weights.hpp.

Member Function Documentation

◆ copy()

template<class View >
Actor * Gecode::Set::Int::Weights< View >::copy ( Space & home)
virtual

Copy propagator during cloning.

Implements Gecode::Actor.

Definition at line 210 of file weights.hpp.

◆ cost()

template<class View >
PropCost Gecode::Set::Int::Weights< View >::cost ( const Space & home,
const ModEventDelta & med ) const
virtual

Cost function (defined as PC_LINEAR_LO)

Implements Gecode::Propagator.

Definition at line 185 of file weights.hpp.

◆ reschedule()

template<class View >
void Gecode::Set::Int::Weights< View >::reschedule ( Space & home)
virtual

Schedule function.

Implements Gecode::Propagator.

Definition at line 191 of file weights.hpp.

◆ dispose()

template<class View >
size_t Gecode::Set::Int::Weights< View >::dispose ( Space & home)
inlinevirtual

Delete propagator and return its size.

Reimplemented from Gecode::Actor.

Definition at line 198 of file weights.hpp.

◆ propagate()

template<class View >
ExecStatus Gecode::Set::Int::Weights< View >::propagate ( Space & home,
const ModEventDelta & med )
virtual

Perform propagation.

Implements Gecode::Propagator.

Definition at line 247 of file weights.hpp.

◆ post()

template<class View >
ExecStatus Gecode::Set::Int::Weights< View >::post ( Home home,
const SharedArray< int > & elements,
const SharedArray< int > & weights,
View x,
Gecode::Int::IntView y )
inlinestatic

Post propagator for $\sum_{i\in x} weights_i = y $.

Definition at line 167 of file weights.hpp.

Member Data Documentation

◆ elements

template<class View >
SharedArray<int> Gecode::Set::Int::Weights< View >::elements
protected

List of elements in the upper bound.

Definition at line 260 of file int.hh.

◆ weights

template<class View >
SharedArray<int> Gecode::Set::Int::Weights< View >::weights
protected

Weights for the elements in the upper bound.

Definition at line 262 of file int.hh.

◆ x

template<class View >
View Gecode::Set::Int::Weights< View >::x
protected

The set view.

Definition at line 265 of file int.hh.

◆ y

template<class View >
Gecode::Int::IntView Gecode::Set::Int::Weights< View >::y
protected

The integer view.

Definition at line 267 of file int.hh.


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