Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set
// doxy/ or-tools/ src/ constraint_solver/

operations_research::IntVarIterator Class Reference

The class Iterator has two direct subclasses. More...

#include <constraint_solver.h>

Inheritance diagram for operations_research::IntVarIterator:

operations_research::BaseObject

List of all members.

Public Member Functions

virtual ~IntVarIterator ()
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 Value () const =0
 This method returns the value of the hole.
virtual void Next ()=0
 This method moves the iterator to the next value.
virtual string DebugString () const
 Pretty Print.


Detailed Description

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; scoped_ptr<IntVarIterator> it(current_var->MakeHoleIterator(false)); for (it->Init(); it->Ok(); it->Next()) { const int64 hole = it->Value(); use the hole }

Definition at line 3755 of file constraint_solver.h.


Constructor & Destructor Documentation

virtual operations_research::IntVarIterator::~IntVarIterator (  )  [inline, virtual]

Definition at line 3757 of file constraint_solver.h.


Member Function Documentation

virtual void operations_research::IntVarIterator::Init (  )  [pure virtual]

This method must be called before each loop.

virtual bool operations_research::IntVarIterator::Ok (  )  const [pure virtual]

This method indicates if we can call Value() or not.

virtual int64 operations_research::IntVarIterator::Value (  )  const [pure virtual]

This method returns the value of the hole.

virtual void operations_research::IntVarIterator::Next (  )  [pure virtual]

This method moves the iterator to the next value.

virtual string operations_research::IntVarIterator::DebugString (  )  const [inline, virtual]

Pretty Print.

Reimplemented from operations_research::BaseObject.

Definition at line 3772 of file constraint_solver.h.


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