Gecode::Iter::Ranges::ValCache< I > Class Template Reference
[Range iterators]
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] |
template<class I>
Gecode::Iter::Ranges::ValCache< I >::ValCache | ( | I & | i | ) | [inline] |
Member Function Documentation
template<class I>
void Gecode::Iter::Ranges::ValCache< I >::init | ( | I & | i | ) | [inline] |
template<class I>
bool Gecode::Iter::Ranges::ValCache< I >::operator() | ( | void | ) | const [inline] |
template<class I>
void Gecode::Iter::Ranges::ValCache< I >::operator++ | ( | void | ) | [inline] |
template<class I>
void Gecode::Iter::Ranges::ValCache< I >::operator-- | ( | void | ) | [inline] |
template<class I>
void Gecode::Iter::Ranges::ValCache< I >::reset | ( | void | ) | [inline] |
template<class I>
void Gecode::Iter::Ranges::ValCache< I >::last | ( | void | ) | [inline] |
template<class I>
void Gecode::Iter::Ranges::ValCache< I >::finish | ( | void | ) | [inline] |
template<class I>
int Gecode::Iter::Ranges::ValCache< I >::min | ( | void | ) | const [inline] |
template<class I>
int Gecode::Iter::Ranges::ValCache< I >::max | ( | void | ) | const [inline] |
template<class I>
int Gecode::Iter::Ranges::ValCache< I >::val | ( | void | ) | const [inline] |
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] |
template<class I>
void Gecode::Iter::Ranges::ValCache< I >::index | ( | unsigned int | i | ) | [inline] |
template<class I>
unsigned int Gecode::Iter::Ranges::ValCache< I >::index | ( | void | ) | [inline] |
Member Data Documentation
template<class I>
SharedArray<int> Gecode::Iter::Ranges::ValCache< I >::r [protected] |
template<class I>
int Gecode::Iter::Ranges::ValCache< I >::c [protected] |
template<class I>
int Gecode::Iter::Ranges::ValCache< I >::n [protected] |
template<class I>
int Gecode::Iter::Ranges::ValCache< I >::s [protected] |
The documentation for this class was generated from the following file:
- gecode/iter/ranges-cache.icc (Revision: 5262)