Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Range Class Reference

Detailed Description

represents a 1 dimensional range (interval) [begin,end)

Definition at line 40 of file math.hpp.

#include <math.hpp>

Public Member Functions

 Range ()=default
 
 Range (size_t begin, size_t end)
 
size_t CalculateBeginOfPart (size_t i, size_t parts) const
 
bool Contains (size_t x) const
 true if the Range contains x More...
 
size_t FindPartition (size_t index, size_t parts) const
 
bool IsEmpty () const
 range is empty (begin == end) More...
 
bool IsValid () const
 valid non-empty range (begin < end) More...
 
Range operator+ (const size_t &shift) const
 return shifted Range More...
 
Range Partition (size_t i, size_t parts) const
 
size_t size () const
 size of range More...
 
void Swap ()
 swap boundaries, making a valid range invalid. More...
 

Static Public Member Functions

static Range Invalid ()
 

Public Attributes

Attributes
size_t begin = 0
 begin index More...
 
size_t end = 0
 end index More...
 

Friends

std::ostream & operator<< (std::ostream &os, const Range &r)
 ostream-able More...
 

Constructor & Destructor Documentation

Range ( )
default
Range ( size_t  begin,
size_t  end 
)
inline

Definition at line 44 of file math.hpp.

Member Function Documentation

size_t CalculateBeginOfPart ( size_t  i,
size_t  parts 
) const
inline

Definition at line 90 of file math.hpp.

References Range::begin, and Range::size().

Referenced by Range::Partition().

bool Contains ( size_t  x) const
inline

true if the Range contains x

Definition at line 78 of file math.hpp.

References Range::begin, and Range::end.

size_t FindPartition ( size_t  index,
size_t  parts 
) const
inline

calculate the partition (ranging from 0 to parts - 1) into which index falls

Definition at line 97 of file math.hpp.

References Range::begin, and Range::size().

Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Insert().

static Range Invalid ( )
inlinestatic

Definition at line 46 of file math.hpp.

References thrill::common::max(), thrill::common::min(), and Range::Range().

bool IsValid ( ) const
inline
Range operator+ ( const size_t &  shift) const
inline

return shifted Range

Definition at line 73 of file math.hpp.

References Range::begin, Range::end, and Range::Range().

Range Partition ( size_t  i,
size_t  parts 
) const
inline

calculate a partition range [begin,end) by taking the current Range splitting it into p parts and taking the i-th one.

Definition at line 84 of file math.hpp.

References Range::CalculateBeginOfPart(), and Range::Range().

Referenced by thrill::common::CalculateLocalRange(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize().

void Swap ( )
inline

swap boundaries, making a valid range invalid.

Definition at line 70 of file math.hpp.

References Range::begin, Range::end, and tlx::swap().

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Range r 
)
friend

ostream-able

Definition at line 102 of file math.hpp.

Member Data Documentation


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