Generated on Sat Jun 2 2018 07:17:44 for Gecode by doxygen 1.8.13

Integer sets. More...

#include <int.hh>

Classes

class  MinInc
 Sort ranges according to increasing minimum. More...
 

Related Functions

(Note that these are not member functions.)

template<class Char , class Traits >
std::basic_ostream< Char, Traits > & operator<< (std::basic_ostream< Char, Traits > &os, const IntSet &s)
 Print integer set s. More...
 

Constructors and initialization

 IntSet (void)
 Initialize as empty set. More...
 
 IntSet (int n, int m)
 Initialize as range with minimum n and maximum m. More...
 
 IntSet (const int r[], int n)
 Initialize with n integers from array r. More...
 
 IntSet (const int r[][2], int n)
 Initialize with n ranges from array r. More...
 
template<class I >
 IntSet (I &i)
 Initialize with range iterator i. More...
 
template<class I >
 IntSet (const I &i)
 Initialize with range iterator i. More...
 

Range access

int ranges (void) const
 Return number of ranges of the specification. More...
 
int min (int i) const
 Return minimum of range at position i. More...
 
int max (int i) const
 Return maximum of range at position i. More...
 
unsigned int width (int i) const
 Return width of range at position i. More...
 

Entire set access

bool in (int n) const
 Return whether n is included in the set. More...
 
unsigned int size (void) const
 Return size (cardinality) of set. More...
 
unsigned int width (void) const
 Return width of set (distance between maximum and minimum) More...
 
int min (void) const
 Return minimum of entire set. More...
 
int max (void) const
 Return maximum of entire set. More...
 

Predefined value

static const IntSet empty
 Empty set. More...
 

Additional Inherited Members

- Public Member Functions inherited from Gecode::SharedHandle
 SharedHandle (void)
 Create shared handle with no object pointing to. More...
 
 SharedHandle (SharedHandle::Object *so)
 Create shared handle that points to shared object so. More...
 
 SharedHandle (const SharedHandle &sh)
 Copy constructor maintaining reference count. More...
 
SharedHandleoperator= (const SharedHandle &sh)
 Assignment operator maintaining reference count. More...
 
 ~SharedHandle (void)
 Destructor that maintains reference count. More...
 
 operator bool (void) const
 Whether handle points to an object. More...
 
- Protected Member Functions inherited from Gecode::SharedHandle
SharedHandle::Objectobject (void) const
 Access to the shared object. More...
 
void object (SharedHandle::Object *n)
 Modify shared object. More...
 

Detailed Description

Integer sets.

Integer sets are the means to specify arbitrary sets of integers to be used as domains for integer variables.

Definition at line 170 of file int.hh.

Constructor & Destructor Documentation

◆ IntSet() [1/6]

Gecode::IntSet::IntSet ( void  )
inline

Initialize as empty set.

Definition at line 43 of file int-set-1.hpp.

◆ IntSet() [2/6]

Gecode::IntSet::IntSet ( int  n,
int  m 
)
inline

Initialize as range with minimum n and maximum m.

Note that the set is empty if n is larger than m

Definition at line 106 of file int-set-1.hpp.

◆ IntSet() [3/6]

Gecode::IntSet::IntSet ( const int  r[],
int  n 
)
inline

Initialize with n integers from array r.

Definition at line 101 of file int-set-1.hpp.

◆ IntSet() [4/6]

Gecode::IntSet::IntSet ( const int  r[][2],
int  n 
)
inline

Initialize with n ranges from array r.

For position i in the array r, the minimum is r[i][0] and the maximum is r[i][1].

Definition at line 96 of file int-set-1.hpp.

◆ IntSet() [5/6]

template<class I >
Gecode::IntSet::IntSet ( I &  i)
explicit

Initialize with range iterator i.

Initialize integer set with iterator.

Definition at line 85 of file int-set-1.hpp.

◆ IntSet() [6/6]

template<class I >
Gecode::IntSet::IntSet ( const I &  i)
explicit

Initialize with range iterator i.

Initialize integer set with iterator.

Definition at line 91 of file int-set-1.hpp.

Member Function Documentation

◆ ranges()

int Gecode::IntSet::ranges ( void  ) const
inline

Return number of ranges of the specification.

Definition at line 130 of file int-set-1.hpp.

◆ min() [1/2]

int Gecode::IntSet::min ( int  i) const
inline

Return minimum of range at position i.

Definition at line 111 of file int-set-1.hpp.

◆ max() [1/2]

int Gecode::IntSet::max ( int  i) const
inline

Return maximum of range at position i.

Definition at line 117 of file int-set-1.hpp.

◆ width() [1/2]

unsigned int Gecode::IntSet::width ( int  i) const
inline

Return width of range at position i.

Definition at line 123 of file int-set-1.hpp.

◆ in()

bool Gecode::IntSet::in ( int  n) const
inline

Return whether n is included in the set.

Definition at line 136 of file int-set-1.hpp.

◆ size()

unsigned int Gecode::IntSet::size ( void  ) const
inline

Return size (cardinality) of set.

Definition at line 157 of file int-set-1.hpp.

◆ width() [2/2]

unsigned int Gecode::IntSet::width ( void  ) const
inline

Return width of set (distance between maximum and minimum)

Definition at line 163 of file int-set-1.hpp.

◆ min() [2/2]

int Gecode::IntSet::min ( void  ) const
inline

Return minimum of entire set.

Definition at line 145 of file int-set-1.hpp.

◆ max() [2/2]

int Gecode::IntSet::max ( void  ) const
inline

Return maximum of entire set.

Definition at line 151 of file int-set-1.hpp.

Friends And Related Function Documentation

◆ operator<<()

template<class Char , class Traits >
std::basic_ostream< Char, Traits > & operator<< ( std::basic_ostream< Char, Traits > &  os,
const IntSet s 
)
related

Print integer set s.

Definition at line 232 of file int-set-1.hpp.

Member Data Documentation

◆ empty

const IntSet Gecode::IntSet::empty
static

Empty set.

Definition at line 259 of file int.hh.


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