eLynx SDK v3.3.0
C++ image processing API reference
Public Member Functions | Friends

eLynx::IterationRange Class Reference

IterationRange represents half-open range [i,j) that can be recursively split. More...

#include <ParallelAlgorithms.h>

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
iBeginfirst range element.
iEndlast range element.
iGrainSizeiEnd - iBegin after the split must be divisible by iGrainSize.
iMinSize- minimal interval size.
iPositionsub range position inside the original Iteration range.

Member Function Documentation

bool eLynx::IterationRange::IsEmpty (  ) const

Tells whether subrange is empty (_begin == _end) or not.

Returns:
true if subrange is empty.
bool eLynx::IterationRange::IsSplitable (  ) const

Tells whether subrange is splitable (_end - _begin >= _minSize) or not.

Returns:
true if subrange is empty.
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) .

Parameters:
iCount- the ratio to divide the range.
Returns:
first subrange.

The documentation for this class was generated from the following file:

Generated on Thu Dec 9 2010 by doxygen 1.7.2