Generated on Wed Nov 1 15:05:21 2006 for Gecode by doxygen 1.4.5

Gecode::Iter::Ranges::MinMax Class Reference
[Range iterators]

Inherited by Gecode::Iter::Ranges::AddRange< I >, Gecode::Iter::Ranges::Append< I, J >, Gecode::Iter::Ranges::Compl< UMIN, UMAX, I >, Gecode::Iter::Ranges::Compl< Limits::Set::int_min, Limits::Set::int_max, GlbRanges< View > >, Gecode::Iter::Ranges::Compl< Limits::Set::int_min, Limits::Set::int_max, I >, Gecode::Iter::Ranges::Compl< Limits::Set::int_min, Limits::Set::int_max, LubRanges< View > >, Gecode::Iter::Ranges::ComplVal< I >, Gecode::Iter::Ranges::Diff< I, J >, Gecode::Iter::Ranges::Diff< LubRanges< Set::SetVarImp * >, GlbRanges< Set::SetVarImp * > >, Gecode::Iter::Ranges::Diff< LubRanges< T >, GlbRanges< T > >, Gecode::Iter::Ranges::Inter< I, J >, Gecode::Iter::Ranges::NaryAppend< I >, Gecode::Iter::Ranges::NaryInter< I >, Gecode::Iter::Ranges::NaryUnion< I >, Gecode::Iter::Ranges::ScaleDown< I >, Gecode::Iter::Ranges::Singleton, Gecode::Iter::Ranges::Union< I, J >, Gecode::Iter::Ranges::Virt::Compl< UMIN, UMAX >, Gecode::Iter::Ranges::Virt::ComplVal, Gecode::Iter::Ranges::Virt::Inter, Gecode::Iter::Ranges::Virt::NaryInter, Gecode::Iter::Ranges::Virt::NaryUnion, Gecode::Iter::Ranges::Virt::Union, and Gecode::Iter::Values::ToRanges< I >.

List of all members.


Detailed Description

Base for range iterators with explicit min and max.

The iterator provides members mi and ma for storing the limits of the currently iterated range. The iterator continues until mi becomes greater than ma. The member function finish does exactly that.

Requires

 #include "gecode/iter.hh" 

Definition at line 36 of file ranges-minmax.icc.

Constructors and initialization

 MinMax (void)
 Default constructor.
 MinMax (int min, int max)
 Initialize with range min to max.

Iteration control

bool operator() (void) const
 Test whether iterator is still at a range or done.

Range access

int min (void) const
 Return smallest value of range.
int max (void) const
 Return largest value of range.
unsigned int width (void) const
 Return width of range (distance between minimum and maximum).

Protected Member Functions

void finish (void)
 Set range such that iteration stops

Protected Attributes

int mi
 Minimum of current range.
int ma
 Maximum of current range.


Constructor & Destructor Documentation

Gecode::Iter::Ranges::MinMax::MinMax void   )  [inline]
 

Default constructor.

Definition at line 76 of file ranges-minmax.icc.

Gecode::Iter::Ranges::MinMax::MinMax int  min,
int  max
[inline]
 

Initialize with range min to max.

Definition at line 79 of file ranges-minmax.icc.


Member Function Documentation

void Gecode::Iter::Ranges::MinMax::finish void   )  [inline, protected]
 

Set range such that iteration stops

Definition at line 71 of file ranges-minmax.icc.

bool Gecode::Iter::Ranges::MinMax::operator() void   )  const [inline]
 

Test whether iterator is still at a range or done.

Definition at line 83 of file ranges-minmax.icc.

int Gecode::Iter::Ranges::MinMax::min void   )  const [inline]
 

Return smallest value of range.

Reimplemented in Gecode::Iter::Ranges::Virt::Compl< UMIN, UMAX >, Gecode::Iter::Ranges::Virt::ComplVal, Gecode::Iter::Ranges::Virt::Inter, Gecode::Iter::Ranges::Virt::NaryInter, Gecode::Iter::Ranges::Virt::Union, and Gecode::Iter::Ranges::Virt::NaryUnion.

Definition at line 88 of file ranges-minmax.icc.

int Gecode::Iter::Ranges::MinMax::max void   )  const [inline]
 

Return largest value of range.

Reimplemented in Gecode::Iter::Ranges::Virt::Compl< UMIN, UMAX >, Gecode::Iter::Ranges::Virt::ComplVal, Gecode::Iter::Ranges::Virt::Inter, Gecode::Iter::Ranges::Virt::NaryInter, Gecode::Iter::Ranges::Virt::Union, and Gecode::Iter::Ranges::Virt::NaryUnion.

Definition at line 92 of file ranges-minmax.icc.

unsigned int Gecode::Iter::Ranges::MinMax::width void   )  const [inline]
 

Return width of range (distance between minimum and maximum).

Reimplemented in Gecode::Iter::Ranges::Virt::Compl< UMIN, UMAX >, Gecode::Iter::Ranges::Virt::ComplVal, Gecode::Iter::Ranges::Virt::Inter, Gecode::Iter::Ranges::Virt::NaryInter, Gecode::Iter::Ranges::Virt::Union, and Gecode::Iter::Ranges::Virt::NaryUnion.

Definition at line 96 of file ranges-minmax.icc.


Member Data Documentation

int Gecode::Iter::Ranges::MinMax::mi [protected]
 

Minimum of current range.

Definition at line 39 of file ranges-minmax.icc.

int Gecode::Iter::Ranges::MinMax::ma [protected]
 

Maximum of current range.

Definition at line 41 of file ranges-minmax.icc.


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