|
Regina Calculation Engine
|
Represents a directed knot or link in the 3-sphere. More...
#include <link/link.h>
Public Types | |
| typedef Packet | SafePointeeType |
| The type of object being pointed to. More... | |
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... | |
| bool | hasSafePtr () const |
| Is there one or more SafePtr currently pointing to this object? More... | |
Constructors and Destructors | |
| Link () | |
| Constructs an empty link. More... | |
| Link (size_t unknots) | |
| Constructs the unlink with the given number of components. More... | |
| Link (const Link ©) | |
| Constructs a new copy of the given link. More... | |
| Link (const Link ©, bool cloneProps) | |
| Constructs a new copy of the given link, with the option of whether or not to clone its computed properties also. More... | |
| Link (const std::string &description) | |
| "Magic" constructor that tries to find some way to interpret the given string as a link. More... | |
| ~Link () | |
| Destroys this link. More... | |
Crossings and Components | |
| bool | isEmpty () const |
| Determines whether this link is empty. More... | |
| size_t | size () const |
| Returns the number of crossings in this link. More... | |
| size_t | countComponents () const |
| Returns the number of components in this link. More... | |
| Crossing * | crossing (size_t index) const |
| Returns a pointer to the crossing at the given index within this link. More... | |
| StrandRef | component (size_t index) const |
| Returns a strand in the given component of this link. More... | |
| StrandRef | strand (int id) const |
| Returns the strand in the link with the given integer ID. More... | |
| StrandRef | translate (const StrandRef &other) const |
| Translates a strand reference for some other link into the corresponding strand reference for this link. More... | |
| bool | connected (const Crossing *a, const Crossing *b) const |
| Determines whether the two given crossings are connected in the underlying 4-valent graph of the link diagram. More... | |
Editing | |
| void | swapContents (Link &other) |
| Swaps the contents of this and the given link. More... | |
| void | change (Crossing *c) |
| Switches the upper and lower strands of the given crossing. More... | |
| void | changeAll () |
| Switches the upper and lower strands of every crossing in the diagram. More... | |
| void | resolve (Crossing *c) |
| Resolves the given crossing. More... | |
| void | reflect () |
| Converts this link into its reflection. More... | |
| void | rotate () |
| Rotates this link diagram, converting it into a different diagram of the same link. More... | |
| void | reverse () |
| Reverses the orientation of every component of this link. 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 | r1 (StrandRef arc, int side, int sign, bool check=true, bool perform=true) |
| Tests for and/or performs a type I Reidemeister move to add a new 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 | r2 (StrandRef upperArc, int upperSide, StrandRef lowerArc, int lowerSide, bool check=true, bool perform=true) |
| Tests for and/or performs a type II Reidemeister move to add two new crossings. More... | |
| bool | r3 (StrandRef arc, int side, bool check=true, bool perform=true) |
| Tests for and/or performs a type III Reidemeister move. More... | |
| bool | r3 (Crossing *crossing, int side, bool check=true, bool perform=true) |
| Tests for and/or performs a type III Reidemeister move. More... | |
| bool | hasReducingPass () const |
| Tests whether this knot has a pass move that will reduce the number of crossings. More... | |
| bool | intelligentSimplify () |
| Attempts to simplify the link diagram using fast and greedy heuristics. More... | |
| bool | simplifyToLocalMinimum (bool perform=true) |
| Uses type I and II Reidemeister moves to reduce the link monotonically to some local minimum number of crossings. More... | |
| bool | simplifyExhaustive (int height=1, unsigned nThreads=1, ProgressTrackerOpen *tracker=nullptr) |
| Attempts to simplify this knot diagram using a slow but exhaustive search through the Reidemeister graph. More... | |
| template<typename Action , typename... Args> | |
| bool | rewrite (int height, unsigned nThreads, ProgressTrackerOpen *tracker, Action &&action, Args &&... args) const |
| Explores all knot diagrams that can be reached from this via Reidemeister moves, without exceeding a given number of additional crossings. More... | |
| void | composeWith (const Link &other) |
| Forms the composition of this with the given link. More... | |
Invariants and Related Properties | |
| bool | isAlternating () const |
| Returns whether this knot diagram is alternating. More... | |
| long | linking () const |
| Returns the linking number of this link. More... | |
| long | writhe () const |
| Returns the writhe of this link diagram. More... | |
| Triangulation< 3 > * | complement (bool simplify=true) const |
| Returns an ideal triangulation of the complement of this link in the 3-sphere. More... | |
| Link * | parallel (int k, Framing framing=FRAMING_SEIFERT) const |
| Returns k cables of this link, all parallel to each other using the given framing. More... | |
| const Laurent< Integer > & | bracket (Algorithm alg=ALG_DEFAULT, ProgressTracker *tracker=nullptr) const |
| Returns the Kauffman bracket polynomial of this link diagram. More... | |
| bool | knowsBracket () const |
| Is the Kauffman bracket polynomial of this link diagram already known? See bracket() for further details. More... | |
| const Laurent< Integer > & | jones (Algorithm alg=ALG_DEFAULT, ProgressTracker *tracker=nullptr) const |
| Returns the Jones polynomial of this link, but with all exponents doubled. More... | |
| bool | knowsJones () const |
| Is the Jones polynomial of this link diagram already known? See jones() for further details. More... | |
| const Laurent2< Integer > & | homflyAZ (Algorithm alg=ALG_DEFAULT, ProgressTracker *tracker=nullptr) const |
| Returns the HOMFLY polynomial of this link, as a polynomial in alpha and z. More... | |
| const Laurent2< Integer > & | homflyLM (Algorithm alg=ALG_DEFAULT, ProgressTracker *tracker=nullptr) const |
| Returns the HOMFLY polynomial of this link, as a polynomial in l and m. More... | |
| const Laurent2< Integer > & | homfly (Algorithm alg=ALG_DEFAULT, ProgressTracker *tracker=nullptr) const |
| Returns the HOMFLY polynomial of this link, as a polynomial in alpha and z. More... | |
| bool | knowsHomfly () const |
| Is the HOMFLY polynomial of this link diagram already known? See homflyAZ() and homflyLM() for further details. More... | |
| const TreeDecomposition & | niceTreeDecomposition () const |
| Returns a nice tree decomposition of the planar 4-valent multigraph formed by this link diagram. More... | |
| void | useTreeDecomposition (const TreeDecomposition &td) |
| Instructs Regina to use the given tree decomposition as the starting point whenever it needs a tree decomposition for this link. More... | |
Packet Administration | |
| virtual void | writeTextShort (std::ostream &out) const override |
| Writes a short text representation of this object to the given output stream. More... | |
| virtual void | writeTextLong (std::ostream &out) const override |
| Writes a detailed text representation of this object to the given output stream. More... | |
| virtual bool | dependsOnParent () const override |
| Determines if this packet depends upon its parent. More... | |
Exporting Links | |
| std::string | brief () const |
| Outputs this link in Regina's own brief format. More... | |
| std::string | gauss () const |
| Outputs a classical Gauss code for this knot. More... | |
| void | gauss (std::ostream &out) const |
| Writes a classical Gauss code for this knot to the given output stream. More... | |
| std::string | orientedGauss () const |
| Outputs an oriented Gauss code for this knot. More... | |
| void | orientedGauss (std::ostream &out) const |
| Writes an oriented Gauss code for this knot to the given output stream. More... | |
| std::string | jenkins () const |
| Exports this link as a string using the text representation described by Bob Jenkins. More... | |
| void | jenkins (std::ostream &out) const |
| Exports this link to the given output stream using the text representation described by Bob Jenkins. More... | |
| std::string | dt (bool alpha=false) const |
| Outputs this knot using Dowker-Thistlethwaite notation. More... | |
| void | dt (std::ostream &out, bool alpha=false) const |
| Writes this knot to the given output stream using Dowker-Thistlethwaite notation. More... | |
| void | writePACE (std::ostream &out) const |
| Outputs the underlying planar 4-valent multigraph using the PACE text format. More... | |
| std::string | pace () const |
| Returns a text representation of the underlying planar 4-valent multigraph, using the PACE text format. More... | |
| std::string | dumpConstruction () const |
| Returns C++ code that can be used to reconstruct this link. More... | |
| std::string | knotSig (bool useReflection=true, bool useReversal=true) const |
| Constructs the signature for this knot diagram. More... | |
Static Public Attributes | |
| static const char * | jonesVar |
| The name of the variable used in the Jones polynomial, as returned by jones(). More... | |
| static const char * | homflyAZVarX |
| The name of the first variable used in the variant of the HOMFLY polynomial as returned by homflyAZ(). More... | |
| static const char * | homflyAZVarY |
| The name of the second variable used in the variant of the HOMFLY polynomial as returned by homflyAZ(). More... | |
| static const char * | homflyLMVarX |
| The name of the first variable used in the variant of the HOMFLY polynomial as returned by homflyLM(). More... | |
| static const char * | homflyLMVarY |
| The name of the second variable used in the variant of the HOMFLY polynomial as returned by homflyLM(). More... | |
| static const char * | homflyVarX |
| The name of the first variable used in the variant of the HOMFLY polynomial as returned by homfly(). More... | |
| static const char * | homflyVarY |
| The name of the second variable used in the variant of the HOMFLY polynomial as returned by homfly(). More... | |
Building Links | |
| class | ModelLinkGraph |
| class | Tangle |
| class | XMLLinkCrossingsReader |
| class | XMLLinkComponentsReader |
| template<typename... Args> | |
| static Link * | fromData (std::initializer_list< int > crossingSigns, std::initializer_list< Args >... components) |
| Creates a new link from hard-coded information about its crossings and components. More... | |
| static Link * | fromKnotSig (const std::string &sig) |
| Recovers a knot diagram from its signature. More... | |
| static Link * | fromGauss (const std::string &str) |
| Creates a new knot from a classical Gauss code. More... | |
| template<typename Iterator > | |
| static Link * | fromGauss (Iterator begin, Iterator end) |
| Creates a new knot from a classical Gauss code. More... | |
| static Link * | fromOrientedGauss (const std::string &str) |
| Creates a new knot from an "oriented" variant of the Gauss code. More... | |
| template<typename Iterator > | |
| static Link * | fromOrientedGauss (Iterator begin, Iterator end) |
| Creates a new knot from an "oriented" variant of the Gauss code. More... | |
| static Link * | fromJenkins (const std::string &str) |
| Builds a link from the text representation described by Bob Jenkins. More... | |
| static Link * | fromJenkins (std::istream &in) |
| Builds a link from the text representation described by Bob Jenkins. More... | |
| static Link * | fromDT (const std::string &str) |
| Creates a new knot from either alphabetical or numerical Dowker-Thistlethwaite notation. More... | |
| template<typename Iterator > | |
| static Link * | fromDT (Iterator begin, Iterator end) |
| Creates a new knot from an integer sequence using the numerical variant of Dowker-Thistlethwaite notation. More... | |
| static XMLPacketReader * | xmlReader (Packet *parent, XMLTreeResolver &resolver) |
| virtual Packet * | internalClonePacket (Packet *parent) const override |
| Makes a newly allocated copy of this packet. More... | |
| virtual void | writeXMLPacketData (std::ostream &out) const override |
| Writes a chunk of XML containing the data for this packet only. More... | |
File I/O | |
| bool | save (const char *filename, bool compressed=true) const |
| Saves the subtree rooted at this packet to the given Regina data file, using Regina's native XML file format. More... | |
| bool | save (std::ostream &s, bool compressed=true) const |
| Writes the subtree rooted at this packet to the given output stream, in the format of a Regina XML data file. More... | |
| void | writeXMLFile (std::ostream &out) const |
| Writes the subtree rooted at this packet to the given output stream in Regina's native XML file format. More... | |
| std::string | internalID () const |
| Returns a unique string ID that identifies this packet. More... | |
| bool | hasOwner () const |
| Indicates whether some other object in the calculation engine is responsible for ultimately destroying this object. More... | |
| void | writeXMLPacketTree (std::ostream &out) const |
| Writes a chunk of XML containing the subtree with this packet as matriarch. More... | |
Represents a directed knot or link in the 3-sphere.
This class supports links with any number of components (including zero), and it also supports components with no crossings (which form additional unknot components of the overall link).
|
inherited |
The type of object being pointed to.
|
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.
|
inlineinherited |
Is there one or more SafePtr currently pointing to this object?
|
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.
__str__().
|
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.