Regina 7.0 Calculation Engine
Public Member Functions | Static Public Member Functions | List of all members
regina::HyperEncoding Class Reference

Indicates precisely how a normal hypersurface within a 4-manifold triangulation is encoded by an integer vector. More...

#include <hypersurface/hypercoords.h>

Public Member Functions

constexpr HyperEncoding (HyperCoords coords)
 Returns an encoding that precisely describes the given normal hypersurface coordinate system. More...
 
constexpr HyperEncoding (const HyperEncoding &)=default
 Creates a new copy of the given encoding. More...
 
HyperEncodingoperator= (const HyperEncoding &)=default
 Sets this to be a copy of the given encoding. More...
 
constexpr bool operator== (const HyperEncoding &other) const
 Determines whether this and the given encoding are identical. More...
 
constexpr bool operator!= (const HyperEncoding &other) const
 Determines whether this and the given encoding are different. More...
 
constexpr bool valid () const
 Returns whether this describes a vector encoding of normal hypersurfaces. More...
 
constexpr int block () const
 Returns the number of coordinates stored for each pentachoron. More...
 
constexpr bool storesTetrahedra () const
 Returns whether this encoding explicitly stores tetrahedron coordinates. More...
 
constexpr bool couldBeVertexLink () const
 Returns whether it is possible for a normal hypersurface using this encoding to include one or more vertex linking components. More...
 
constexpr bool couldBeNonCompact () const
 Returns whether it is possible for a normal hypersurface using this encoding to be non-compact. More...
 
constexpr HyperEncoding withTetrahedra () const
 Returns an extension of this encoding that explicitly stores tetrahedron coordinates. More...
 
constexpr HyperEncoding operator+ (HyperEncoding rhs) const
 Returns an encoding that could hold the sum of hypersurfaces that use this and the given encoding. More...
 
constexpr int intValue () const
 Exports this encoding as an integer. More...
 

Static Public Member Functions

constexpr static HyperEncoding fromIntValue (int value)
 Reconstructs an encoding from an integer value. More...
 

Detailed Description

Indicates precisely how a normal hypersurface within a 4-manifold triangulation is encoded by an integer vector.

Normal hypersurfaces do not always store their internal vectors in the same coordinate system that was used to enumerate the surfaces, and indeed an isolated hypersurface does not know how it was originally created.

Therefore each normal hypersurface keeps a small amount of data, represented by this class, so that it knows how to interpret its internal integer vector. This data also remembers properties of the enumeration process that can be used for optimisations (e.g., the knowledge that, even if the vector stores tetrahedron coordinates, the surface cannot contain any vertex linking components).

These objects are small enough to pass by value and swap with std::swap(), with no need for any specialised move operations or swap functions.

Constructor & Destructor Documentation

◆ HyperEncoding() [1/2]

constexpr regina::HyperEncoding::HyperEncoding ( HyperCoords  coords)
inlineconstexpr

Returns an encoding that precisely describes the given normal hypersurface coordinate system.

This is the encoding that you would use with a "pen and paper" enumeration of hypersurfaces in the given coordinate system, with no further conversion, optimisation, or post-processing.

Note that, when Regina enumerates hypersurfaces in the given coordinate system, it might choose to post-process the resulting vectors to use a different encoding. (In the 3-dimensional world, for example, normal surfaces enumerated in quad coordinates are post-processed and stored in standard coordinates.)

If coords is not one of the coordinate systems that Regina can use to enumerate normal hypersurfaces, then the resulting encoding will be invalid, and valid() will return false.

Parameters
coordsone of Regina's normal hypersurface coordinate systems.

◆ HyperEncoding() [2/2]

constexpr regina::HyperEncoding::HyperEncoding ( const HyperEncoding )
constexprdefault

Creates a new copy of the given encoding.

Member Function Documentation

◆ block()

constexpr int regina::HyperEncoding::block ( ) const
inlineconstexpr

Returns the number of coordinates stored for each pentachoron.

Returns
The number of coordinates per pentachoron.

◆ couldBeNonCompact()

constexpr bool regina::HyperEncoding::couldBeNonCompact ( ) const
inlineconstexpr

Returns whether it is possible for a normal hypersurface using this encoding to be non-compact.

Here "non-compact" refers to a surface with infinitely many normal pieces. See NormalHypersurface::isCompact() for details.

This is typically information that is inherited from whoever enumerated or created the hypersurface that uses this encoding.

If this returns true, it does not mean that the hypersurface does actually contain infinitely many normal pieces; it simply means that the user will need to test this themselves. If this returns false, however, it is guaranteed that the hypersurface is compact, with no further testing required.

Returns
true if it is possible that the hypersurface might be non-compact.

◆ couldBeVertexLink()

constexpr bool regina::HyperEncoding::couldBeVertexLink ( ) const
inlineconstexpr

Returns whether it is possible for a normal hypersurface using this encoding to include one or more vertex linking components.

This is typically information that is inherited from whoever enumerated or created the hypersurface that uses this encoding.

If this returns true, it does not mean that the hypersurface does actually contain vertex linking components; it simply means that the user will need to test this themselves. If this returns false, however, it is guaranteed that the hypersurface does not contain any vertex linking components, with no further testing required.

Returns
true if it is possible that the hypersurface might contain one or more vertex linking components.

◆ fromIntValue()

constexpr static HyperEncoding regina::HyperEncoding::fromIntValue ( int  value)
inlinestaticconstexpr

Reconstructs an encoding from an integer value.

This is a partner routine to intValue(): for any encoding enc, the encoding fromIntValue(enc.intValue()) is always equal to enc.

The main purpose of intValue() and fromIntValue() is to support reading and writing hypersurfaces to/from Regina's XML file format.

Parameters
valuean integer that represents an encoding, typically obtained by calling intValue().
Returns
the corresponding encoding.

◆ intValue()

constexpr int regina::HyperEncoding::intValue ( ) const
inlineconstexpr

Exports this encoding as an integer.

The exact value of the integer is meant to be opaque, in the sense that it can only be used with fromIntValue(). End users are not meant to pull it apart and analyse it (this is what the other query routines in this class are for).

The main purpose of intValue() and fromIntValue() is to support reading and writing hypersurfaces to/from Regina's XML file format.

It is guaranteed that 0 will never be the integer value of a (correctly constructed) encoding.

Returns
an integer that represents this encoding.

◆ operator!=()

constexpr bool regina::HyperEncoding::operator!= ( const HyperEncoding other) const
inlineconstexpr

Determines whether this and the given encoding are different.

Parameters
otherthe encoding to compare with this.
Returns
true if and only if both encodings are different.

◆ operator+()

constexpr HyperEncoding regina::HyperEncoding::operator+ ( HyperEncoding  rhs) const
inlineconstexpr

Returns an encoding that could hold the sum of hypersurfaces that use this and the given encoding.

More precisely, the encoding that is returned is the "simplest" possible encoding that is capable of holding the sum of two normal hypersurfaces that use this and the given encoding respectively.

Parameters
rhsthe encoding to combine with this.
Returns
the "sum" of this and the given encoding, as defined above.

◆ operator=()

HyperEncoding & regina::HyperEncoding::operator= ( const HyperEncoding )
default

Sets this to be a copy of the given encoding.

Returns
a reference to this encoding.

◆ operator==()

constexpr bool regina::HyperEncoding::operator== ( const HyperEncoding other) const
inlineconstexpr

Determines whether this and the given encoding are identical.

Parameters
otherthe encoding to compare with this.
Returns
true if and only if both encodings are identical.

◆ storesTetrahedra()

constexpr bool regina::HyperEncoding::storesTetrahedra ( ) const
inlineconstexpr

Returns whether this encoding explicitly stores tetrahedron coordinates.

Returns
true if tetrahedron coordinates are stored.

◆ valid()

constexpr bool regina::HyperEncoding::valid ( ) const
inlineconstexpr

Returns whether this describes a vector encoding of normal hypersurfaces.

The only case where this would be false is if you create an encoding using either (1) a coordinate system that Regina does not use for enumeration; or (2) another invalid encoding.

Returns
true if and only if this is a valid encoding.

◆ withTetrahedra()

constexpr HyperEncoding regina::HyperEncoding::withTetrahedra ( ) const
inlineconstexpr

Returns an extension of this encoding that explicitly stores tetrahedron coordinates.

All other properties of the encoding will be copied across without changes (including "theoretical" properties such as whether the surface could have vertex linking components, or whether it could be non-compact).

If this encoding already stores tetrahedron coordinates, then the result will be identical to this.

Returns
an extension of this encoding that stores tetrahedron coordinates.

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).