regina::NCompConstraint Class Reference
[Vertex Enumeration]

Represents an individual compatibility constraint for use with polytope vertex enumeration. More...

#include <ncompconstraint.h>

List of all members.

Public Member Functions

 NCompConstraint ()
 Creates a new constraint with an empty set of coordinate positions and a non-zero coordinate cap of zero.
 NCompConstraint (unsigned newMaxNonZero)
 Creates a new constraint with an empty set of coordinate positions and the given non-zero coordinate cap.
const std::set< unsigned > & getCoordinates () const
 Returns the set of coordinate positions under consideration by this constraint.
std::set< unsigned > & getCoordinates ()
 Returns the set of coordinate positions under consideration by this constraint.
unsigned getMaxNonZero () const
 Returns the non-zero coordinate cap for this constraint.
void setMaxNonZero (unsigned newMaxNonZero)
 Sets the non-zero coordinate cap for this constraint.
template<class T>
bool isSatisfied (const NVector< T > &first, const NVector< T > &second) const
 Determines whether the given pair of vectors satisfies this constraint.
template<class T>
bool isSatisfied (const NVector< T > &v) const
 Determines whether the given vector satisfies this constraint.


Detailed Description

Represents an individual compatibility constraint for use with polytope vertex enumeration.

Some vertex enumerations search only for vectors representing valid vertices, under varying definitions of valid. In this case, two valid vectors are said to be compatible if any convex combination of the two vectors is also valid.

A compatibility constraint represents a necessary condition for two valid vectors to be compatible. This class stores a single constraint stating that, for a given set of coordinate positions, all but at most a given maximum number of these positions must be set to zero in both vectors. This maximum number will be referred to as the non-zero coordinate cap.

Thus, for a pair of vectors to satisfy this constraint, the number of coordinate positions in the given set for which at least one of the two vectors has a non-zero entry must be at most the non-zero coordinate cap.

Python:
Not present.


Constructor & Destructor Documentation

regina::NCompConstraint::NCompConstraint (  )  [inline]

Creates a new constraint with an empty set of coordinate positions and a non-zero coordinate cap of zero.

regina::NCompConstraint::NCompConstraint ( unsigned  newMaxNonZero  )  [inline]

Creates a new constraint with an empty set of coordinate positions and the given non-zero coordinate cap.

Parameters:
newMaxNonZero the maximum number of coordinate positions from the associated set for which some vector may have non-zero entries without breaking this constraint.


Member Function Documentation

std::set< unsigned > & regina::NCompConstraint::getCoordinates (  )  [inline]

Returns the set of coordinate positions under consideration by this constraint.

This non-const member function may be used to modify the associated set of coordinate positions.

Returns:
the associated set of coordinate positions.

const std::set< unsigned > & regina::NCompConstraint::getCoordinates (  )  const [inline]

Returns the set of coordinate positions under consideration by this constraint.

Returns:
the associated set of coordinate positions.

unsigned regina::NCompConstraint::getMaxNonZero (  )  const [inline]

Returns the non-zero coordinate cap for this constraint.

Returns:
the maximum number of coordinate positions from the associated set for which some vector may have non-zero entries without breaking this constraint.

template<class T>
bool regina::NCompConstraint::isSatisfied ( const NVector< T > &  v  )  const

Determines whether the given vector satisfies this constraint.

Although constraints are defined in terms of pairs of vectors, a single vector can also be said to satisfy a constraint if the number of non-zero coordinates amongst the given set of coordinate positions is at most the given maximum.

Examining whether a single vector v satisfies a constraint is equivalent to deciding whether the pair (v, v) or equivalently the pair (v, 0) satisfies the constraint.

Parameters:
v the vector to examine.
Returns:
true if the given vector satisfies this constraint, or false otherwise.

template<class T>
bool regina::NCompConstraint::isSatisfied ( const NVector< T > &  first,
const NVector< T > &  second 
) const

Determines whether the given pair of vectors satisfies this constraint.

Parameters:
first the first of the two vectors to examine.
second the second of the two vectors to examine.
Returns:
true if the given pair of vectors satisfies this constraint, or false otherwise.

void regina::NCompConstraint::setMaxNonZero ( unsigned  newMaxNonZero  )  [inline]

Sets the non-zero coordinate cap for this constraint.

Parameters:
newMaxNonZero the maximum number of coordinate positions from the associated set for which some vector may have non-zero entries without breaking this constraint.


The documentation for this class was generated from the following file:
Copyright © 1999-2006, Ben Burton
This software is released under the GNU General Public License.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).