Generated on Mon Nov 30 23:53:53 2009 for Gecode by doxygen 1.6.1

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

Range iterator cache More...

#include <ranges-cache.hpp>

List of all members.

Classes

class  Range
 Ranges stored in cache More...

Protected Attributes

SharedArray< Ranger
 Array for ranges.
int c
 Current range.

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).

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.

Definition at line 50 of file ranges-cache.hpp.


Constructor & Destructor Documentation

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

Default constructor.

Definition at line 99 of file ranges-cache.hpp.

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

Initialize with ranges from i.

Definition at line 118 of file ranges-cache.hpp.


Member Function Documentation

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

Initialize with ranges from i.

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

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 129 of file ranges-cache.hpp.

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

Move iterator to next range (if possible).

Definition at line 124 of file ranges-cache.hpp.

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

Reset iterator to start from beginning.

Definition at line 135 of file ranges-cache.hpp.

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

Return smallest value of range.

Definition at line 141 of file ranges-cache.hpp.

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

Return largest value of range.

Definition at line 146 of file ranges-cache.hpp.

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 151 of file ranges-cache.hpp.


Member Data Documentation

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

Array for ranges.

Definition at line 61 of file ranges-cache.hpp.

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

Current range.

Definition at line 63 of file ranges-cache.hpp.


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