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

Gecode::Iter::Ranges::Cache< I > Class Template Reference
[Range iterators]

List of all members.

Detailed Description

template<class I>
class Gecode::Iter::Ranges::Cache< I >

Range iterator cache

Allows to iterate the ranges as defined by the input iterator several times provided the Cache is reset by the reset member function.

Requires

 #include "gecode/iter.hh" 

Definition at line 37 of file ranges-cache.icc.

Constructors and initialization

 Cache (void)
 Default constructor.
 Cache (I &i)
 Initialize with ranges from i.
void init (I &i)
 Initialize with ranges from i.

Iteration control

bool operator() (void) const
 Test whether iterator is still at a range or done.
void operator++ (void)
 Move iterator to next range (if possible).
void reset (void)
 Reset iterator to start from beginning.

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 Attributes

Support::SharedArray< Ranger
 Array for ranges.
int c
 Current range.
int n
 Number of ranges in cache.

Classes

class  Range
 Ranges stored in cache More...


Constructor & Destructor Documentation

template<class I>
Gecode::Iter::Ranges::Cache< I >::Cache void   )  [inline]
 

Default constructor.

Definition at line 85 of file ranges-cache.icc.

template<class I>
Gecode::Iter::Ranges::Cache< I >::Cache I &  i  )  [inline]
 

Initialize with ranges from i.

Definition at line 103 of file ranges-cache.icc.


Member Function Documentation

template<class I>
void Gecode::Iter::Ranges::Cache< I >::init I &  i  )  [inline]
 

Initialize with ranges from i.

Definition at line 90 of file ranges-cache.icc.

template<class I>
bool Gecode::Iter::Ranges::Cache< I >::operator() void   )  const [inline]
 

Test whether iterator is still at a range or done.

Definition at line 114 of file ranges-cache.icc.

template<class I>
void Gecode::Iter::Ranges::Cache< I >::operator++ void   )  [inline]
 

Move iterator to next range (if possible).

Definition at line 109 of file ranges-cache.icc.

template<class I>
void Gecode::Iter::Ranges::Cache< I >::reset void   )  [inline]
 

Reset iterator to start from beginning.

Definition at line 120 of file ranges-cache.icc.

template<class I>
int Gecode::Iter::Ranges::Cache< I >::min void   )  const [inline]
 

Return smallest value of range.

Definition at line 126 of file ranges-cache.icc.

template<class I>
int Gecode::Iter::Ranges::Cache< I >::max void   )  const [inline]
 

Return largest value of range.

Definition at line 131 of file ranges-cache.icc.

template<class I>
unsigned int Gecode::Iter::Ranges::Cache< I >::width void   )  const [inline]
 

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

Definition at line 136 of file ranges-cache.icc.


Member Data Documentation

template<class I>
Support::SharedArray<Range> Gecode::Iter::Ranges::Cache< I >::r [protected]
 

Array for ranges.

Definition at line 45 of file ranges-cache.icc.

template<class I>
int Gecode::Iter::Ranges::Cache< I >::c [protected]
 

Current range.

Definition at line 47 of file ranges-cache.icc.

template<class I>
int Gecode::Iter::Ranges::Cache< I >::n [protected]
 

Number of ranges in cache.

Definition at line 49 of file ranges-cache.icc.


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