Regina Calculation Engine
|
Represents a pair of tetrahedron face numbers. More...
#include <triangulation/nfacepair.h>
Public Member Functions | |
NFacePair () | |
Creates a new face pair (0,1). More... | |
NFacePair (int newFirst, int newSecond) | |
Creates a new face pair from the two given face numbers. More... | |
NFacePair (const NFacePair &cloneMe) | |
Creates a new face pair that is a clone of the given pair. More... | |
unsigned | lower () const |
Returns the smaller of the two face numbers in this pair. More... | |
unsigned | upper () const |
Returns the larger of the two face numbers in this pair. More... | |
bool | isBeforeStart () const |
Determines if this face pair represents a before-the-start value. More... | |
bool | isPastEnd () const |
Determines if this face pair represents a past-the-end value. More... | |
NFacePair | complement () const |
Returns the complement of this face pair. More... | |
NFacePair & | operator= (const NFacePair &cloneMe) |
Sets this face pair to be a copy of the given pair. More... | |
bool | operator== (const NFacePair &other) const |
Determines if this and the given face pair are equal. More... | |
bool | operator< (const NFacePair &other) const |
Determines if this is less than the given face pair. More... | |
bool | operator> (const NFacePair &other) const |
Determines if this is greater than the given face pair. More... | |
bool | operator<= (const NFacePair &other) const |
Determines if this is less than or equal to the given face pair. More... | |
bool | operator>= (const NFacePair &other) const |
Determines if this is greater than or equal to the given face pair. More... | |
void | operator++ (int) |
Increments this face pair. More... | |
void | operator-- (int) |
Decrements this face pair. More... | |
Represents a pair of tetrahedron face numbers.
Note that we are not storing triangle numbers in a triangulation skeleton, but merely face numbers 0, 1, 2 and 3 in a single tetrahedron. Thus there are only six possible face pairs; this class merely makes working with such pairs more convenient.
As well as providing the six possible face pairs, there is also a before-the-start and a past-the-end value; this (combined with the increment operator) allows for iteration through face pairs.
When iterating through face pairs, the ordering will be the lexicographical ordering (0,1), (0,2), (0,3), (1,2), (1,3), (2,3).
The before-the-start and past-the-end values are internally represented as (0,0) and (3,3) respectively.
|
inline |
Creates a new face pair (0,1).
regina::NFacePair::NFacePair | ( | int | newFirst, |
int | newSecond | ||
) |
Creates a new face pair from the two given face numbers.
The two given numbers need not be in any particular order.
newFirst | the first face number in the new pair. |
newSecond | the second face number in the new pair. |
|
inline |
Creates a new face pair that is a clone of the given pair.
cloneMe | the face pair to clone. |
NFacePair regina::NFacePair::complement | ( | ) | const |
Returns the complement of this face pair.
The complement is the pair containing the two faces not included in this face pair.
|
inline |
Determines if this face pair represents a before-the-start value.
true
if and only if this face pair is before-the-start.
|
inline |
Determines if this face pair represents a past-the-end value.
true
if and only if this face pair is past-the-end.
|
inline |
Returns the smaller of the two face numbers in this pair.
void regina::NFacePair::operator++ | ( | int | ) |
Increments this face pair.
It will be set to the following face pair in the lexicographical ordering, or to a past-the-end value if there are no more face pairs.
void regina::NFacePair::operator-- | ( | int | ) |
Decrements this face pair.
It will be set to the previous face pair in the lexicographical ordering, or to a before-the-start value if there are no previous face pairs.
|
inline |
Determines if this is less than the given face pair.
other | the pair to compare with this. |
true
if and only if this is less than other.
|
inline |
Determines if this is less than or equal to the given face pair.
other | the pair to compare with this. |
true
if and only if this is less than or equal to other. Sets this face pair to be a copy of the given pair.
cloneMe | the face pair to clone. |
|
inline |
Determines if this and the given face pair are equal.
other | the pair to compare with this. |
true
if and only if this and the given pair are equal.
|
inline |
Determines if this is greater than the given face pair.
other | the pair to compare with this. |
true
if and only if this is greater than other.
|
inline |
Determines if this is greater than or equal to the given face pair.
other | the pair to compare with this. |
true
if and only if this is greater than or equal to other.
|
inline |
Returns the larger of the two face numbers in this pair.