|
| Range (const iterator &start, const iterator &finish, int chunk=1) |
| Makes the range [start, finish).
|
|
| Range (const Range &r) |
| Copy constructor. Cost is O(1).
|
|
| Range (Range &left, const Split &) |
| Splits range between new and old (r) objects. Cost is O(1).
|
|
const iterator & | begin () const |
| Access the beginning.
|
|
bool | empty () const |
| Returns true if size == 0 .
|
|
const iterator & | end () const |
| Access the end.
|
|
unsigned int | get_chunksize () const |
| Access the chunk size.
|
|
bool | is_divisible () const |
| Return true if this iteration range can be divided; that is, there are more items than the chunk size.
|
|
size_t | size () const |
| Returns the number of items in the range (cost is O(1)).
|
|
|
template<typename integralT , typename distanceT > |
static std::enable_if< std::is_integral< integralT >::value, void >::type | advance (integralT &i, distanceT n) |
| Advance by n elements in the range.
|
|
template<typename iterT , typename distanceT > |
static std::enable_if<!std::is_integral< iterT >::value, void >::type | advance (iterT &it, distanceT n) |
| Advance by n elements in the range.
|
|
template<class integralT > |
static std::enable_if< std::is_integral< integralT >::value, integralT >::type | distance (integralT first, integralT last) |
| Calculate the distance between two iterators.
|
|
template<class iterT > |
static auto | distance (iterT first, iterT last, typename std::enable_if<!std::is_integral< iterT >::value >::type *=nullptr) -> decltype(std::distance(first, last)) |
| Calculate the distance between two iterators.
|
|
template<typename iteratorT>
class madness::Range< iteratorT >
Range, vaguely a la Intel TBB, to encapsulate a random-access, STL-like start and end iterator with chunksize.
- Template Parameters
-
iteratorT | The iterator type. |
template<typename iteratorT >
Makes the range [start, finish).
The motivated reader should look at the Intel TBB range, partitioner, split, concepts, etc.
- Parameters
-
[in] | start | The first item to iterate over. |
[in] | finish | The last item for iteration (one past the end). |
[in] | chunk | The number of items to give to each thread/process. |
References madness::Range< iteratorT >::chunksize.
template<typename iteratorT >
template<typename integralT , typename distanceT >
static std::enable_if< std::is_integral< integralT >::value, void >::type madness::Range< iteratorT >::advance |
( |
integralT & |
i, |
|
|
distanceT |
n |
|
) |
| |
|
inlinestaticprivate |
Advance by n
elements in the range.
This version is for cases where the "iterator type" is integral.
- Template Parameters
-
integralT | The integral iterator type. |
distanceT | The distance type. |
- Parameters
-
[in,out] | i | The integral iterator. |
[in] | n | The number of elements to advance. |
References madness::Range< iteratorT >::n.
Referenced by madness::Range< iteratorT >::Range().
template<typename iteratorT >
template<typename iterT , typename distanceT >
static std::enable_if<!std::is_integral< iterT >::value, void >::type madness::Range< iteratorT >::advance |
( |
iterT & |
it, |
|
|
distanceT |
n |
|
) |
| |
|
inlinestaticprivate |
Advance by n
elements in the range.
This version is for cases where the "iterator type" is not integral.
- Template Parameters
-
iterT | The non-integral iterator type. |
distanceT | The distance type. |
- Parameters
-
[in,out] | it | The iterator. |
[in] | n | The number of elements to advance. |
References std::advance(), and madness::Range< iteratorT >::n.