Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <constraint_solver.h>
Public Member Functions | |
~IntVarIterator () override | |
virtual void | Init ()=0 |
This method must be called before each loop. | |
virtual bool | Ok () const =0 |
This method indicates if we can call Value() or not. | |
virtual int64_t | Value () const =0 |
This method returns the current value of the iterator. | |
virtual void | Next ()=0 |
This method moves the iterator to the next value. | |
std::string | DebugString () const override |
Pretty Print. | |
Public Member Functions inherited from operations_research::BaseObject | |
BaseObject () | |
BaseObject (const BaseObject &)=delete | |
This type is neither copyable nor movable. | |
BaseObject & | operator= (const BaseObject &)=delete |
virtual | ~BaseObject () |
The class Iterator has two direct subclasses. HoleIterators iterates over all holes, that is value removed between the current min and max of the variable since the last time the variable was processed in the queue. DomainIterators iterates over all elements of the variable domain. Both iterators are not robust to domain changes. Hole iterators can also report values outside the current min and max of the variable. HoleIterators should only be called from a demon attached to the variable that has created this iterator. IntVar* current_var; std::unique_ptr<IntVarIterator> it(current_var->MakeHoleIterator(false)); for (const int64_t hole : InitAndGetValues(it)) { /// use the hole }
Definition at line 4193 of file constraint_solver.h.
|
inlineoverride |
Definition at line 4195 of file constraint_solver.h.
|
inlineoverridevirtual |
Pretty Print.
Reimplemented from operations_research::BaseObject.
Definition at line 4210 of file constraint_solver.h.
|
pure virtual |
This method must be called before each loop.
|
pure virtual |
This method moves the iterator to the next value.
|
pure virtual |
This method indicates if we can call Value() or not.
|
pure virtual |
This method returns the current value of the iterator.