![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
#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. | |
IntersectingSubsetsIterator & | operator++ () |
Advances the iterator to the next intersecting subset. |
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.
|
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.
|
inline |
Returns (true) whether the iterator is at the end.
Definition at line 454 of file set_cover_model.h.
|
inline |
Disequality operator.
Definition at line 460 of file set_cover_model.h.
|
inline |
Returns the intersecting subset.
Definition at line 457 of file set_cover_model.h.
|
inline |
Advances the iterator to the next intersecting subset.
Definition at line 467 of file set_cover_model.h.