Generated on Thu Mar 22 10:39:59 2012 for Gecode by doxygen 1.6.3

Gecode::Set::BndSet Class Reference

Sets of integers. More...

#include <var-imp.hpp>

List of all members.

Public Member Functions

bool isConsistent (void) const
 Check whether internal invariants hold.

Static Public Attributes

static const int MAX_OF_EMPTY = Limits::min-1
 Returned by empty sets when asked for their maximum element.
static const int MIN_OF_EMPTY = Limits::max+1
 Returned by empty sets when asked for their minimum element.

Protected Member Functions

void fst (RangeList *r)
 Set first range to r.
void lst (RangeList *r)
 Set last range to r.
RangeListfst (void) const
 Return first range.
RangeListlst (void) const
 Return last range.
template<class I >
bool overwrite (Space &home, I &i)
 Overwrite the ranges with those represented by i.

Protected Attributes

unsigned int _size
 The size of this set.
unsigned int _card
 The cardinality this set represents.

Constructors and initialization



 BndSet (void)
 Default constructor. Creates an empty set.
 BndSet (Space &home, int i, int j)
 Initialize as the set $ \{i,\dots,j\}$.
 BndSet (Space &home, const IntSet &s)
 Initialize as the set represented by s.

Memory management



void dispose (Space &home)
 Free memory used by this set.

Value access



int min (void) const
 Return smallest element.
int max (void) const
 Return greatest element.
int minN (unsigned int n) const
 Return n -th smallest element.
unsigned int size (void) const
 Return size.
unsigned int card (void) const
 Return cardinality.
void card (unsigned int c)
 Set cardinality.

Tests



bool empty (void) const
 Test whether this set is empty.
bool in (int i) const
 Test whether i is an element of this set.

Update operations



void become (Space &home, const BndSet &s)
 Make this set equal to s.

Range list access for iteration



RangeListranges (void) const
 Return range list for iteration.

Cloning



void update (Space &home, BndSet &x)
 Update this set to be a clone of set x.

Detailed Description

Sets of integers.

Definition at line 93 of file var-imp.hpp.


Constructor & Destructor Documentation

Gecode::Set::BndSet::BndSet ( void   )  [inline]

Default constructor. Creates an empty set.

Definition at line 50 of file integerset.hpp.

Gecode::Set::BndSet::BndSet ( Space home,
int  i,
int  j 
) [inline]

Initialize as the set $ \{i,\dots,j\}$.

Definition at line 80 of file integerset.hpp.

Gecode::Set::BndSet::BndSet ( Space home,
const IntSet s 
)

Initialize as the set represented by s.

Definition at line 44 of file integerset.cpp.


Member Function Documentation

void Gecode::Set::BndSet::fst ( RangeList r  )  [inline, protected]

Set first range to r.

Definition at line 70 of file integerset.hpp.

void Gecode::Set::BndSet::lst ( RangeList r  )  [inline, protected]

Set last range to r.

Definition at line 75 of file integerset.hpp.

RangeList * Gecode::Set::BndSet::fst ( void   )  const [inline, protected]

Return first range.

Definition at line 54 of file integerset.hpp.

RangeList * Gecode::Set::BndSet::lst ( void   )  const [inline, protected]

Return last range.

Definition at line 59 of file integerset.hpp.

void Gecode::Set::BndSet::dispose ( Space home  )  [inline]

Free memory used by this set.

Definition at line 64 of file integerset.hpp.

int Gecode::Set::BndSet::min ( void   )  const [inline]

Return smallest element.

Definition at line 107 of file integerset.hpp.

int Gecode::Set::BndSet::max ( void   )  const [inline]

Return greatest element.

Definition at line 115 of file integerset.hpp.

int Gecode::Set::BndSet::minN ( unsigned int  n  )  const [inline]

Return n -th smallest element.

Definition at line 124 of file integerset.hpp.

unsigned int Gecode::Set::BndSet::size ( void   )  const [inline]

Return size.

Definition at line 97 of file integerset.hpp.

unsigned int Gecode::Set::BndSet::card ( void   )  const [inline]

Return cardinality.

Definition at line 134 of file integerset.hpp.

void Gecode::Set::BndSet::card ( unsigned int  c  )  [inline]

Set cardinality.

Definition at line 139 of file integerset.hpp.

bool Gecode::Set::BndSet::empty ( void   )  const [inline]

Test whether this set is empty.

Definition at line 102 of file integerset.hpp.

bool Gecode::Set::BndSet::in ( int  i  )  const [inline]

Test whether i is an element of this set.

Definition at line 228 of file integerset.hpp.

void Gecode::Set::BndSet::become ( Space home,
const BndSet s 
) [inline]

Make this set equal to s.

Definition at line 215 of file integerset.hpp.

RangeList * Gecode::Set::BndSet::ranges ( void   )  const [inline]

Return range list for iteration.

Definition at line 92 of file integerset.hpp.

template<class I >
bool Gecode::Set::BndSet::overwrite ( Space home,
I &  i 
) [inline, protected]

Overwrite the ranges with those represented by i.

Definition at line 175 of file integerset.hpp.

void Gecode::Set::BndSet::update ( Space home,
BndSet x 
) [inline]

Update this set to be a clone of set x.

Definition at line 144 of file integerset.hpp.

bool Gecode::Set::BndSet::isConsistent ( void   )  const

Check whether internal invariants hold.

Definition at line 293 of file integerset.cpp.


Member Data Documentation

unsigned int Gecode::Set::BndSet::_size [protected]

The size of this set.

Definition at line 99 of file var-imp.hpp.

unsigned int Gecode::Set::BndSet::_card [protected]

The cardinality this set represents.

Definition at line 101 of file var-imp.hpp.

Returned by empty sets when asked for their maximum element.

Definition at line 114 of file var-imp.hpp.

Returned by empty sets when asked for their minimum element.

Definition at line 116 of file var-imp.hpp.


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