#include <hindexingpartition.h>
Inherits LibGeoDecomp::SpaceFillingCurve::Iterator.
Public Member Functions | |
Iterator (const Coord< 2 > &_origin, const Coord< 2 > &dimensions, const unsigned &pos=0) | |
Returns an iterator that will traverse the rectangle specified by _origin and dimensions. | |
Iterator (const Coord< 2 > &origin, const unsigned &initType, const Coord< 2 > &dimensions) | |
Returns an iterator that will traverse only the rectangle of type initType. | |
Iterator (const Coord< 2 > &_origin) | |
Returns an "end" iterator, meaning that the iterator will be frozen at position origin. | |
Iterator & | operator++ () |
Private Member Functions | |
void | digUp () |
Ripple carry bits up and clean up completed triangles. | |
void | digDown () |
Initialize lower level triangles. | |
void | digDownCached (const Triangle &triangle, const unsigned &counter=0) |
void | digDownTrivial (const Triangle &triangle, const unsigned &counter=0) |
bool | traceTriangle (const Triangle &curTria, unsigned *remainder) |
Finds the triangle in curTria, in which the coordinate with position remainder is located. | |
void | skipSubTriangles (const Triangle &curTria, unsigned *remainder) |
Finds the sub triangle of curTria, in which the position on the SFC remainder resides. | |
void | nextSublevel () |
void | nextTrivial () |
void | nextCached () |
bool | sublevelTriangleFinished () const |
bool | trivialTriangleFinished () const |
bool | cachedTriangleFinished () const |
bool | isCached (const Coord< 2 > &dimensions) const |
Static Private Member Functions | |
static void | nextSubTriangle (Triangle *triangle) |
static void | newOriginAndDimensions (Coord< 2 > *curOri, Coord< 2 > *curDim, const int &curType, const int &curCounter) |
static Coord< 2 > | newOrigin (const int &curType, const int &curCounter, const int &leftHalf, const int &rightHalf, const int &upperHalf, const int &lowerHalf, const int &x, const int &y) |
static Coord< 2 > | subtriangleDimensions (const Coord< 2 > &dimensions, const unsigned &type) |
static unsigned | triangleLength (const Triangle &triangle) |
static unsigned | triangleLength (const Coord< 2 > &dimensions, const unsigned &type) |
Private Attributes | |
std::vector< Triangle > | triangleStack |
Coord< 2 > | cachedTriangleOrigin |
Coord< 2 > * | cachedTriangleCoordsIterator |
Coord< 2 > * | cachedTriangleCoordsEnd |
Coord< 2 > | trivialTriangleDirection |
unsigned | trivialTriangleType |
unsigned | trivialTriangleCounter |
unsigned | trivialTriangleLength |
Friends | |
class | HIndexingPartitionTest |
LibGeoDecomp::HIndexingPartition::Iterator::Iterator | ( | const Coord< 2 > & | _origin, | |
const Coord< 2 > & | dimensions, | |||
const unsigned & | pos = 0 | |||
) | [inline] |
Returns an iterator that will traverse the rectangle specified by _origin and dimensions.
Traversal will start at position pos according to the SFC linearization.
References LibGeoDecomp::pop().
LibGeoDecomp::HIndexingPartition::Iterator::Iterator | ( | const Coord< 2 > & | origin, | |
const unsigned & | initType, | |||
const Coord< 2 > & | dimensions | |||
) | [inline] |
Returns an iterator that will traverse only the rectangle of type initType.
LibGeoDecomp::HIndexingPartition::Iterator::Iterator | ( | const Coord< 2 > & | _origin | ) | [inline, explicit] |
Returns an "end" iterator, meaning that the iterator will be frozen at position origin.
bool LibGeoDecomp::HIndexingPartition::Iterator::cachedTriangleFinished | ( | ) | const [inline, private] |
void LibGeoDecomp::HIndexingPartition::Iterator::digDown | ( | ) | [inline, private] |
Initialize lower level triangles.
References LibGeoDecomp::HIndexingPartition::Triangle::dimensions, and LibGeoDecomp::pop().
void LibGeoDecomp::HIndexingPartition::Iterator::digUp | ( | ) | [inline, private] |
Ripple carry bits up and clean up completed triangles.
bool LibGeoDecomp::HIndexingPartition::Iterator::isCached | ( | const Coord< 2 > & | dimensions | ) | const [inline, private] |
References LibGeoDecomp::Coord< 2 >::x(), and LibGeoDecomp::Coord< 2 >::y().
static Coord<2> LibGeoDecomp::HIndexingPartition::Iterator::newOrigin | ( | const int & | curType, | |
const int & | curCounter, | |||
const int & | leftHalf, | |||
const int & | rightHalf, | |||
const int & | upperHalf, | |||
const int & | lowerHalf, | |||
const int & | x, | |||
const int & | y | |||
) | [inline, static, private] |
static void LibGeoDecomp::HIndexingPartition::Iterator::newOriginAndDimensions | ( | Coord< 2 > * | curOri, | |
Coord< 2 > * | curDim, | |||
const int & | curType, | |||
const int & | curCounter | |||
) | [inline, static, private] |
References LibGeoDecomp::Coord< 2 >::x(), and LibGeoDecomp::Coord< 2 >::y().
void LibGeoDecomp::HIndexingPartition::Iterator::nextCached | ( | ) | [inline, private] |
void LibGeoDecomp::HIndexingPartition::Iterator::nextSublevel | ( | ) | [inline, private] |
References LibGeoDecomp::TRIVIAL.
static void LibGeoDecomp::HIndexingPartition::Iterator::nextSubTriangle | ( | Triangle * | triangle | ) | [inline, static, private] |
void LibGeoDecomp::HIndexingPartition::Iterator::nextTrivial | ( | ) | [inline, private] |
Iterator& LibGeoDecomp::HIndexingPartition::Iterator::operator++ | ( | ) | [inline] |
void LibGeoDecomp::HIndexingPartition::Iterator::skipSubTriangles | ( | const Triangle & | curTria, | |
unsigned * | remainder | |||
) | [inline, private] |
Finds the sub triangle of curTria, in which the position on the SFC remainder resides.
bool LibGeoDecomp::HIndexingPartition::Iterator::sublevelTriangleFinished | ( | ) | const [inline, private] |
References LibGeoDecomp::TRIVIAL.
static Coord<2> LibGeoDecomp::HIndexingPartition::Iterator::subtriangleDimensions | ( | const Coord< 2 > & | dimensions, | |
const unsigned & | type | |||
) | [inline, static, private] |
bool LibGeoDecomp::HIndexingPartition::Iterator::traceTriangle | ( | const Triangle & | curTria, | |
unsigned * | remainder | |||
) | [inline, private] |
Finds the triangle in curTria, in which the coordinate with position remainder is located.
Returns true if recursion is necessary to check the resulting sub triangle.
References LibGeoDecomp::HIndexingPartition::Triangle::dimensions.
bool LibGeoDecomp::HIndexingPartition::Iterator::trivialTriangleFinished | ( | ) | const [inline, private] |
friend class HIndexingPartitionTest [friend] |
Coord<2>* LibGeoDecomp::HIndexingPartition::Iterator::cachedTriangleCoordsEnd [private] |
Coord<2>* LibGeoDecomp::HIndexingPartition::Iterator::cachedTriangleCoordsIterator [private] |
Coord<2> LibGeoDecomp::HIndexingPartition::Iterator::cachedTriangleOrigin [private] |
std::vector<Triangle> LibGeoDecomp::HIndexingPartition::Iterator::triangleStack [private] |
Coord<2> LibGeoDecomp::HIndexingPartition::Iterator::trivialTriangleDirection [private] |