Regina Calculation Engine
|
A subclass of LPConstraintBase used for constraints defined entirely by homogeneous linear equations.
More...
#include <enumerate/treeconstraint.h>
Public Types | |
enum | { nConstraints } |
Static Public Member Functions | |
static bool | addRows (LPCol< LPConstraintBase > *col, const int *columnPerm, const Triangulation< 3 > *tri) |
Explicitly constructs equations for the linear function(s) constrained by this class. More... | |
template<typename IntType > | |
static void | constrain (LPData< LPConstraintNone, IntType > &lp, unsigned numCols) |
Explicitly constraints each of these linear functions to an equality or inequality in the underlying tableaux. More... | |
static bool | verify (const NormalSurface *s) |
Ensures that the given normal surface satisfies the extra constraints described by this class. More... | |
static bool | verify (const AngleStructure *s) |
Ensures that the given angle structure satisfies the extra constraints described by this class. More... | |
static bool | supported (NormalCoords coords) |
Indicates whether the given coordinate system is supported by this constraint class. More... | |
A subclass of LPConstraintBase used for constraints defined entirely by homogeneous linear equations.
Any set of constraints defined entirely by homogeneous linear equations should derive from LPConstraintSubspace, not LPConstraintBase. In other words, any set of constraints derived from LPConstraintSubspace should simply restrict our attention to a vector subspace of the normal surface or angle structure coordinate system.
This class does not provide any additional functionality. It is merely a convenience to help describe and enforce preconditions.
|
inherited |
|
staticinherited |
Explicitly constructs equations for the linear function(s) constrained by this class.
Specifically, this routine takes an array of Coefficients objects (one for each column of the initial tableaux) and fills in the necessary coefficient data.
The precise form of the linear function(s) will typically depend upon the underlying triangulation. For this reason, the triangulation is explicitly passed, along with the permutation that indicates which columns of the initial tableaux correspond to which normal or angle structure coordinates.
More precisely: recall that, for each linear function, the initial tableaux acquires one new variable x_i that evaluates this linear function f(x). This routine must create the corresponding row that sets f(x) - x_i = 0
. Thus it must construct the coefficients of f(x) in the columns corresponding to normal coordinates, and it must also set a coefficient of -1 in the column for the corresponding new variable.
For each subclass S of LPConstraintBase, the array col must be an array of objects of type LPCol<S>. The class LPCol<S> is itself a larger subclass of the Coefficients class. This exact type must be used because the compiler must know how large each column object is in order to correct access each element of the given array.
As described in the LPInitialTableaux class notes, it might not be possible to construct the linear functions (since the triangulation might not satisfy the necessary requirements). In this case, this routine should ensure that the linear functions are in fact the zero functions, and should return false
(but it must still set -1 coefficients for the new variables as described above). Otherwise (if the linear function were successfully constructed) this routine should return true
.
If you are implementing this routine in a subclass that works with angle structure coordinates, remember that your linear constraints must not interact with the scaling coordinate (the final angle structure coordinate that is used to projectivise the angle structure polytope into a polyhedral cone). Your implementation of this routine must ensure that your linear constraints all have coefficient zero in this column.
col | the array of columns as stored in the initial tableaux (i.e., the data member LPInitialTableaux::col_). |
columnPerm | the corresponding permutation of columns that describes how columns of the tableaux correspond to normal or angle structure coordinates in the underlying triangulation (i.e., the data member LPInitialTableaux::columnPerm_). |
tri | the underlying triangulation. |
true
if the linear functions were successfully constructed, or false
if not (in which case they will be replaced with the zero functions instead).
|
staticinherited |
Explicitly constraints each of these linear functions to an equality or inequality in the underlying tableaux.
This will typically consist of a series of calls to LPData::constrainZero() and/or LPData::constrainPositive().
The variables for these extra linear functions are stored in columns numCols - nConstraints
, ..., numCols - 1
of the given tableaux, and so your calls to LPData::constrainZero() and/or LPData::constrainPositive() should operate on these (and only these) columns.
lp | the tableaux in which to constrain these linear functions. |
numCols | the number of columns in the given tableaux. |
|
staticinherited |
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
.
coords | the coordinate system being queried; this must be one of the coordinate systems known to be supported by the generic TreeTraversal infrastructure. |
true
if and only if this coordinate system is also supported by this specific constraint class.
|
staticinherited |
Ensures that the given normal surface satisfies the extra constraints described by this class.
Ideally this test is not based on explicitly recomputing the linear function(s), but instead runs independent tests. For instance, if this class is used to constraint Euler characteristic, then ideally this routine would call s->eulerChar() and test the return value of that routine instead.
If these linear constraints work with angle structure coordinates (not normal or almost normal surfaces), then this routine should return false
.
s | the surface to test. |
true
if the given surface satisfies these linear constraints, or false
if it does not.
|
staticinherited |
Ensures that the given angle structure satisfies the extra constraints described by this class.
Ideally this test is not based on explicitly recomputing the linear function(s), but instead runs independent tests; see the related routine verify(const NormalSurface*) for examples.
If these linear constraints work with normal or almost normal surfaces (not angle structure coordinates), then this routine should return false
.
s | the angle structure to test. |
true
if the given angle structure satisfies these linear constraints, or false
if it does not.