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

Represents a partial isomorphism between two splitting surface signatures. More...

#include <split/sigisomorphism.h>

Inheritance diagram for regina::SigPartialIsomorphism:
regina::ShortOutput< SigPartialIsomorphism > regina::Output< SigPartialIsomorphism, false >

Public Member Functions

 SigPartialIsomorphism (int newDir)
 Creates a new partial isomorphism that maps no cycles or symbols. More...
 
 SigPartialIsomorphism (const SigPartialIsomorphism &iso)
 Creates a copy of the given partial isomorphism. More...
 
 SigPartialIsomorphism (SigPartialIsomorphism &&src) noexcept
 Moves the given partial isomorphism into this new partial isomorphism. More...
 
 ~SigPartialIsomorphism ()
 Destroys this partial isomorphism. More...
 
SigPartialIsomorphismoperator= (const SigPartialIsomorphism &src)
 Copies the given partial isomorphism into this partial isomorphism. More...
 
SigPartialIsomorphismoperator= (SigPartialIsomorphism &&src) noexcept
 Moves the given partial isomorphism into this new partial isomorphism. More...
 
void swap (SigPartialIsomorphism &other) noexcept
 Swaps the contents of this and the given partial isomorphism. More...
 
void makeCanonical (const Signature &sig, unsigned fromCycleGroup=0)
 Rearranges the cycle images so that this isomorphism when applied to the given signature produces a new signature that is in canonical form. More...
 
bool operator== (const SigPartialIsomorphism &other) const
 Determines whether this and the given partial isomorphism are identical. More...
 
bool operator!= (const SigPartialIsomorphism &other) const
 Determines whether this and the given partial isomorphism are not identical. More...
 
int compareWith (const Signature &sig, const SigPartialIsomorphism &other, unsigned fromCycleGroup=0) const
 Lexicographically compares the results of applying this and the given isomorphism to the given signature. More...
 
int compareWithIdentity (const Signature &sig, unsigned fromCycleGroup=0) const
 Lexicographically compares the results of applying this and the identity isomorphism to the given signature. 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
 A default implementation for detailed output. 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 regina::SigCensus
 

Detailed Description

Represents a partial isomorphism between two splitting surface signatures.

See class Signature for details on splitting surface signatures.

The two signatures related by this partial isomorphism must have the same cycle structure, i.e., the same number of cycle groups and the same cycle length and number of cycles within each cycle group.

The partial isomorphism maps symbols to symbols and cycles to cycles, with the option of rotating some cycles and/or reversing all cycles in the process. Cycles within the kth cycle group of the source signature must map to cycles within the kth cycle group of the destination signature.

A partial isomorphism is only required to map the cycles and symbols found in the first g cycle groups of the source isomorphism (for some g). If only a subset of symbols are mapped, that subset must be symbols 0,1,...,k for some k.

This class implements C++ move semantics and adheres to the C++ Swappable requirement. It is designed to avoid deep copies wherever possible, even when passing or returning objects by value.

Constructor & Destructor Documentation

◆ SigPartialIsomorphism() [1/3]

regina::SigPartialIsomorphism::SigPartialIsomorphism ( int  newDir)
inline

Creates a new partial isomorphism that maps no cycles or symbols.

This empty isomorphism is designed to be extended at some later point.

Parameters
newDirpositive if this isomorphism specifies that all cycles are reversed, or negative if this isomorphism specifies that all cycles keep their original direction.

◆ SigPartialIsomorphism() [2/3]

regina::SigPartialIsomorphism::SigPartialIsomorphism ( const SigPartialIsomorphism iso)

Creates a copy of the given partial isomorphism.

Parameters
isothe partial isomorphism to copy.

◆ SigPartialIsomorphism() [3/3]

regina::SigPartialIsomorphism::SigPartialIsomorphism ( SigPartialIsomorphism &&  src)
inlinenoexcept

Moves the given partial isomorphism into this new partial isomorphism.

This is a fast (constant time) operation.

The partial isomorphism that is passed (src) will no longer be usable.

Parameters
srcthe partial isomorphism to move.

◆ ~SigPartialIsomorphism()

regina::SigPartialIsomorphism::~SigPartialIsomorphism ( )
inline

Destroys this partial isomorphism.

Member Function Documentation

◆ compareWith()

int regina::SigPartialIsomorphism::compareWith ( const Signature sig,
const SigPartialIsomorphism other,
unsigned  fromCycleGroup = 0 
) const

Lexicographically compares the results of applying this and the given isomorphism to the given signature.

Comparisons are done on a cycle-by-cycle basis; comparisons within a cycle are done as described by Signature::cycleCmp(). Comparison will not proceed beyond the cycles mapped by this partial isomorphism.

Precondition
the given partial isomorphism maps at least as many cycles and symbols as this partial isomorphism.
Parameters
sigthe signature to which both this and the given isomorphism will be applied.
otherthe isomorphism to compare with this isomorphism.
fromCycleGroupthe first cycle group whose images should be examined. If it is already known that the cycle images for the first k cycle groups are identical under both isomorphisms, k should be passed in this parameter. This parameter should not exceed the number of cycle groups whose cycles are mapped by this partial isomorphism.
Returns
-1, 1 or 0 if the image of the given signature under this isomorphism is lexicographically less than, greater than or equal to its image under the given isomorphism respectively.

◆ compareWithIdentity()

int regina::SigPartialIsomorphism::compareWithIdentity ( const Signature sig,
unsigned  fromCycleGroup = 0 
) const

Lexicographically compares the results of applying this and the identity isomorphism to the given signature.

This routine behaves identically to compareWith(), except that it does not take a second isomorphism to compare against. See compareWith() for further details.

Parameters
sigthe signature to which this isomorphism will be applied.
fromCycleGroupthe first cycle group whose images should be examined. If it is already known that the cycle images for the first k cycle groups are identical under both this and the identity isomorphism, k should be passed in this parameter. This parameter should not exceed the number of cycle groups whose cycles are mapped by this partial isomorphism.
Returns
-1, 1 or 0 if the image of the given signature under this isomorphism is lexicographically less than, greater than or equal to its image under the identity isomorphism respectively.

◆ detail()

std::string regina::Output< SigPartialIsomorphism , supportsUtf8 >::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.

◆ makeCanonical()

void regina::SigPartialIsomorphism::makeCanonical ( const Signature sig,
unsigned  fromCycleGroup = 0 
)

Rearranges the cycle images so that this isomorphism when applied to the given signature produces a new signature that is in canonical form.

The result of this routine is dependent upon the symbol map defined by this isomorphism (this symbol map will not be changed).

Parameters
sigthe signature to which this isomorphism will be applied.
fromCycleGroupthe first cycle group whose images may be rearranged. If it is already known that the cycle images for the first k cycle groups are correct, k should be passed in this parameter. This parameter should not exceed the number of cycle groups whose cycles are mapped by this partial isomorphism.

◆ operator!=()

bool regina::SigPartialIsomorphism::operator!= ( const SigPartialIsomorphism other) const
inline

Determines whether this and the given partial isomorphism are not identical.

Parameters
otherthe partial isomorphism to compare with this.
Returns
true if and only if this and other are not identical.

◆ operator=() [1/2]

SigPartialIsomorphism & regina::SigPartialIsomorphism::operator= ( const SigPartialIsomorphism src)

Copies the given partial isomorphism into this partial isomorphism.

It does not matter if this and the given partial isomorphism work with different numbers of symbols or different cycle structures; if they do then this partial isomorphism will be adjusted accordingly.

This operator induces a deep copy of src.

Parameters
srcthe partial isomorphism to copy.
Returns
a reference to this partial isomorphism.

◆ operator=() [2/2]

SigPartialIsomorphism & regina::SigPartialIsomorphism::operator= ( SigPartialIsomorphism &&  src)
inlinenoexcept

Moves the given partial isomorphism into this new partial isomorphism.

This is a fast (constant time) operation.

It does not matter if this and the given partial isomorphism work with different numbers of symbols or different cycle structures; if they do then this partial isomorphism will be adjusted accordingly.

The partial isomorphism that is passed (src) will no longer be usable.

Parameters
srcthe partial isomorphism to move.
Returns
a reference to this partial isomorphism.

◆ operator==()

bool regina::SigPartialIsomorphism::operator== ( const SigPartialIsomorphism other) const

Determines whether this and the given partial isomorphism are identical.

Parameters
otherthe partial isomorphism to compare with this.
Returns
true if and only if this and other are identical.

◆ str()

std::string regina::Output< SigPartialIsomorphism , supportsUtf8 >::str ( ) const
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.

Python
The Python "stringification" function __str__() will use precisely this function, and for most classes the Python __repr__() function will incorporate this into its output.
Returns
a short text representation of this object.

◆ swap()

void regina::SigPartialIsomorphism::swap ( SigPartialIsomorphism other)
inlinenoexcept

Swaps the contents of this and the given partial isomorphism.

It does not matter if this and the given partial isomorphism work with different numbers of symbols or different cycle structures; if they do then they will both be adjusted accordingly.

Parameters
otherthe partial isomorphism whose contents are to be swapped with this.

◆ utf8()

std::string regina::Output< SigPartialIsomorphism , supportsUtf8 >::utf8 ( ) const
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.

Returns
a short text representation of this object.

◆ writeTextLong()

void regina::ShortOutput< SigPartialIsomorphism , false >::writeTextLong ( std::ostream &  out) const
inlineinherited

A default implementation for detailed output.

This routine simply calls T::writeTextShort() and appends a final newline.

Python
Not present. Instead you can call detail() from the subclass T, which returns this output as a string.
Parameters
outthe output stream to which to write.

◆ writeTextShort()

void regina::SigPartialIsomorphism::writeTextShort ( std::ostream &  out) const

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

Python
Not present. Use str() instead.
Parameters
outthe output stream to which to write.

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

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