Regina 7.3 Calculation Engine
|
Describes the cellular decomposition of the sphere that is induced by a given planar 4-valent graph. More...
#include <link/modellinkgraph.h>
Public Types | |
using | ArcIterator = const ModelLinkGraphArc * |
An iterator type used when traversing the boundary of a 2-cell. More... | |
Public Member Functions | |
~ModelLinkGraphCells () | |
Destroys this cellular decomposition. More... | |
bool | isValid () const |
Determines whether the underlying graph is non-empty with a planar embedding, assuming that it is already known to be connected. More... | |
size_t | countCells () const |
Returns the number of 2-cells in this cellular decomposition. More... | |
size_t | size (size_t cell) const |
Returns the number of arcs aloung the boundary of the given 2-cell. More... | |
const ModelLinkGraphArc & | arc (size_t cell, size_t which) const |
Returns the given arc along the boundary of the given 2-cell. More... | |
auto | arcs (size_t cell) const |
Returns an object that allows iteration through and random access to all arcs along the boundary of the given 2-cell. More... | |
ArcIterator | begin (size_t cell) const |
Returns the beginning of an iterator range for walking around the boundary of the given 2-cell. More... | |
ArcIterator | end (size_t cell) const |
Returns the end of an iterator range for walking around the boundary of the given 2-cell. More... | |
size_t | cell (const ModelLinkGraphArc &arc) const |
Returns the 2-cell that lies to the left of the given arc. More... | |
size_t | cellPos (const ModelLinkGraphArc &arc) const |
Returns where the given arc appears along the boundary of the 2-cell to its left. More... | |
bool | operator== (const ModelLinkGraphCells &other) const |
Determines if this and the given cellular decomposition are combinatorially identical. More... | |
bool | operator!= (const ModelLinkGraphCells &other) const |
Determines if this and the given cellular decomposition are not combinatorially identical. More... | |
void | writeTextShort (std::ostream &out) const |
Writes a short text representation of this object to the given output stream. More... | |
void | writeTextLong (std::ostream &out) const |
Writes a detailed text representation of this object to the given output stream. More... | |
ModelLinkGraphCells & | operator= (const ModelLinkGraphCells &)=delete |
std::string | str () const |
Returns a short text representation of this object. More... | |
std::string | utf8 () const |
Returns a short text representation of this object using unicode characters. More... | |
std::string | detail () const |
Returns a detailed text representation of this object. More... | |
Friends | |
class | ModelLinkGraph |
Describes the cellular decomposition of the sphere that is induced by a given planar 4-valent graph.
The graph is represented by an object of type ModelLinkGraph, which also encodes a specific planar embedding of the graph. The nodes and arcs of this graph then form the vertices and edges of a cellular decomposition; the main purpose of this class is to deduce and describe the resulting 2-cells.
At present, this class insists that each 2-cell is a topological disc. As a consequence, this class cannot work with empty or disconnected graphs.
Cellular decompositions do not support value semantics: they cannot be copied, swapped, or manually constructed. Instead they are computed properties of model graphs, and are only accessible via const reference through the member function ModelLinkGraph::cells().
using regina::ModelLinkGraphCells::ArcIterator = const ModelLinkGraphArc* |
An iterator type used when traversing the boundary of a 2-cell.
|
inline |
Destroys this cellular decomposition.
|
inline |
Returns the given arc along the boundary of the given 2-cell.
For each cell, the arcs along the boundary are given in order as you walk anticlockwise around the cell (so the cell is on the left of each arc as you walk around the cell boundary).
Each arc is described in the form of an outgoing arc from some node of the underlying graph (so if the return ModelLinkGraphArc is a then this describes an outgoing arc from a.node()). It follows that, if the underlying graph has n nodes, then each of the 4n possible ModelLinkGraphArc values appears exactly once as arc(cell, which)
for some integers cell and which.
cell | indicates which cell to query; this must be between 0 and countCells()-1 inclusive. |
which | indicates which arc along the boundary of the corresponding cell to return; this must be between 0 and size(cell)-1 inclusive. |
|
inline |
Returns an object that allows iteration through and random access to all arcs along the boundary of the given 2-cell.
Suppose that the ith cell is a k-gon. Then this object gives access to the k arcs along the boundary of the ith cell in the same order as described by arc(); that is, walking anticlockwise around the cell boundary with the cell to the left of each arc.
The object that is returned is lightweight, and can be happily copied by value. The C++ type of the object is subject to change, so C++ users should use auto
(just like this declaration does).
The returned object is guaranteed to be an instance of ListView, which means it offers basic container-like functions and supports range-based for
loops. The elements of the list will be read-only objects of type ModelLinkGraphArc, and so your code might look like:
Using arcs(cell)
is equivalent to iterating over the iterator range (begin(cell)
, end(cell)
). Using arcs() generates a tiny amount of extra overhead, but you may also find it more readable.
cell | indicates which cell to query; this must be between 0 and countCells()-1 inclusive. |
|
inline |
Returns the beginning of an iterator range for walking around the boundary of the given 2-cell.
Suppose that the ith cell is a k-gon. Then the iterator range described by begin(i)
and end(i)
will iterate through the k arcs along the boundary of the ith cell in the same order as described by arc(); that is, walking anticlockwise around the cell boundary with the cell to the left of each arc.
Dereferencing the jth iterator in this range gives the same result as calling arc(cell, j)
, and iterating over the entire range (begin(cell)
, end(cell)
) is equivalent to iterating over arcs(cell)
.
|
inline |
Returns the 2-cell that lies to the left of the given arc.
Specifically, this function returns the number of the cell that lies to the left of the given arc as you walk along it away from arc.node()
.
For any arc a, calling arc(cell(a), cellPos(a))
will return the same arc a again.
arc | the given arc of the underlying graph. |
countCells()-1
inclusive.
|
inline |
Returns where the given arc appears along the boundary of the 2-cell to its left.
Consider the cell c to the left of the given arc as you follow the arc away from arc.node()
. The routine arc() can be used to enumerate the sequence of arcs along the boundary of this cell c, in order as you walk anticlockwise around the cell boundary. The purpose of this routine is to identify where in this sequence the given arc occurs.
For any arc a, calling arc(cell(a), cellPos(a))
will return the same arc a again.
arc | the given arc of the underlying graph. |
size(cell(arc))-1
inclusive.
|
inline |
Returns the number of 2-cells in this cellular decomposition.
If isValid() returns false
(i.e., the underlying ModelLinkGraph is either empty or does not describe a planar embedding), then this routine will return 0 instead. Note that this routine cannot be used to test for connectivity, which is a non-negotiable precondition required by the class constructor.
Note that, if isValid() returns true
, then countCells() will always return n+2 where n is the number of nodes in the underlying graph.
|
inherited |
Returns a detailed text representation of this object.
This text may span many lines, and should provide the user with all the information they could want. It should be human-readable, should not contain extremely long lines (which cause problems for users reading the output in a terminal), and should end with a final newline. There are no restrictions on the underlying character set.
|
inline |
Returns the end of an iterator range for walking around the boundary of the given 2-cell.
As is usual for iterator ranges, this is a past-the-end value (i.e., this iterator cannot be dereferenced).
Suppose that the ith cell is a k-gon. Then the iterator range described by begin(i)
and end(i)
will iterate through the k arcs along the boundary of the ith cell in the same order as described by arc(); that is, walking anticlockwise around the cell boundary with the cell to the left of each arc.
Dereferencing the jth iterator in this range gives the same result as calling arc(cell, j)
, and iterating over the entire range (begin(cell)
, end(cell)
) is equivalent to iterating over arcs(cell)
.
|
inline |
Determines whether the underlying graph is non-empty with a planar embedding, assuming that it is already known to be connected.
As described in the class notes, this class can only work with non-empty connected graphs where the corresponding ModelLinkGraph object also describes a planar embedding.
The constructor for this class requires you to pass a graph that is already known to be connected. However, assuming the graph is connected, the constructor then tests for the remaining conditions. This routine returns the results of these tests: if the underlying graph is empty or does not describe a planar embedding, then this routine will return false
.
This routine is constant time, since the necessary work will have already been completed by the class constructor.
true
. Essentially, if isValid() returns false
, you should not attempt to query the details of the cell decomposition. See the preconditions on individual routines for further details.true
if and only if the underlying ModelLinkGraph describes a planar embedding of a non-empty graph.
|
inline |
Determines if this and the given cellular decomposition are not combinatorially identical.
Here "identical" means that both decompositions have the same number of cells, these cells are presented in the same order, and their boundaries enter and exit the same numbered arcs of the same numbered nodes, using the same directions of traversal and the same starting points on each cell boundary.
other | the cellular decomposition to compare with this. |
true
if and only if the two cellular decompositions are not combinatorially identical. bool regina::ModelLinkGraphCells::operator== | ( | const ModelLinkGraphCells & | other | ) | const |
Determines if this and the given cellular decomposition are combinatorially identical.
Here "identical" means that both decompositions have the same number of cells, these cells are presented in the same order, and their boundaries enter and exit the same numbered arcs of the same numbered nodes, using the same directions of traversal and the same starting points on each cell boundary.
other | the cellular decomposition to compare with this. |
true
if and only if the two cellular decompositions are combinatorially identical.
|
inline |
Returns the number of arcs aloung the boundary of the given 2-cell.
If the given cell is a k-gon, then this routine returns the integer k.
cell | indicates which cell to query; this must be between 0 and countCells()-1 inclusive. |
|
inherited |
Returns a short text representation of this object.
This text should be human-readable, should use plain ASCII characters where possible, and should not contain any newlines.
Within these limits, this short text ouptut should be as information-rich as possible, since in most cases this forms the basis for the Python __str__()
and __repr__()
functions.
__str__()
will use precisely this function, and for most classes the Python __repr__()
function will incorporate this into its output.
|
inherited |
Returns a short text representation of this object using unicode characters.
Like str(), this text should be human-readable, should not contain any newlines, and (within these constraints) should be as information-rich as is reasonable.
Unlike str(), this function may use unicode characters to make the output more pleasant to read. The string that is returned will be encoded in UTF-8.
void regina::ModelLinkGraphCells::writeTextLong | ( | std::ostream & | out | ) | const |
Writes a detailed text representation of this object to the given output stream.
out | the output stream to which to write. |
void regina::ModelLinkGraphCells::writeTextShort | ( | std::ostream & | out | ) | const |
Writes a short text representation of this object to the given output stream.
out | the output stream to which to write. |