operations_research::SetRangeIterator< SetRange > Class Template Reference

Detailed Description

template<typename SetRange>
class operations_research::SetRangeIterator< SetRange >

An iterator for sets of increasing corresponding values that have the same cardinality.

For example, the sets with cardinality 3 will be listed as ...00111, ...01011, ...01101, ...1110, etc...

Definition at line 223 of file hamiltonian_path.h.

Public Types

typedef SetRange::SetType SetType
 Make the parameter types visible to SetRangeWithCardinality. More...
 
typedef SetType::IntegerType IntegerType
 

Public Member Functions

 SetRangeIterator (const SetType set)
 
SetType operator * () const
 STL iterator-related methods. More...
 
bool operator!= (const SetRangeIterator &other) const
 
const SetRangeIteratoroperator++ ()
 Computes the next set with the same cardinality using Gosper's hack. More...
 

Member Typedef Documentation

◆ IntegerType

template<typename SetRange >
typedef SetType::IntegerType operations_research::SetRangeIterator< SetRange >::IntegerType

Definition at line 227 of file hamiltonian_path.h.

◆ SetType

template<typename SetRange >
typedef SetRange::SetType operations_research::SetRangeIterator< SetRange >::SetType

Make the parameter types visible to SetRangeWithCardinality.

Definition at line 226 of file hamiltonian_path.h.

Constructor & Destructor Documentation

◆ SetRangeIterator()

template<typename SetRange >
operations_research::SetRangeIterator< SetRange >::SetRangeIterator ( const SetType  set)
inlineexplicit

Definition at line 229 of file hamiltonian_path.h.

Member Function Documentation

◆ operator *()

template<typename SetRange >
SetType operations_research::SetRangeIterator< SetRange >::operator * ( ) const
inline

STL iterator-related methods.

Definition at line 232 of file hamiltonian_path.h.

◆ operator!=()

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

Definition at line 233 of file hamiltonian_path.h.

◆ operator++()

template<typename SetRange >
const SetRangeIterator& operations_research::SetRangeIterator< SetRange >::operator++ ( )
inline

Computes the next set with the same cardinality using Gosper's hack.

ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-239.pdf ITEM 175 Also translated in C https://www.cl.cam.ac.uk/~am21/hakmemc.html

Dividing by c as in HAKMEMC can be avoided by taking into account that c is the smallest singleton of current_set_, and using a shift.

Definition at line 240 of file hamiltonian_path.h.


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