Thrill  0.1
Range Class Reference

Detailed Description

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

Definition at line 41 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() [1/2]

◆ Range() [2/2]

Range ( size_t  begin,
size_t  end 
)
inline

Definition at line 45 of file math.hpp.

Member Function Documentation

◆ CalculateBeginOfPart()

size_t CalculateBeginOfPart ( size_t  i,
size_t  parts 
) const
inline

Definition at line 91 of file math.hpp.

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

Referenced by Range::Partition().

◆ Contains()

bool Contains ( size_t  x) const
inline

true if the Range contains x

Definition at line 79 of file math.hpp.

References Range::end.

◆ FindPartition()

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 98 of file math.hpp.

References Range::size().

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

◆ Invalid()

static Range Invalid ( )
inlinestatic

Definition at line 47 of file math.hpp.

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

◆ IsEmpty()

◆ IsValid()

bool IsValid ( ) const
inline

◆ operator+()

Range operator+ ( const size_t &  shift) const
inline

return shifted Range

Definition at line 74 of file math.hpp.

References Range::Range().

◆ Partition()

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 85 of file math.hpp.

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

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

◆ size()

◆ Swap()

void Swap ( )
inline

swap boundaries, making a valid range invalid.

Definition at line 71 of file math.hpp.

References tlx::swap().

Friends And Related Function Documentation

◆ operator<<

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

ostream-able

Definition at line 103 of file math.hpp.

Member Data Documentation

◆ begin

◆ end


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