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

Represents a 2-tangle in the 3-ball. More...

#include <link/tangle.h>

Inheritance diagram for regina::Tangle:
regina::Output< Tangle >

Public Member Functions

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...
 
Constructors and Destructors
 Tangle ()
 Constructs the zero tangle. More...
 
 Tangle (int twists)
 Constructs a tangle from the given number of twists. More...
 
 Tangle (int num, int den)
 Constructs a rational tangle with the given parameters. More...
 
 Tangle (const Link &knot)
 Creates a tangle from two parallel copies of the given knot. More...
 
 Tangle (const Tangle &copy)
 Constructs a new copy of the given tangle. More...
 
 ~Tangle ()
 Destroys this tangle. More...
 
Crossings and Strings
char type () const
 Returns the type of this tangle. More...
 
size_t size () const
 Returns the number of crossings in this tangle. More...
 
Crossingcrossing (size_t index) const
 Returns a pointer to the crossing at the given index within this tangle. More...
 
StrandRef begin (int string) const
 Returns the crossing closest to the beginning of the given string. More...
 
StrandRef end (int string) const
 Returns the crossing closest to the end of the given string. More...
 
StrandRef translate (const StrandRef &other) const
 Translates a strand reference for some other tangle into the corresponding strand reference for this tangle. More...
 
Editing
void swapContents (Tangle &other)
 Swaps the contents of this and the given tangle. More...
 
void twist (int sign=1)
 Adds a twist to the right-hand end of this tangle. More...
 
void turn (int direction=1)
 Rotates this tangle by 90 degrees. More...
 
void changeAll ()
 Switches the upper and lower strands of every crossing in the tangle. More...
 
bool r1 (Crossing *crossing, bool check=true, bool perform=true)
 Tests for and/or performs a type I Reidemeister move to remove a crossing. More...
 
bool r2 (StrandRef arc, bool check=true, bool perform=true)
 Tests for and/or performs a type II Reidemeister move to remove two crossings. More...
 
bool r2 (Crossing *crossing, bool check=true, bool perform=true)
 Tests for and/or performs a type II Reidemeister move to remove two crossings. More...
 
bool simplifyToLocalMinimum (bool perform=true)
 Uses type I and II Reidemeister moves to reduce the tangle monotonically to some local minimum number of crossings. More...
 
Algebra on Tangles
void add (const Tangle &other)
 Adds the given tangle to the right-hand side of this tangle. More...
 
void negate ()
 Reflects this tangle through the diagonal axis running from the top-left to bottom-right corners of the diagram. More...
 
void box (const Tangle &topLeft, const Tangle &topRight, const Tangle &bottomLeft, const Tangle &bottomRight)
 Encloses this tangle with the four given tangles in a box configuration. More...
 
LinknumClosure () const
 Forms the numerator closure of this tangle. More...
 
LinkdenClosure () const
 Forms the denominator closure of this tangle. More...
 
Output
void writeTextShort (std::ostream &out) const
 Writes a short text representation of this tangle to the given output stream. More...
 
void writeTextLong (std::ostream &out) const
 Writes a detailed text representation of this tangle to the given output stream. More...
 
Exporting Tangles
std::string orientedGauss () const
 Outputs an oriented Gauss code for this tangle. More...
 
void orientedGauss (std::ostream &out) const
 Writes an oriented Gauss code for this tangle to the given output stream. More...
 

Building Tangles

Tangleoperator= (const Tangle &)=delete
 
static TanglefromOrientedGauss (const std::string &str)
 Creates a new tangle from an oriented Gauss code. More...
 
template<typename Iterator >
static TanglefromOrientedGauss (Iterator begin, Iterator end)
 Creates a new tangle from an oriented Gauss code. More...
 

Detailed Description

Represents a 2-tangle in the 3-ball.

Regina does not allow closed components in a tangle; in other words, a tangle in Regina is a proper embedding of exactly two arcs in the 3-ball with the corresponding four endpoints attached to four marked points on the 3-ball boundary.

Regina stores tangles as projections, with the four endpoints fixed at the top-left, top-right, bottom-left and bottom-right corners of the diagram.

Each tangles has a type, indicating how the four endpoints are connected. The three possible types are:

Internally, Regina numbers the two strings 0 and 1: string 0 will always be the one attached to the top-left endpoint. Regina also assigns each string an orientation: for a horizontal or diagonal tangle this will always be from left to right, and for a vertical tangle this will always be from top to bottom.

When traversing a tangle, if you reach one of the endpoints of a string then the corresponding return value of Crossing::next() or Crossing::prev() (whichever is relevant) will be a null strand reference.

Member Function Documentation

◆ detail()

std::string regina::Output< Tangle , false >::detail
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.

◆ str()

std::string regina::Output< Tangle , false >::str
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:\n 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< Tangle , false >::utf8
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.

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

Copyright © 1999-2020, 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).