Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::SetRangeIterator< SetRange > Class Template Reference

#include <hamiltonian_path.h>

Public Types

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

Public Member Functions

 SetRangeIterator (const SetType set)
 
SetType operator* () const
 STL iterator-related methods.
 
bool operator!= (const SetRangeIterator &other) const
 
const SetRangeIteratoroperator++ ()
 

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 222 of file hamiltonian_path.h.

Member Typedef Documentation

◆ IntegerType

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

Definition at line 226 of file hamiltonian_path.h.

◆ SetType

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

Make the parameter types visible to SetRangeWithCardinality.

Definition at line 225 of file hamiltonian_path.h.

Constructor & Destructor Documentation

◆ SetRangeIterator()

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

Definition at line 228 of file hamiltonian_path.h.

Member Function Documentation

◆ operator!=()

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

Definition at line 232 of file hamiltonian_path.h.

◆ operator*()

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

STL iterator-related methods.

Definition at line 231 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 239 of file hamiltonian_path.h.


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