operations_research::Set< Integer > Class Template Reference

Detailed Description

template<typename Integer>
class operations_research::Set< Integer >

Definition at line 127 of file hamiltonian_path.h.

Public Types

typedef Integer IntegerType
 Make this visible to classes using this class. More...
 

Public Member Functions

 Set (Integer n)
 Construct a set from an Integer. More...
 
Integer value () const
 Returns the integer corresponding to the set. More...
 
Set AddElement (int n) const
 Returns a set equal to the calling object, with element n added. More...
 
Set RemoveElement (int n) const
 Returns a set equal to the calling object, with element n removed. More...
 
bool Contains (int n) const
 Returns true if the calling set contains element n. More...
 
bool Includes (Set other) const
 Returns true if 'other' is included in the calling set. More...
 
int Cardinality () const
 Returns the number of elements in the set. More...
 
int SmallestElement () const
 Returns the index of the smallest element in the set. More...
 
Set RemoveSmallestElement () const
 Returns a set equal to the calling object, with its smallest element removed. More...
 
int ElementRank (int n) const
 Returns the rank of an element in a set. More...
 
Set SmallestSingleton () const
 Returns the set consisting of the smallest element of the calling object. More...
 
int SingletonRank (Set singleton) const
 Returns the rank of the singleton's element in the calling Set. More...
 
ElementIterator< Setbegin () const
 STL iterator-related member functions. More...
 
ElementIterator< Setend () const
 
bool operator!= (const Set &other) const
 
template<>
int SmallestElement () const
 
template<>
int Cardinality () const
 

Static Public Member Functions

static Set FullSet (Integer card)
 
static Set Singleton (Integer n)
 Returns the singleton set with 'n' as its only element. More...
 

Static Public Attributes

static const Integer One = static_cast<Integer>(1)
 Useful constants. More...
 
static const Integer Zero = static_cast<Integer>(0)
 
static const int MaxCardinality = 8 * sizeof(Integer)
 

Member Typedef Documentation

◆ IntegerType

template<typename Integer >
typedef Integer operations_research::Set< Integer >::IntegerType

Make this visible to classes using this class.

Definition at line 130 of file hamiltonian_path.h.

Constructor & Destructor Documentation

◆ Set()

template<typename Integer >
operations_research::Set< Integer >::Set ( Integer  n)
inlineexplicit

Construct a set from an Integer.

Definition at line 138 of file hamiltonian_path.h.

Member Function Documentation

◆ AddElement()

template<typename Integer >
Set operations_research::Set< Integer >::AddElement ( int  n) const
inline

Returns a set equal to the calling object, with element n added.

If n is already in the set, no operation occurs.

Definition at line 155 of file hamiltonian_path.h.

◆ begin()

template<typename Integer >
ElementIterator<Set> operations_research::Set< Integer >::begin ( ) const
inline

STL iterator-related member functions.

Definition at line 198 of file hamiltonian_path.h.

◆ Cardinality() [1/2]

template<typename Integer >
int operations_research::Set< Integer >::Cardinality ( ) const
inline

Returns the number of elements in the set.

Uses the 32-bit version for types that have 32-bits or less. Specialized for uint64.

Definition at line 171 of file hamiltonian_path.h.

◆ Cardinality() [2/2]

template<>
int operations_research::Set< uint64 >::Cardinality ( ) const
inline

Definition at line 215 of file hamiltonian_path.h.

◆ Contains()

template<typename Integer >
bool operations_research::Set< Integer >::Contains ( int  n) const
inline

Returns true if the calling set contains element n.

Definition at line 162 of file hamiltonian_path.h.

◆ ElementRank()

template<typename Integer >
int operations_research::Set< Integer >::ElementRank ( int  n) const
inline

Returns the rank of an element in a set.

For the set 11100, ElementRank(4) would return 2. (Ranks start at zero).

Definition at line 183 of file hamiltonian_path.h.

◆ end()

template<typename Integer >
ElementIterator<Set> operations_research::Set< Integer >::end ( ) const
inline

Definition at line 201 of file hamiltonian_path.h.

◆ FullSet()

template<typename Integer >
static Set operations_research::Set< Integer >::FullSet ( Integer  card)
inlinestatic

Definition at line 146 of file hamiltonian_path.h.

◆ Includes()

template<typename Integer >
bool operations_research::Set< Integer >::Includes ( Set< Integer >  other) const
inline

Returns true if 'other' is included in the calling set.

Definition at line 165 of file hamiltonian_path.h.

◆ operator!=()

template<typename Integer >
bool operations_research::Set< Integer >::operator!= ( const Set< Integer > &  other) const
inline

Definition at line 202 of file hamiltonian_path.h.

◆ RemoveElement()

template<typename Integer >
Set operations_research::Set< Integer >::RemoveElement ( int  n) const
inline

Returns a set equal to the calling object, with element n removed.

If n is not in the set, no operation occurs.

Definition at line 159 of file hamiltonian_path.h.

◆ RemoveSmallestElement()

template<typename Integer >
Set operations_research::Set< Integer >::RemoveSmallestElement ( ) const
inline

Returns a set equal to the calling object, with its smallest element removed.

Definition at line 179 of file hamiltonian_path.h.

◆ Singleton()

template<typename Integer >
static Set operations_research::Set< Integer >::Singleton ( Integer  n)
inlinestatic

Returns the singleton set with 'n' as its only element.

Definition at line 151 of file hamiltonian_path.h.

◆ SingletonRank()

template<typename Integer >
int operations_research::Set< Integer >::SingletonRank ( Set< Integer >  singleton) const
inline

Returns the rank of the singleton's element in the calling Set.

Definition at line 192 of file hamiltonian_path.h.

◆ SmallestElement() [1/2]

template<typename Integer >
int operations_research::Set< Integer >::SmallestElement ( ) const
inline

Returns the index of the smallest element in the set.

Uses the 32-bit version for types that have 32-bits or less. Specialized for uint64.

Definition at line 175 of file hamiltonian_path.h.

◆ SmallestElement() [2/2]

template<>
int operations_research::Set< uint64 >::SmallestElement ( ) const
inline

Definition at line 210 of file hamiltonian_path.h.

◆ SmallestSingleton()

template<typename Integer >
Set operations_research::Set< Integer >::SmallestSingleton ( ) const
inline

Returns the set consisting of the smallest element of the calling object.

Definition at line 189 of file hamiltonian_path.h.

◆ value()

template<typename Integer >
Integer operations_research::Set< Integer >::value ( ) const
inline

Returns the integer corresponding to the set.

Definition at line 144 of file hamiltonian_path.h.

Member Data Documentation

◆ MaxCardinality

template<typename Integer >
const int operations_research::Set< Integer >::MaxCardinality = 8 * sizeof(Integer)
static

Definition at line 135 of file hamiltonian_path.h.

◆ One

template<typename Integer >
const Integer operations_research::Set< Integer >::One = static_cast<Integer>(1)
static

Useful constants.

Definition at line 133 of file hamiltonian_path.h.

◆ Zero

template<typename Integer >
const Integer operations_research::Set< Integer >::Zero = static_cast<Integer>(0)
static

Definition at line 134 of file hamiltonian_path.h.


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