Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0
Gecode::Int::GCC::CardView Class Reference

Cardinality integer view. More...

#include <view.hpp>

Static Public Attributes

static const bool propagate = true
 This view does require propagation.
 

Protected Attributes

int _card
 Cardinality.
 
int _counter
 Counter.
 
- Protected Attributes inherited from Gecode::DerivedView< IntView >
IntView x
 View from which this view is derived.
 

Initialization

 CardView (void)
 Default constructor.
 
void init (const IntView &y, int c)
 Initialize with integer view y and value c.
 
void init (Space &home, const IntSet &s, int c)
 Initialize for set s and cardinality c.
 

Value access

int min (void) const
 Return minimum of domain.
 
int max (void) const
 Return maximum of domain.
 
unsigned int size (void) const
 Return size (cardinality) of domain.
 
int counter (void) const
 Return the number of times the value occurs.
 
int card (void) const
 Return cardinality.
 

Domain update by value

Set the counter to the number of times value n occurs

void counter (int n)
 Increment counter.
 
ModEvent inc (void)
 Increment counter.
 
ModEvent lq (Space &home, int n)
 Restrict domain values to be less or equal than n.
 
ModEvent gq (Space &home, int n)
 Restrict domain values to be greater or equal than n.
 
ModEvent eq (Space &home, int n)
 Restrict domain values to be equal to n.
 

Domain update by iterator

template<class I >
ModEvent narrow_v (Space &home, I &i, bool depends=true)
 Replace domain by values described by i.
 
template<class I >
ModEvent inter_v (Space &home, I &i, bool depends=true)
 Intersect domain with values described by i.
 
template<class I >
ModEvent minus_v (Space &home, I &i, bool depends=true)
 Remove from domain the values described by i.
 

Cloning

Update this view to be a clone of view x

void update (Space &home, CardView &x)
 

Additional Inherited Members

- Public Types inherited from Gecode::DerivedView< IntView >
typedef IntView::VarImpType VarImpType
 The variable implementation type belonging to the View.
 
typedef IntView::VarType VarType
 The variable type belonging to the View.
 
- Public Member Functions inherited from Gecode::DerivedView< IntView >
 DerivedView (const IntView &y)
 Initialize with view y.
 
VarImpTypevarimp (void) const
 Return variable implementation of view.
 
IntView base (void) const
 Return view from which this view is derived.
 
unsigned int degree (void) const
 Return degree (number of subscribed propagators)
 
double afc (void) const
 Return accumulated failure count.
 
bool assigned (void) const
 Test whether view is assigned.
 
void subscribe (Space &home, Propagator &p, PropCond pc, bool schedule=true)
 Subscribe propagator p with propagation condition pc to view.
 
void subscribe (Space &home, Advisor &a, bool fail=false)
 Subscribe advisor a to view.
 
void cancel (Space &home, Propagator &p, PropCond pc)
 Cancel subscription of propagator p with propagation condition pc to view.
 
void cancel (Space &home, Advisor &a, bool fail=false)
 Cancel subscription of advisor a.
 
void reschedule (Space &home, Propagator &p, PropCond pc)
 Re-schedule propagator p with propagation condition pc.
 
void update (Space &home, DerivedView< IntView > &y)
 Update this view to be a clone of view y.
 
bool operator< (const DerivedView< IntView > &y) const
 Whether this view comes before view y (arbitray order)
 
- Static Public Member Functions inherited from Gecode::DerivedView< IntView >
static bool varderived (void)
 Return whether this view is derived from a VarImpView.
 
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)
 Translate modification event me to modification event delta for view.
 
static ModEvent modevent (const Delta &d)
 Return modification event.
 
- Protected Member Functions inherited from Gecode::DerivedView< IntView >
 DerivedView (void)
 Default constructor.
 

Detailed Description

Cardinality integer view.

Definition at line 140 of file view.hpp.

Constructor & Destructor Documentation

◆ CardView()

Gecode::Int::GCC::CardView::CardView ( void )
inline

Default constructor.

Definition at line 297 of file view.hpp.

Member Function Documentation

◆ init() [1/2]

void Gecode::Int::GCC::CardView::init ( const IntView & y,
int c )
inline

Initialize with integer view y and value c.

Definition at line 299 of file view.hpp.

◆ init() [2/2]

void Gecode::Int::GCC::CardView::init ( Space & home,
const IntSet & s,
int c )
inline

Initialize for set s and cardinality c.

Definition at line 303 of file view.hpp.

◆ min()

int Gecode::Int::GCC::CardView::min ( void ) const
inline

Return minimum of domain.

Definition at line 316 of file view.hpp.

◆ max()

int Gecode::Int::GCC::CardView::max ( void ) const
inline

Return maximum of domain.

Definition at line 320 of file view.hpp.

◆ size()

unsigned int Gecode::Int::GCC::CardView::size ( void ) const
inline

Return size (cardinality) of domain.

Definition at line 324 of file view.hpp.

◆ counter() [1/2]

int Gecode::Int::GCC::CardView::counter ( void ) const
inline

Return the number of times the value occurs.

Definition at line 308 of file view.hpp.

◆ card()

int Gecode::Int::GCC::CardView::card ( void ) const
inline

Return cardinality.

Definition at line 312 of file view.hpp.

◆ counter() [2/2]

void Gecode::Int::GCC::CardView::counter ( int n)
inline

Increment counter.

Definition at line 329 of file view.hpp.

◆ inc()

ModEvent Gecode::Int::GCC::CardView::inc ( void )
inline

Increment counter.

Definition at line 333 of file view.hpp.

◆ lq()

ModEvent Gecode::Int::GCC::CardView::lq ( Space & home,
int n )
inline

Restrict domain values to be less or equal than n.

Definition at line 339 of file view.hpp.

◆ gq()

ModEvent Gecode::Int::GCC::CardView::gq ( Space & home,
int n )
inline

Restrict domain values to be greater or equal than n.

Definition at line 343 of file view.hpp.

◆ eq()

ModEvent Gecode::Int::GCC::CardView::eq ( Space & home,
int n )
inline

Restrict domain values to be equal to n.

Definition at line 347 of file view.hpp.

◆ narrow_v()

template<class I >
ModEvent Gecode::Int::GCC::CardView::narrow_v ( Space & home,
I & i,
bool depends = true )
inline

Replace domain by values described by i.

Definition at line 353 of file view.hpp.

◆ inter_v()

template<class I >
ModEvent Gecode::Int::GCC::CardView::inter_v ( Space & home,
I & i,
bool depends = true )
inline

Intersect domain with values described by i.

Definition at line 358 of file view.hpp.

◆ minus_v()

template<class I >
ModEvent Gecode::Int::GCC::CardView::minus_v ( Space & home,
I & i,
bool depends = true )
inline

Remove from domain the values described by i.

Definition at line 363 of file view.hpp.

◆ update()

void Gecode::Int::GCC::CardView::update ( Space & home,
CardView & x )
inline

Definition at line 368 of file view.hpp.

Member Data Documentation

◆ _card

int Gecode::Int::GCC::CardView::_card
protected

Cardinality.

Definition at line 144 of file view.hpp.

◆ _counter

int Gecode::Int::GCC::CardView::_counter
protected

Counter.

Definition at line 146 of file view.hpp.

◆ propagate

const bool Gecode::Int::GCC::CardView::propagate = true
static

This view does require propagation.

Definition at line 149 of file view.hpp.


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