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< Range > | r |
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
|
Default constructor.
Definition at line 85 of file ranges-cache.icc. |
|
Initialize with ranges from i.
Definition at line 103 of file ranges-cache.icc. |
Member Function Documentation
|
Initialize with ranges from i.
Definition at line 90 of file ranges-cache.icc. |
|
Test whether iterator is still at a range or done.
Definition at line 114 of file ranges-cache.icc. |
|
Move iterator to next range (if possible).
Definition at line 109 of file ranges-cache.icc. |
|
Reset iterator to start from beginning.
Definition at line 120 of file ranges-cache.icc. |
|
Return smallest value of range.
Definition at line 126 of file ranges-cache.icc. |
|
Return largest value of range.
Definition at line 131 of file ranges-cache.icc. |
|
Return width of range (distance between minimum and maximum).
Definition at line 136 of file ranges-cache.icc. |
Member Data Documentation
|
Array for ranges.
Definition at line 45 of file ranges-cache.icc. |
|
Current range.
Definition at line 47 of file ranges-cache.icc. |
|
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:
- gecode/iter/ranges-cache.icc (Revision: 3188)