|
eLynx SDK
v3.3.0 C++ image processing API reference |
IterationRange represents half-open range [i,j) that can be recursively split. More...
#include <ParallelAlgorithms.h>
Public Member Functions | |
| IterationRange (size_t iBegin, size_t iEnd, size_t iGrainSize=1, size_t iMinSize=1, ESubRangePosition iPosition=SRP_ALL) | |
| Constructor. | |
| IterationRange | Split (size_t iSegment, size_t iIndex) |
| Split current range into two subranges. | |
| bool | IsEmpty () const |
| Tells whether subrange is empty (_begin == _end) or not. | |
| bool | IsSplitable () const |
| Tells whether subrange is splitable (_end - _begin >= _minSize) or not. | |
| size_t | GetBegin () const |
| size_t | GetEnd () const |
| bool | IsFirst () const |
| bool | IsMiddle () const |
| bool | IsLast () const |
| bool | IsAll () const |
Friends | |
| class | IterationRangeTask |
IterationRange represents half-open range [i,j) that can be recursively split.
The type of i and j must model random access iterators, raw pointers or integer types.
| eLynx::IterationRange::IterationRange | ( | size_t | iBegin, |
| size_t | iEnd, | ||
| size_t | iGrainSize = 1, |
||
| size_t | iMinSize = 1, |
||
| ESubRangePosition | iPosition = SRP_ALL |
||
| ) |
Constructor.
[iBegin, iEnd) must represent a valid range.
| iBegin | first range element. |
| iEnd | last range element. |
| iGrainSize | iEnd - iBegin after the split must be divisible by iGrainSize. |
| iMinSize | - minimal interval size. |
| iPosition | sub range position inside the original Iteration range. |
| bool eLynx::IterationRange::IsEmpty | ( | ) | const |
Tells whether subrange is empty (_begin == _end) or not.
| bool eLynx::IterationRange::IsSplitable | ( | ) | const |
Tells whether subrange is splitable (_end - _begin >= _minSize) or not.
| IterationRange eLynx::IterationRange::Split | ( | size_t | iSegment, |
| size_t | iIndex | ||
| ) |
Split current range into two subranges.
The first subrange is [_begin, _begin + (_end - _begin) / iCount). The second subrange is [_begin + (_end - _begin) / iCount, _end) .
| iCount | - the ratio to divide the range. |