Regina 7.0 Calculation Engine
|
A base class for additional banning and marking constraints that we can place on tree traversal algorithms. More...
#include <enumerate/treeconstraint.h>
Public Member Functions | |
template<class LPConstraint > | |
BanConstraintBase (const LPInitialTableaux< LPConstraint > &init) | |
Constructs a new set of banning and marking constraints. More... | |
~BanConstraintBase () | |
Destroys this object and all associated data. More... | |
template<class LPConstraint , typename IntType > | |
void | enforceBans (LPData< LPConstraint, IntType > &lp) const |
Enforces all bans described by this class in the given tableaux. More... | |
bool | marked (size_t column) const |
Identifies whether the given column of the tableaux corresponds to a marked coordinate (e.g., a marked normal disc type). More... | |
bool | operator== (const BanConstraintBase &other) const |
Determines if this and the given object ban and mark the same tableaux coordinates as each other. More... | |
bool | operator!= (const BanConstraintBase &other) const |
Determines if this and the given object do not ban and mark the same tableaux coordinates as each other. More... | |
void | writeTextShort (std::ostream &out) const |
Writes a short text representation of this object to the given output stream. More... | |
BanConstraintBase (const BanConstraintBase &)=delete | |
BanConstraintBase & | operator= (const BanConstraintBase &)=delete |
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... | |
Static Public Member Functions | |
static bool | supported (NormalEncoding enc) |
Indicates whether the given coordinate system is supported by this constraint class. More... | |
Protected Attributes | |
const Triangulation< 3 > & | tri_ |
The triangulation with which we are working. More... | |
LPSystem | system_ |
The broad class of vector encodings that our enumeration task is working with. More... | |
bool * | banned_ |
Indicates which columns of a tableaux correspond to banned coordinates (e.g., banned normal disc types). More... | |
bool * | marked_ |
Indicates which columns of a tableaux correspond to marked coordinates (e.g., marked normal disc types). More... | |
A base class for additional banning and marking constraints that we can place on tree traversal algorithms.
This is used with TreeEnumeration, TreeSingleSoln and related algorithms for enumerating and locating normal surfaces and angle structures in a 3-manifold triangulation.
This class adds constraints of two types:
All of these constraints operate only on normal or angle structure coordinates in the underlying tableaux (and in particular not the additional variables introduced by additional linear constraints, as described by LPConstraintBase and its subclasses).
Currently marking is used in the following ways:
At present, marking is not used at all for quadrilateral coordinates or angle structures. However, marking is a very new feature, and this concept may be expanded in future versions of Regina.
This class does not record disc types in the order of their normal or angle structure coordinates; instead it records them in the order of their columns in a tableaux for linear programming (as used in LPInitialTableaux). This means that there is a little more work required in setting up the initial lists of banned and marked columns, but then these lists are easy to use on the fly during tree traversal algorithms.
Bear in mind that the tableaux that these constraints are working with will not necessarily use the same coordinates as the underlying enumeration task (e.g., the tableaux will never include separate columns for octagon coordinates). See LPInitialTableaux for a more detailed discussion of this.
This base class provides limited functionality (as documented below). Subclasses must implement a constructor (which, like this base class, takes an initial tableaux and determines which coordinates are banned and/or marked), and must implement supported(), which indicates which normal or angle structure coordinate system this constraint class can work with.
These ban constraint classes are designed mainly to act as C++ template arguments, and end users will typically not need to construct their own object of these classes. Instead, to use a ban constraint class, pass it as a template parameter to one of the tree traversal subclasses (e.g., TreeEnumeration, TreeSingleSolution, or TautEnumeration).
TreeEnumeration_BanBoundary
).
|
inline |
Constructs a new set of banning and marking constraints.
This base class constructor will create banned_ and marked_ arrays of the correct size, and will initialise their contents to be entirely false
. This means that there will be no banned or marked disc types at all.
Subclass constructors should identify which coordinates to ban and mark, and adjust the contents of the banned_ and marked_ arrays accordingly.
init | the original starting tableaux being used for this enumeration task. |
|
inline |
Destroys this object and all associated data.
|
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.
|
inline |
Enforces all bans described by this class in the given tableaux.
Specifically, for each banned coordinate, this routine calls LPData::constrainZero() on the corresponding coordinate column.
lp | the tableaux in which to enforce the bans. |
|
inline |
Identifies whether the given column of the tableaux corresponds to a marked coordinate (e.g., a marked normal disc type).
column | a column of the tableaux. This must be one of the columns corresponding to a normal or angle structure coordinate, not one of the extra columns induced by an LPConstraint parameter for the tree traversal class. |
true
if and only if the given column corresponds to a marked coordinate.
|
inline |
Determines if this and the given object do not ban and mark the same tableaux coordinates as each other.
Even if this and the given object are of different subclasses of BanConstraintBase, as long as they ban the same coordinates and mark the same coordinates, they will compare as equal (i.e., this inequality comparison will return false
).
It does not matter whether the two objects use the same underlying tableaux. However, if the underlying tableaux use triangulations of different sizes and/or different broad classes of vector encodings (as described by LPSystem), then these two objects will compare as not equal.
other | the object to compare with this. |
true
if and only if this and the object do not ban and mark the same tableaux coordinates, as described above.
|
inline |
Determines if this and the given object ban and mark the same tableaux coordinates as each other.
Even if this and the given object are of different subclasses of BanConstraintBase, as long as they ban the same coordinates and mark the same coordinates, they will compare as equal.
It does not matter whether the two objects use the same underlying tableaux. However, if the underlying tableaux use triangulations of different sizes and/or different broad classes of vector encodings (as described by LPSystem), then these two objects will compare as not equal.
other | the object to compare with this. |
true
if and only if this and the object ban and mark the same tableaux coordinates, as described above.
|
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.
str()
will use precisely this function, and for most classes the Python repr()
function will incorporate this into its output.
|
static |
Indicates whether the given coordinate system is supported by this constraint class.
This routine assumes that the given system is already known to be supported by the generic tree traversal infrastructure, and only returns false
if there are additional prerequisites imposed by this particular constraint class that the given system does not satisfy. If this constraint class does not impose any of its own additional conditions, this routine may simply return true
.
The only features of the encoding that this routine should examine are what coordinates are stored (e.g., NormalEncoding::storesTriangles()). In particular, this routine will not look at any "semantic guarantees" (e.g. NormalEncoding::couldBeNonCompact()).
enc | the vector encoding being queried. This must be one of the vector encodings known to be supported by the generic TreeTraversal infrastructure, and in particular it may be the special angle structure encoding. |
true
if and only if this vector encoding is also supported by this specific constraint class.
|
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.
|
inlineinherited |
A default implementation for detailed output.
This routine simply calls T::writeTextShort() and appends a final newline.
out | the output stream to which to write. |
void regina::BanConstraintBase::writeTextShort | ( | std::ostream & | out | ) | const |
Writes a short text representation of this object to the given output stream.
out | the output stream to which to write. |
|
protected |
Indicates which columns of a tableaux correspond to banned coordinates (e.g., banned normal disc types).
The size of this array is the number of normal or angle structure coordinates (so we explicitly exclude extra columns that arise from the template parameter LPConstraint.
|
protected |
Indicates which columns of a tableaux correspond to marked coordinates (e.g., marked normal disc types).
The size of this array is the number of normal or angle structure coordinates (so we explicitly exclude extra columns that arise from the template parameter LPConstraint.
|
protected |
The broad class of vector encodings that our enumeration task is working with.
|
protected |
The triangulation with which we are working.