Generated on Mon Aug 25 11:35:52 2008 for Gecode by doxygen 1.5.6

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

List of all members.


Detailed Description

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

Range iterator cache

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

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


Constructors and initialization

 ValCache (void)
 Default constructor.
 ValCache (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 operator-- (void)
 Move iterator to previous range (if possible).
void reset (void)
 Reset iterator to start from beginning.
void last (void)
 Start iteration from end.
void finish (void)
 Stop iteration.

Range access

int min (void) const
 Always returns val.
int max (void) const
 Always returns val.
int val (void) const
 Return value.
unsigned int width (void) const
 Return width of range (distance between minimum and maximum).
unsigned int size (void) const
 Return size of the union over all ranges.

Index acces

void index (unsigned int i)
 Start iteration from ith range in cache.
unsigned int index (void)
 Get the index of the current range.

Protected Attributes

SharedArray< int > r
 Array for ranges.
int c
 Current range.
int n
 Number of ranges in cache.
int s
 Number of elements in cache.

Constructor & Destructor Documentation

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

Default constructor.

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

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

Initialize with ranges from i.

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


Member Function Documentation

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

Initialize with ranges from i.

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

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

Test whether iterator is still at a range or done.

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

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

Move iterator to next range (if possible).

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

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

Move iterator to previous range (if possible).

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

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

Reset iterator to start from beginning.

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

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

Start iteration from end.

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

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

Stop iteration.

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

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

Always returns val.

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

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

Always returns val.

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

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

Return value.

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

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

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

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

template<class I>
unsigned int Gecode::Iter::Ranges::ValCache< I >::size ( void   )  const [inline]

Return size of the union over all ranges.

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

template<class I>
void Gecode::Iter::Ranges::ValCache< I >::index ( unsigned int  i  )  [inline]

Start iteration from ith range in cache.

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

template<class I>
unsigned int Gecode::Iter::Ranges::ValCache< I >::index ( void   )  [inline]

Get the index of the current range.

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


Member Data Documentation

template<class I>
SharedArray<int> Gecode::Iter::Ranges::ValCache< I >::r [protected]

Array for ranges.

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

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

Current range.

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

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

Number of ranges in cache.

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

template<class I>
int Gecode::Iter::Ranges::ValCache< I >::s [protected]

Number of elements in cache.

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


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