Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::IntersectingSubsetsIterator Class Reference

#include <set_cover_model.h>

Public Member Functions

 IntersectingSubsetsIterator (const SetCoverModel &model, SubsetIndex seed_subset, bool at_end=false)
bool at_end () const
 Returns (true) whether the iterator is at the end.
SubsetIndex operator* () const
 Returns the intersecting subset.
bool operator!= (const IntersectingSubsetsIterator &other) const
 Disequality operator.
IntersectingSubsetsIteratoroperator++ ()
 Advances the iterator to the next intersecting subset.

Detailed Description

IntersectingSubsetsIterator is a forward iterator that returns the next intersecting subset for a fixed seed_subset. The iterator is initialized with a model and a seed_subset and allows a speedup in getting the intersecting subsets by not storing them in memory. The iterator is at the end when the last intersecting subset has been returned.

Definition at line 418 of file set_cover_model.h.

Constructor & Destructor Documentation

◆ IntersectingSubsetsIterator()

operations_research::IntersectingSubsetsIterator::IntersectingSubsetsIterator ( const SetCoverModel & model,
SubsetIndex seed_subset,
bool at_end = false )
inline

For iterator to be as light as possible when created, we do not reserve space for the subset_seen_ vector, and we do not initialize it. This is done to avoid the overhead of creating the vector and initializing it when the iterator is created. The vector is created on the first call to the ++ operator.

Definition at line 420 of file set_cover_model.h.

Member Function Documentation

◆ at_end()

bool operations_research::IntersectingSubsetsIterator::at_end ( ) const
inline

Returns (true) whether the iterator is at the end.

Definition at line 454 of file set_cover_model.h.

◆ operator!=()

bool operations_research::IntersectingSubsetsIterator::operator!= ( const IntersectingSubsetsIterator & other) const
inline

Disequality operator.

Definition at line 460 of file set_cover_model.h.

◆ operator*()

SubsetIndex operations_research::IntersectingSubsetsIterator::operator* ( ) const
inline

Returns the intersecting subset.

Definition at line 457 of file set_cover_model.h.

◆ operator++()

IntersectingSubsetsIterator & operations_research::IntersectingSubsetsIterator::operator++ ( )
inline

Advances the iterator to the next intersecting subset.

Definition at line 467 of file set_cover_model.h.


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