Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends

LibGeoDecomp::Region< DIM > Class Template Reference

Region stores a set of coordinates. More...

#include <region.h>

Collaboration diagram for LibGeoDecomp::Region< DIM >:
Collaboration graph
[legend]

List of all members.

Classes

class  Iterator

Public Types

typedef std::pair< int, int > IntPair
typedef std::vector< IntPairVecType
typedef RegionStreakIterator
< DIM, Region< DIM > > 
StreakIterator

Public Member Functions

 Region ()
template<class ITERATOR1 , class ITERATOR2 >
 Region (const ITERATOR1 &start, const ITERATOR2 &end)
template<class ITERATOR1 , class ITERATOR2 >
void load (const ITERATOR1 &start, const ITERATOR2 &end)
void clear ()
const CoordBox< DIM > & boundingBox () const
const std::size_t & size () const
std::size_t numStreaks () const
Region expand (const unsigned &width=1) const
template<typename TOPOLOGY >
Region expandWithTopology (const unsigned &width, const Coord< DIM > &dimensions, TOPOLOGY) const
 does the same as expand, but will wrap overlap at edges correctly.
bool operator== (const Region< DIM > &other) const
bool count (const Streak< DIM > &s) const
 Checks whether the Region includes the given Streak.
bool count (const Coord< DIM > &c) const
 Is the Coord contained withing the Region?
template<typename ADDEND >
void insert (const ADDEND &a)
 Alias for operator<<.
Regionoperator<< (const Streak< DIM > &s)
 Add all coordinates of the Streak to this Region.
Regionoperator<< (const Coord< DIM > &c)
Regionoperator<< (CoordBox< DIM > box)
Regionoperator>> (const Streak< DIM > &s)
 Remove the given Streak (or all of its coordinates) from the Region.
Regionoperator>> (const Coord< DIM > &c)
void operator-= (const Region &other)
Region operator- (const Region &other) const
 Equvalent to (A and (not B)) in sets, where other corresponds to B and *this corresponds to A.
void operator&= (const Region &other)
Region operator& (const Region &other) const
 Computes the intersection of both regions.
void operator+= (const Region &other)
Region operator+ (const Region &other) const
std::vector< Streak< DIM > > toVector () const
std::string toString () const
std::string prettyPrint () const
bool empty () const
StreakIterator beginStreak () const
StreakIterator endStreak () const
StreakIterator operator[] (const Coord< DIM > &offsets) const
 Returns an iterator whose internal iterators are set to the given offsets from the corresponding array starts.
StreakIterator operator[] (std::size_t offset) const
 Yields an iterator to the offset'th Streak in the Region.
Iterator begin () const
Iterator end () const
std::size_t indicesSize (std::size_t dim) const
VecType::const_iterator indicesAt (std::size_t dim, std::size_t offset) const
VecType::const_iterator indicesBegin (std::size_t dim) const
VecType::const_iterator indicesEnd (std::size_t dim) const

Private Member Functions

void determineGeometry () const
void resetGeometryCache () const
Streak< DIM > trimStreak (const Streak< DIM > &s, const Coord< DIM > &dimensions) const
template<typename TOPOLOGY >
void splitStreak (const Streak< DIM > &streak, Region *target, const Coord< DIM > &dimensions) const
template<typename TOPOLOGY >
void normalizeStreak (const Streak< DIM > &streak, Region *target, const Coord< DIM > &dimensions) const

Private Attributes

VecType indices [DIM]
CoordBox< DIM > myBoundingBox
std::size_t mySize
bool geometryCacheTainted

Friends

class Serialization
class RegionHelpers::RegionLookupHelper
class RegionHelpers::RegionInsertHelper
class RegionHelpers::RegionRemoveHelper
class LibGeoDecomp::RegionTest

Detailed Description

template<int DIM>
class LibGeoDecomp::Region< DIM >

Region stores a set of coordinates.

It performs a run-length coding. Instead of storing complete Streak objects, these objects get split up and are stored implicitly in the hierarchical indices vectors.


Member Typedef Documentation

template<int DIM>
typedef std::pair<int, int> LibGeoDecomp::Region< DIM >::IntPair
template<int DIM>
typedef RegionStreakIterator<DIM, Region<DIM> > LibGeoDecomp::Region< DIM >::StreakIterator
template<int DIM>
typedef std::vector<IntPair> LibGeoDecomp::Region< DIM >::VecType

Constructor & Destructor Documentation

template<int DIM>
LibGeoDecomp::Region< DIM >::Region (  )  [inline]
template<int DIM>
template<class ITERATOR1 , class ITERATOR2 >
LibGeoDecomp::Region< DIM >::Region ( const ITERATOR1 &  start,
const ITERATOR2 &  end 
) [inline]

Member Function Documentation

template<int DIM>
Iterator LibGeoDecomp::Region< DIM >::begin (  )  const [inline]
template<int DIM>
StreakIterator LibGeoDecomp::Region< DIM >::beginStreak (  )  const [inline]
template<int DIM>
const CoordBox<DIM>& LibGeoDecomp::Region< DIM >::boundingBox (  )  const [inline]
template<int DIM>
void LibGeoDecomp::Region< DIM >::clear (  )  [inline]
template<int DIM>
bool LibGeoDecomp::Region< DIM >::count ( const Streak< DIM > &  s  )  const [inline]

Checks whether the Region includes the given Streak.

template<int DIM>
bool LibGeoDecomp::Region< DIM >::count ( const Coord< DIM > &  c  )  const [inline]

Is the Coord contained withing the Region?

template<int DIM>
void LibGeoDecomp::Region< DIM >::determineGeometry (  )  const [inline, private]
template<int DIM>
bool LibGeoDecomp::Region< DIM >::empty (  )  const [inline]
template<int DIM>
Iterator LibGeoDecomp::Region< DIM >::end (  )  const [inline]
template<int DIM>
StreakIterator LibGeoDecomp::Region< DIM >::endStreak (  )  const [inline]
template<int DIM>
Region LibGeoDecomp::Region< DIM >::expand ( const unsigned width = 1  )  const [inline]
template<int DIM>
template<typename TOPOLOGY >
Region LibGeoDecomp::Region< DIM >::expandWithTopology ( const unsigned width,
const Coord< DIM > &  dimensions,
TOPOLOGY   
) const [inline]

does the same as expand, but will wrap overlap at edges correctly.

The instance of the TOPOLOGY is actually unused, but without it g++ would complain...

Referenced by LibGeoDecomp::PartitionManager< Topology >::fillRegion().

template<int DIM>
VecType::const_iterator LibGeoDecomp::Region< DIM >::indicesAt ( std::size_t  dim,
std::size_t  offset 
) const [inline]
template<int DIM>
VecType::const_iterator LibGeoDecomp::Region< DIM >::indicesBegin ( std::size_t  dim  )  const [inline]
template<int DIM>
VecType::const_iterator LibGeoDecomp::Region< DIM >::indicesEnd ( std::size_t  dim  )  const [inline]
template<int DIM>
std::size_t LibGeoDecomp::Region< DIM >::indicesSize ( std::size_t  dim  )  const [inline]
template<int DIM>
template<typename ADDEND >
void LibGeoDecomp::Region< DIM >::insert ( const ADDEND &  a  )  [inline]

Alias for operator<<.

template<int DIM>
template<class ITERATOR1 , class ITERATOR2 >
void LibGeoDecomp::Region< DIM >::load ( const ITERATOR1 &  start,
const ITERATOR2 &  end 
) [inline]
template<int DIM>
template<typename TOPOLOGY >
void LibGeoDecomp::Region< DIM >::normalizeStreak ( const Streak< DIM > &  streak,
Region< DIM > *  target,
const Coord< DIM > &  dimensions 
) const [inline, private]
template<int DIM>
std::size_t LibGeoDecomp::Region< DIM >::numStreaks (  )  const [inline]
template<int DIM>
Region LibGeoDecomp::Region< DIM >::operator& ( const Region< DIM > &  other  )  const [inline]

Computes the intersection of both regions.

template<int DIM>
void LibGeoDecomp::Region< DIM >::operator&= ( const Region< DIM > &  other  )  [inline]
template<int DIM>
Region LibGeoDecomp::Region< DIM >::operator+ ( const Region< DIM > &  other  )  const [inline]
template<int DIM>
void LibGeoDecomp::Region< DIM >::operator+= ( const Region< DIM > &  other  )  [inline]
template<int DIM>
Region LibGeoDecomp::Region< DIM >::operator- ( const Region< DIM > &  other  )  const [inline]

Equvalent to (A and (not B)) in sets, where other corresponds to B and *this corresponds to A.

template<int DIM>
void LibGeoDecomp::Region< DIM >::operator-= ( const Region< DIM > &  other  )  [inline]
template<int DIM>
Region& LibGeoDecomp::Region< DIM >::operator<< ( const Streak< DIM > &  s  )  [inline]

Add all coordinates of the Streak to this Region.

template<int DIM>
Region& LibGeoDecomp::Region< DIM >::operator<< ( const Coord< DIM > &  c  )  [inline]
template<int DIM>
Region& LibGeoDecomp::Region< DIM >::operator<< ( CoordBox< DIM >  box  )  [inline]
template<int DIM>
bool LibGeoDecomp::Region< DIM >::operator== ( const Region< DIM > &  other  )  const [inline]
template<int DIM>
Region& LibGeoDecomp::Region< DIM >::operator>> ( const Coord< DIM > &  c  )  [inline]
template<int DIM>
Region& LibGeoDecomp::Region< DIM >::operator>> ( const Streak< DIM > &  s  )  [inline]

Remove the given Streak (or all of its coordinates) from the Region.

Takes into account that not all (or none) of the coordinates may have been contained in the Region before.

template<int DIM>
StreakIterator LibGeoDecomp::Region< DIM >::operator[] ( const Coord< DIM > &  offsets  )  const [inline]

Returns an iterator whose internal iterators are set to the given offsets from the corresponding array starts.

Runs in O(1) time.

template<int DIM>
StreakIterator LibGeoDecomp::Region< DIM >::operator[] ( std::size_t  offset  )  const [inline]

Yields an iterator to the offset'th Streak in the Region.

Runs in O(log n) time.

template<int DIM>
std::string LibGeoDecomp::Region< DIM >::prettyPrint (  )  const [inline]
template<int DIM>
void LibGeoDecomp::Region< DIM >::resetGeometryCache (  )  const [inline, private]
template<int DIM>
const std::size_t& LibGeoDecomp::Region< DIM >::size (  )  const [inline]
template<int DIM>
template<typename TOPOLOGY >
void LibGeoDecomp::Region< DIM >::splitStreak ( const Streak< DIM > &  streak,
Region< DIM > *  target,
const Coord< DIM > &  dimensions 
) const [inline, private]
template<int DIM>
std::string LibGeoDecomp::Region< DIM >::toString (  )  const [inline]
template<int DIM>
std::vector<Streak<DIM> > LibGeoDecomp::Region< DIM >::toVector (  )  const [inline]
template<int DIM>
Streak<DIM> LibGeoDecomp::Region< DIM >::trimStreak ( const Streak< DIM > &  s,
const Coord< DIM > &  dimensions 
) const [inline, private]

Friends And Related Function Documentation

template<int DIM>
friend class LibGeoDecomp::RegionTest [friend]
template<int DIM>
friend class RegionHelpers::RegionInsertHelper [friend]
template<int DIM>
friend class RegionHelpers::RegionLookupHelper [friend]
template<int DIM>
friend class RegionHelpers::RegionRemoveHelper [friend]
template<int DIM>
friend class Serialization [friend]

Member Data Documentation

template<int DIM>
bool LibGeoDecomp::Region< DIM >::geometryCacheTainted [mutable, private]
template<int DIM>
VecType LibGeoDecomp::Region< DIM >::indices[DIM] [private]
template<int DIM>
CoordBox<DIM> LibGeoDecomp::Region< DIM >::myBoundingBox [mutable, private]
template<int DIM>
std::size_t LibGeoDecomp::Region< DIM >::mySize [mutable, private]

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