Regina 7.3 Calculation Engine
|
Stores a piece of data alongside every normal disc within a particular normal surface. More...
#include <surface/disc.h>
Public Member Functions | |
DiscSetSurfaceDataImpl (const NormalSurface &surface) | |
Creates a new disc set corresponding to the discs of the given normal surface. More... | |
DiscSetSurfaceDataImpl (const NormalSurface &surface, const typename TetData::Data &initValue) | |
Creates a new disc set corresponding to the discs of the given normal surface. More... | |
DiscSetSurfaceDataImpl (const DiscSetSurfaceDataImpl &src) | |
Creates a new copy of the given set of normal discs. More... | |
DiscSetSurfaceDataImpl (DiscSetSurfaceDataImpl &&src) noexcept | |
Moves the contents of the given disc set into this new disc set. More... | |
~DiscSetSurfaceDataImpl () | |
Destroys this set of discs and deallocates all associated memory. More... | |
DiscSetSurfaceDataImpl & | operator= (const DiscSetSurfaceDataImpl &src) |
Sets this to be a copy of the given disc set. More... | |
DiscSetSurfaceDataImpl & | operator= (DiscSetSurfaceDataImpl &&src) noexcept |
Moves the contents of the given disc set into this disc set. More... | |
void | swap (DiscSetSurfaceDataImpl &other) noexcept |
Swaps the contents of this and the given disc set. More... | |
bool | operator== (const DiscSetSurfaceDataImpl &other) const |
Determines whether this and the given set have the same number of discs of each type in each tetrahedron, and contain the same data for corresponding discs. More... | |
bool | operator!= (const DiscSetSurfaceDataImpl &other) const |
Determines whether this and the given set have different numbers of discs of some type in some tetrahedron, or contain different data for some pair of corresponding discs. More... | |
size_t | nTets () const |
Returns the number of tetrahedra in the underlying triangulation. More... | |
unsigned long | nDiscs (size_t tetIndex, int type) const |
Determines the number of discs of the given type inside the given tetrahedron. More... | |
TetData & | tetDiscs (size_t tetIndex) const |
Returns the specific set of discs living inside the given tetrahedron. More... | |
TetData::Data & | data (const DiscSpec &disc) |
Retrieves a reference to the data corresponding to the given normal disc. More... | |
std::optional< std::pair< DiscSpec, Perm< 4 > > > | adjacentDisc (const DiscSpec &disc, Perm< 4 > arc) const |
Determines which normal disc is adjacent to the given normal disc along the given directed normal arc in the surface described by this disc set. More... | |
DiscSpecIterator< TetData > | begin () const |
Returns a C++ iterator at the beginning of the range of all normal discs in the underlying normal surface. More... | |
DiscSpecIterator< TetData > | end () const |
Returns a C++ iterator at the end of the range of all normal discs in the underlying normal surface. More... | |
auto | __iter__ () const |
Returns a Python iterator over all normal discs in the underlying normal surface. More... | |
Stores a piece of data alongside every normal disc within a particular normal surface.
End users should not refer to this class directly; instead use one of the type aliases DiscSetSurfaceData<T> or DiscSetSurface.
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.
TetData | This must be either (1) DiscSetTet, in which case there will be no additional data stored for each normal disc; or (2) a class of the form DiscSetTetData<T>, in which case there will be data of type T stored alongside each normal disc. |
unsigned long
. See the precondition below.
|
inline |
Creates a new disc set corresponding to the discs of the given normal surface.
The data for each disc will be initialised using its default constructor.
This disc set will be usable even if it outlives the given surface and/or its underlying triangulation. This is because it takes a snapshot of the necessary information as it appears right now (using Regina's snapshotting machinery, which only takes a deep copy when absolutely necessary).
surface | the normal surface whose discs we shall use. |
|
inline |
Creates a new disc set corresponding to the discs of the given normal surface.
The data for each disc will be initialised to the given value.
This disc set will be usable even if it outlives the given surface and/or its underlying triangulation. This is because it takes a snapshot of the necessary information as it appears right now (using Regina's snapshotting machinery, which only takes a deep copy when absolutely necessary).
surface | the normal surface whose discs we shall use. |
initValue | the value with which to initialise the data corresponding to each disc. |
|
inline |
Creates a new copy of the given set of normal discs.
The data for each disc will be copied using the copy assignment operator for type T.
src | the disc set to copy. |
|
inlinenoexcept |
Moves the contents of the given disc set into this new disc set.
This is a fast (constant time) operation.
The disc set that was passed (src) will no longer be usable.
src | the disc set to move from. |
|
inline |
Destroys this set of discs and deallocates all associated memory.
auto regina::DiscSetSurfaceDataImpl< TetData >::__iter__ | ( | ) | const |
Returns a Python iterator over all normal discs in the underlying normal surface.
In Python, an object of this class can be treated as an iterable object:
for
loop.
|
inline |
Determines which normal disc is adjacent to the given normal disc along the given directed normal arc in the surface described by this disc set.
A directed normal arc will be specified by a permutation p, where the arc runs around vertex p[0]
parallel to the directed edge from vertex p[1]
to p[2]
.
disc | the given normal disc; this must be a disc in this disc set. |
arc | the given normal arc; this must actually be an arc on the boundary of the given normal disc (although it may run in either direction). |
|
inline |
Returns a C++ iterator at the beginning of the range of all normal discs in the underlying normal surface.
These begin() and end() routines allow you to iterate through all normal discs using a range-based for
loop:
|
inline |
Retrieves a reference to the data corresponding to the given normal disc.
disc | the disc whose data we require; this must refer to a disc within this disc set. |
|
inline |
Returns a C++ iterator at the end of the range of all normal discs in the underlying normal surface.
These begin() and end() routines allow you to iterate through all normal discs using a range-based for
loop. See the begin() documentation for further details.
|
inline |
Determines the number of discs of the given type inside the given tetrahedron.
tetIndex | the index in the triangulation of the tetrahedron to examine. |
type | the disc type to examine; this should be between 0 and 9 inclusive. Disc types are outlined in the DiscSpec class notes. |
|
inline |
Returns the number of tetrahedra in the underlying triangulation.
|
inline |
Determines whether this and the given set have different numbers of discs of some type in some tetrahedron, or contain different data for some pair of corresponding discs.
This routine does not consider whether the two underlying triangulations are the same; it merely compares the disc counts and associated data within each set. If the two disc sets come from triangulations with different sizes, and/or surfaces with different disc counts in one or more tetarhedra, then this comparison will return true
.
The associated data (of type T) will be compared using the equality operator (==).
true
if and only if both sets are not the same, as described above.
|
inline |
Sets this to be a copy of the given disc set.
The data for each disc will be copied using the copy assignment operator for type T.
src | the disc set to copy. |
|
inlinenoexcept |
Moves the contents of the given disc set into this disc set.
The running time of this operation is linear in the number of tetrahedra from the original triangulation (since the underlying data for those tetrahedra will be destroyed immediately).
The disc set that was passed (src) will no longer be usable.
src | the disc set to move from. |
|
inline |
Determines whether this and the given set have the same number of discs of each type in each tetrahedron, and contain the same data for corresponding discs.
This routine does not consider whether the two underlying triangulations are the same; it merely compares the disc counts and associated data within each set. If the two disc sets come from triangulations with different sizes, and/or surfaces with different disc counts in one or more tetarhedra, then this comparison will return false
.
The associated data (of type T) will be compared using the equality operator (==).
true
if and only if both sets are the same, as described above.
|
inlinenoexcept |
Swaps the contents of this and the given disc set.
other | the disc set whose contents should be swapped with this. |
|
inline |
Returns the specific set of discs living inside the given tetrahedron.
tetIndex | the index in the triangulation of the given tetrahedron. |