|
OpenMPCD
|
Wraps an iterator range such that it is grouped into "bunches" of a given length, with a configurable gap between bunches. More...
#include <BunchIteratorRange.hpp>
Classes | |
| class | AdvancingFunctor |
| Functor class for advancing a pointer by the given number of effective elements. More... | |
Public Types | |
| typedef thrust::iterator_difference< UnderlyingIterator >::type | IteratorDifference |
| The type of the difference of two of the underlying iterators. More... | |
| typedef thrust::counting_iterator< IteratorDifference > | CountingIterator |
| Type that is used to linearly increment a count. More... | |
| typedef thrust::transform_iterator< AdvancingFunctor, CountingIterator > | TransformIterator |
Type that applies AdvancingFunctor to the input sequence. More... | |
| typedef thrust::permutation_iterator< UnderlyingIterator, TransformIterator > | PermutationIterator |
Type that will be indexing into the UnderlyingIterator according to the TransformIterator. More... | |
| typedef PermutationIterator | Iterator |
| The effective iterator type. More... | |
Public Member Functions | |
| BunchIteratorRange (const UnderlyingIterator &start, const UnderlyingIterator &pastTheEnd_, const unsigned int bunchSize_, const unsigned int gapSize_) | |
| The constructor. More... | |
| Iterator | begin () const |
| Returns the first iterator in the effective range. More... | |
| Iterator | end () const |
| Returns the first past-the-end iterator of the effective range. More... | |
Wraps an iterator range such that it is grouped into "bunches" of a given length, with a configurable gap between bunches.
As an example, assume that one has an input iterator range that represents the sequence A_0, A_1, A_2, ..., A_N. If bunchSize is set to 3, gapSize is set to 2, and N = 11 (i.e. if the input sequence has 12 elements), this iterator range will iterate over the elements A_0, A_1, A_2, followed by A_5, A_6, A_7 (skipping the two elements A_3 and A_4), followed by A_10 and A_11, and end there since the input sequence is exhausted.
| UnderlyingIterator | The underlying iterator type. |
Definition at line 39 of file BunchIteratorRange.hpp.
| typedef thrust::counting_iterator<IteratorDifference> OpenMPCD::CUDA::BunchIteratorRange< UnderlyingIterator >::CountingIterator |
Type that is used to linearly increment a count.
Definition at line 113 of file BunchIteratorRange.hpp.
| typedef PermutationIterator OpenMPCD::CUDA::BunchIteratorRange< UnderlyingIterator >::Iterator |
The effective iterator type.
Definition at line 126 of file BunchIteratorRange.hpp.
| typedef thrust::iterator_difference<UnderlyingIterator>::type OpenMPCD::CUDA::BunchIteratorRange< UnderlyingIterator >::IteratorDifference |
The type of the difference of two of the underlying iterators.
Definition at line 45 of file BunchIteratorRange.hpp.
| typedef thrust::permutation_iterator< UnderlyingIterator, TransformIterator> OpenMPCD::CUDA::BunchIteratorRange< UnderlyingIterator >::PermutationIterator |
Type that will be indexing into the UnderlyingIterator according to the TransformIterator.
Definition at line 122 of file BunchIteratorRange.hpp.
| typedef thrust::transform_iterator<AdvancingFunctor, CountingIterator> OpenMPCD::CUDA::BunchIteratorRange< UnderlyingIterator >::TransformIterator |
Type that applies AdvancingFunctor to the input sequence.
Definition at line 117 of file BunchIteratorRange.hpp.
|
inline |
The constructor.
| OpenMPCD::InvalidArgumentException | If OPENMPCD_DEBUG is defined, throws if bunchSize_ == 0. |
| [in] | start | The first iterator to iterate over. |
| [in] | pastTheEnd_ | The first iterator that is past-the-end. |
| [in] | bunchSize_ | The bunch size, which must not be 0. |
| [in] | gapSize_ | The gap size. |
Definition at line 140 of file BunchIteratorRange.hpp.
|
inline |
Returns the first iterator in the effective range.
Definition at line 154 of file BunchIteratorRange.hpp.
|
inline |
Returns the first past-the-end iterator of the effective range.
Definition at line 166 of file BunchIteratorRange.hpp.
1.8.17