Regina Calculation Engine
Public Member Functions | Friends | List of all members
regina::ModelLinkGraphNode Class Reference

Represents a single node in a model graph for a knot or link. More...

#include <link/modellinkgraph.h>

Inheritance diagram for regina::ModelLinkGraphNode:
regina::MarkedElement regina::Output< ModelLinkGraphNode >

Public Member Functions

int index () const
 Returns the index of this node within the overall graph. More...
 
ModelLinkGraphArc arc (int which)
 Returns a reference to one of the four arcs of the graph that exit this node. More...
 
const ModelLinkGraphArcadj (int which) const
 Returns the arc at the other end of the given graph edge that exits this node. More...
 
void writeTextShort (std::ostream &out) const
 
Writes a short text representation of this node to the given output stream. More...
 
void writeTextLong (std::ostream &out) const
 
Writes a detailed text representation of this node to the given output stream. More...
 
 ModelLinkGraphNode (const ModelLinkGraphNode &)=delete
 
ModelLinkGraphNodeoperator= (const ModelLinkGraphNode &)=delete
 
size_t markedIndex () const
 Returns the index at which this object is stored in an MarkedVector. More...
 
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
 

Detailed Description

Represents a single node in a model graph for a knot or link.

If a graph has n nodes, then these are numbered 0,...,n-1. The number assigned to this node can be accessed by calling index(). Note that nodes may be reindexed when other nodes are added or removed - if you wish to track a particular node through such operations then you should use a pointer to the relevant ModelLinkGraphNode instead.

Member Function Documentation

◆ adj()

const ModelLinkGraphArc & regina::ModelLinkGraphNode::adj ( int  which) const
inline

Returns the arc at the other end of the given graph edge that exits this node.

Let e be the undirected edge of the underlying model graph that corresponds to the given outgoing arc from this node. Recall that there are two ModelLinkGraphArc objects corresponding to e, one for each of its endpoints. One of these will be ModelLinkGraphArc(this, which); this routine returns the other object, which is the ModelLinkGraphArc describing the other endpoint of e.

Note that for a node n, calling n.adj(i) is equivalent to calling n.arc(i).traverse().

Parameters
whichan integer in the range 0 to 3 inclusive, indicating which of the four arcs exiting this node we should examine.
Returns
a reference to the other end of the same undirected edge of the underlying model graph.

◆ arc()

ModelLinkGraphArc regina::ModelLinkGraphNode::arc ( int  which)
inline

Returns a reference to one of the four arcs of the graph that exit this node.

This is equivalent to directly constructing ModelLinkGraphArc(this, which).

The four arcs exiting this node are numbered 0,1,2,3 in a clockwise order around the node.

Parameters
whichan integer in the range 0 to 3 inclusive, indicating which of the four arcs exiting this node we should return.
Returns
a reference to the corresponding arc exiting this node.

◆ detail()

std::string regina::Output< ModelLinkGraphNode , false >::detail ( ) const
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.

Returns
a detailed text representation of this object.

◆ index()

int regina::ModelLinkGraphNode::index ( ) const
inline

Returns the index of this node within the overall graph.

If the graph contains n nodes, then the index will be a number between 0 and n-1 inclusive.

Warning
The index of this node might change if other nodes are added or removed.
Returns
the index of this node.

◆ markedIndex()

size_t regina::MarkedElement::markedIndex ( ) const
inlineinherited

Returns the index at which this object is stored in an MarkedVector.

If this object does not belong to an MarkedVector, the return value is undefined.

Returns
the index at which this object is stored.

◆ str()

std::string regina::Output< ModelLinkGraphNode , false >::str ( ) const
inherited


Returns a short text representation of this object.

This text should be human-readable, should fit on a single line, and should not end with a newline. Where possible, it should use plain ASCII characters.

Python
In addition to str(), this is also used as the Python "stringification" function __str__().
Returns
a short text representation of this object.

◆ utf8()

std::string regina::Output< ModelLinkGraphNode , false >::utf8 ( ) const
inherited

Returns a short text representation of this object using unicode characters.

Like str(), this text should be human-readable, should fit on a single line, and should not end with a newline. In addition, it may use unicode characters to make the output more pleasant to read. This string will be encoded in UTF-8.

Returns
a short text representation of this object.

◆ writeTextLong()

void regina::ModelLinkGraphNode::writeTextLong ( std::ostream &  out) const
inline


Writes a detailed text representation of this node to the given output stream.

Python
Not present.
Parameters
outthe output stream to which to write.

◆ writeTextShort()

void regina::ModelLinkGraphNode::writeTextShort ( std::ostream &  out) const
inline


Writes a short text representation of this node to the given output stream.

Python
Not present.
Parameters
outthe output stream to which to write.

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

Copyright © 1999-2021, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).