HLIBpro  2.1
Public Member Functions | List of all members
TProcSet Class Reference

describes a processor set of continuously numbered processors

#include <TProcSet.hh>

Public Member Functions

 TProcSet (const uint ps_size=0)
 constructs set of size ps_size
 
 TProcSet (const uint ps_first, const uint ps_last)
 constructs set from ps_first to ps_last
 
 TProcSet (const TProcSet &ps)
 copy constructor
 
uint first () const
 return ID of first processor in set
 
uint last () const
 return ID of last processor in set
 
TProcSet subset (const uint i, const uint n=2) const
 return i´th subset in an n-partition of the local set More...
 
void split (const uint n, std::vector< TProcSet > &psets) const
 split processor set in n subsets (of approx. equal size) More...
 
TProcSet join (const TProcSet &ps) const
 return union with given procsessor set More...
 
bool is_in (const uint p) const
 return true if given proc is in set
 
uint size () const
 return size of set
 
uint master () const
 return id of master processor
 
TProcSetoperator= (const TProcSet &ps)
 copy operator
 
bool operator== (const TProcSet &ps) const
 equality operators
 
bool operator!= (const TProcSet &ps) const
 inequality operators
 
size_t byte_size () const
 return size in bytes used by this object
 
std::string to_string () const
 return string representation
 
void read (TByteStream &s)
 read data from stream
 
void write (TByteStream &s) const
 write data to stream
 
size_t bs_size () const
 returns size of object in bytestream
 

Member Function Documentation

TProcSet join ( const TProcSet ps) const
inline

Construct a processor set defined by minimum of first processor and maximum of last processor in both sets

void split ( const uint  n,
std::vector< TProcSet > &  psets 
) const
inline

Split local processor set into n subsets of approximately the same size and return the partition in psets

Parameters
nnumber of subsets to generate
psetsarray to store the subsets
TProcSet subset ( const uint  i,
const uint  n = 2 
) const
inline

Split local processor set into n subsets and return i'th subset.

Parameters
isubset to return
nnumber of subsets to split into