DGtal 1.3.0
Searching...
No Matches
DGtal::BoundedRationalPolytope< TSpace > Class Template Reference

Aim: Represents an nD rational polytope, i.e. a convex polyhedron bounded by vertices with rational coordinates, as a set of inequalities. Otherwise said, it is a H-representation of a polytope (as an intersection of half-spaces). A limitation is that we model only bounded polytopes, i.e. polytopes that can be included in a finite bounding box. More...

#include <DGtal/geometry/volumes/BoundedRationalPolytope.h>

## Data Structures

struct  Rational

struct  UnitCell

struct  UnitSegment

## Public Types

typedef BoundedRationalPolytope< TSpace > Self

typedef TSpace Space

typedef Space::Integer Integer

typedef Space::Point Point

typedef Space::Vector Vector

typedef std::vector< VectorInequalityMatrix

typedef std::vector< IntegerInequalityVector

typedef HyperRectDomain< SpaceDomain

typedef ClosedIntegerHalfPlane< SpaceHalfSpace

typedef DGtal::BigInteger BigInteger

## Public Member Functions

Standard services (construction, initialization, assignment)
~BoundedRationalPolytope ()=default

BoundedRationalPolytope ()

BoundedRationalPolytope (const Self &other)=default

BoundedRationalPolytope (std::initializer_list< Point > l)

template<typename PointIterator >
BoundedRationalPolytope (Integer d, PointIterator itB, PointIterator itE)

template<typename HalfSpaceIterator >
BoundedRationalPolytope (Integer d, const Domain &domain, HalfSpaceIterator itB, HalfSpaceIterator itE, bool valid_edge_constraints=false, bool check_duplicate_constraints=false)

template<typename HalfSpaceIterator >
void init (Integer d, const Domain &domain, HalfSpaceIterator itB, HalfSpaceIterator itE, bool valid_edge_constraints=false, bool check_duplicate_constraints=false)

template<typename PointIterator >
bool init (Integer d, PointIterator itB, PointIterator itE)

Selfoperator= (const Self &other)=default

void clear ()
Clears the polytope. More...

Accessor services
const DomaingetDomain () const

const DomaingetLatticeDomain () const

const DomaingetRationalDomain () const

unsigned int nbHalfSpaces () const

Integer denominator () const

const VectorgetA (unsigned int i) const

Integer getB (unsigned int i) const

bool isLarge (unsigned int i) const

const InequalityMatrixgetA () const

const InequalityVectorgetB () const

const std::vector< bool > & getI () const

bool canBeSummed () const

Check point services (is inside test)
bool isInside (const Point &p) const

bool isDomainPointInside (const Point &p) const

bool isInterior (const Point &p) const

bool isBoundary (const Point &p) const

Global modification services (cut, swap, Minkowski sum)
BoundedRationalPolytope interiorPolytope () const

unsigned int cut (Dimension k, bool pos, Integer b, bool large=true)

unsigned int cut (const Vector &a, Integer b, bool large=true, bool valid_edge_constraint=false)

unsigned int cut (const HalfSpace &hs, bool large=true, bool valid_edge_constraint=false)

void swap (BoundedRationalPolytope &other)

Selfoperator*= (Integer t)

Selfoperator*= (Rational r)

Selfoperator+= (UnitSegment s)

Selfoperator+= (UnitCell c)

Enumeration services (counting, get points in polytope)
Integer count () const

Integer countInterior () const

Integer countBoundary () const

Integer countWithin (Point low, Point hi) const

Integer countUpTo (Integer max) const

void getPoints (std::vector< Point > &pts) const

void getInteriorPoints (std::vector< Point > &pts) const

void getBoundaryPoints (std::vector< Point > &pts) const

template<typename PointSet >
void insertPoints (PointSet &pts_set) const

Interface services
void selfDisplay (std::ostream &out) const

bool isValid () const

std::string className () const

## Static Public Attributes

static const Dimension dimension = Space::dimension

## Protected Attributes

Integer q

InequalityMatrix A

InequalityVector B

Domain rationalD

Domain latticeD

std::vector< bool > I

bool myValidEdgeConstraints

## Private Member Functions

BOOST_CONCEPT_ASSERT ((concepts::CSpace< TSpace >))

bool internalInitFromTriangle3D (Point a, Point b, Point c)

bool internalInitFromSegment3D (Point a, Point b)

bool internalInitFromSegment2D (Point a, Point b)

Domain computeLatticeDomain (const Domain &d)

Domain computeRationalDomain (const Domain &d)

## Detailed Description

template<typename TSpace>
class DGtal::BoundedRationalPolytope< TSpace >

Aim: Represents an nD rational polytope, i.e. a convex polyhedron bounded by vertices with rational coordinates, as a set of inequalities. Otherwise said, it is a H-representation of a polytope (as an intersection of half-spaces). A limitation is that we model only bounded polytopes, i.e. polytopes that can be included in a finite bounding box.

Description of template class 'BoundedRationalPolytope'

It is a model of boost::CopyConstructible, boost::DefaultConstructible, boost::Assignable.

Template Parameters
 TSpace an arbitrary model of CSpace.

Definition at line 74 of file BoundedRationalPolytope.h.

## ◆ BigInteger

template<typename TSpace >
 typedef DGtal::BigInteger DGtal::BoundedRationalPolytope< TSpace >::BigInteger

Definition at line 89 of file BoundedRationalPolytope.h.

## ◆ Domain

template<typename TSpace >
 typedef HyperRectDomain< Space > DGtal::BoundedRationalPolytope< TSpace >::Domain

Definition at line 86 of file BoundedRationalPolytope.h.

## ◆ HalfSpace

template<typename TSpace >
 typedef ClosedIntegerHalfPlane< Space > DGtal::BoundedRationalPolytope< TSpace >::HalfSpace

Definition at line 87 of file BoundedRationalPolytope.h.

## ◆ InequalityMatrix

template<typename TSpace >
 typedef std::vector DGtal::BoundedRationalPolytope< TSpace >::InequalityMatrix

Definition at line 84 of file BoundedRationalPolytope.h.

## ◆ InequalityVector

template<typename TSpace >
 typedef std::vector DGtal::BoundedRationalPolytope< TSpace >::InequalityVector

Definition at line 85 of file BoundedRationalPolytope.h.

## ◆ Integer

template<typename TSpace >
 typedef Space::Integer DGtal::BoundedRationalPolytope< TSpace >::Integer

Definition at line 81 of file BoundedRationalPolytope.h.

## ◆ Point

template<typename TSpace >
 typedef Space::Point DGtal::BoundedRationalPolytope< TSpace >::Point

Definition at line 82 of file BoundedRationalPolytope.h.

## ◆ Self

template<typename TSpace >
 typedef BoundedRationalPolytope DGtal::BoundedRationalPolytope< TSpace >::Self

Definition at line 79 of file BoundedRationalPolytope.h.

## ◆ Space

template<typename TSpace >
 typedef TSpace DGtal::BoundedRationalPolytope< TSpace >::Space

Definition at line 80 of file BoundedRationalPolytope.h.

## ◆ Vector

template<typename TSpace >
 typedef Space::Vector DGtal::BoundedRationalPolytope< TSpace >::Vector

Definition at line 83 of file BoundedRationalPolytope.h.

## ◆ ~BoundedRationalPolytope()

template<typename TSpace >
 DGtal::BoundedRationalPolytope< TSpace >::~BoundedRationalPolytope ( )
default

Destructor.

## ◆ BoundedRationalPolytope() [1/5]

template<typename TSpace >
 DGtal::BoundedRationalPolytope< TSpace >::BoundedRationalPolytope ( )

Constructor.

## ◆ BoundedRationalPolytope() [2/5]

template<typename TSpace >
 DGtal::BoundedRationalPolytope< TSpace >::BoundedRationalPolytope ( const Self & other )
default

Copy constructor.

Parameters
 other the object to clone.

## ◆ BoundedRationalPolytope() [3/5]

template<typename TSpace >
 DGtal::BoundedRationalPolytope< TSpace >::BoundedRationalPolytope ( std::initializer_list< Point > l )

Constructs the polytope from a simplex given as an initializer_list.

Parameters
 l any list where the first point give the denominator and then no more than d+1 points in general positions.
Note
If your list is l = { (4,x), (3,2), (1,7), (6,6) }, then the denominator is d = 4 and your polytope has vertices { (3/4,2/4), (1/4,7/4), (6/4,6/4) }.

## ◆ BoundedRationalPolytope() [4/5]

template<typename TSpace >
template<typename PointIterator >
 DGtal::BoundedRationalPolytope< TSpace >::BoundedRationalPolytope ( Integer d, PointIterator itB, PointIterator itE )

Constructs the polytope from a simplex given as a range [itB,itE) of lattice points.

Template Parameters
 PointIterator any model of forward iterator on Point.
Parameters
 d the common denominator of all given lattice point coordinates. itB the start of the range of no more than n+1 points defining the simplex. itE past the end the range of no more than n+1 points defining the simplex.
Note
If your range is [itB,itE) = { (3,2), (1,7), (6,6) } and the denominator d = 4, then your polytope has vertices { (3/4,2/4), (1/4,7/4), (6/4,6/4) }.

## ◆ BoundedRationalPolytope() [5/5]

template<typename TSpace >
template<typename HalfSpaceIterator >
 DGtal::BoundedRationalPolytope< TSpace >::BoundedRationalPolytope ( Integer d, const Domain & domain, HalfSpaceIterator itB, HalfSpaceIterator itE, bool valid_edge_constraints = false, bool check_duplicate_constraints = false )

Constructs a polytope from a domain and a collection of half-spaces.

Template Parameters
 HalfSpaceIterator any model of forward iterator on HalfSpace.
Parameters
 d the common denominator of all given lattice point coordinates. domain a bounded lattice domain. itB the start of the range of half-spaces. itE past the end of the range of half-spaces. valid_edge_constraints when 'true', tells that there are half-spaces that represents th constraints on edges (n-2 cells) lying between two faces (n-1 cells) pointing to different orthants. check_duplicate_constraints when 'true', the initialization checks if the given range of half-spaces contains axis-aligned half-space constraints already defined by the domain and if so it merges the duplicated constraints, otherwise it accepts and stores the constraints as is.
Note
Asumme your real domain is { (-2.25,-1), (3.75, 4.25) } and real halfspaces are ‘{ (1.5*x+2.5*y <= 3), (0.5*x-1.25*y <= 2.5) }. Then for denominator 'd = 4’, you must pass domain={ (-9,-4), (15,17) }, and [itB,itE) = { (6*x+10*y <= 12), (2*x-5*y <= 10) }.

## ◆ BOOST_CONCEPT_ASSERT()

template<typename TSpace >
 DGtal::BoundedRationalPolytope< TSpace >::BOOST_CONCEPT_ASSERT ( (concepts::CSpace< TSpace >) )
private

## ◆ canBeSummed()

template<typename TSpace >
 bool DGtal::BoundedRationalPolytope< TSpace >::canBeSummed ( ) const
Returns
'true' if we can perform exact Minkowksi sums on this polytope. This is related to the presence of valid edge constraints (n-k cells for k >= 2) in-between face constraints (n-1 cells) that change orthants.

## ◆ className()

template<typename TSpace >
 std::string DGtal::BoundedRationalPolytope< TSpace >::className ( ) const
Returns
the class name. It is notably used for drawing this object.

## ◆ clear()

template<typename TSpace >
 void DGtal::BoundedRationalPolytope< TSpace >::clear ( )

Clears the polytope.

## ◆ computeLatticeDomain()

template<typename TSpace >
 Domain DGtal::BoundedRationalPolytope< TSpace >::computeLatticeDomain ( const Domain & d )
private

Computes the lattice domain from the given rational domain, i.e. d/q

Parameters
 d a domain where integer coordinates (x,y,z) means rational coordinates (x/q,y/q,z/q) where q is the denominator of the rational polytope.

## ◆ computeRationalDomain()

template<typename TSpace >
 Domain DGtal::BoundedRationalPolytope< TSpace >::computeRationalDomain ( const Domain & d )
private

Computes the rational domain from the given lattice domain, i.e. d*q

Parameters
 d a domain where integer coordinates (x,y,z) means lattice coordinates.

## ◆ count()

template<typename TSpace >
 Integer DGtal::BoundedRationalPolytope< TSpace >::count ( ) const

Computes the number of integer points lying within the polytope.

Returns
the number of integer points lying within the polytope.
Note
Quite slow: obtained by checking every point of the polytope domain.

## ◆ countBoundary()

template<typename TSpace >
 Integer DGtal::BoundedRationalPolytope< TSpace >::countBoundary ( ) const

Computes the number of integer points lying on the boundary of the polytope.

Returns
the number of integer points lying on the boundary of the polytope.
Note
Quite slow: obtained by checking every point of the polytope domain.
count() <= countInterior() + countBoundary() with equality when the polytope is closed.

## ◆ countInterior()

template<typename TSpace >
 Integer DGtal::BoundedRationalPolytope< TSpace >::countInterior ( ) const

Computes the number of integer points lying within the interior of the polytope.

Returns
the number of integer points lying within the interior of the polytope.
Note
Quite slow: obtained by checking every point of the polytope domain.
count() <= countInterior() + countBoundary() with equality when the polytope is closed.

## ◆ countUpTo()

template<typename TSpace >
 Integer DGtal::BoundedRationalPolytope< TSpace >::countUpTo ( Integer max ) const

Computes the number of integer points within the polytope up to some maximum number max.

Note
For instance, a d-dimensional simplex that contains no integer points in its interior contains only d+1 points. If there is more, you know that the simplex has a non empty interior.
Parameters
 [in] max the maximum number of points that are counted, the method exists when this number of reached.
Returns
the number of integer points within the polytope up to .
Note
Quite slow: obtained by checking every point of the polytope domain.

## ◆ countWithin()

template<typename TSpace >
 Integer DGtal::BoundedRationalPolytope< TSpace >::countWithin ( Point low, Point hi ) const

Computes the number of integer points within the polytope and the domain bounded by low and hi.

Parameters
 [in] low the lowest lattice point of the domain. [in] hi the highest lattice point of the domain.
Returns
the number of integer points within the polytope.
Note
Quite slow: obtained by checking every point of the polytope domain.

## ◆ cut() [1/3]

template<typename TSpace >
 unsigned int DGtal::BoundedRationalPolytope< TSpace >::cut ( const HalfSpace & hs, bool large = true, bool valid_edge_constraint = false )

Cuts the lattice polytope with the given half-space constraint.

Parameters
 hs any half-space constraint. large tells if the inequality is large (true) or strict (false). valid_edge_constraint when 'true', tells that the half-spaces that represents constraints on edges (n-2 cells) lying between two faces (n-1 cells) pointing to different orthants are still valid after this operation.
Returns
the index of the constraint in the polytope.
Note
For now complexity is O(n) where n=A.rows() because it checks if a parallel closed half-space defines already a face of the polytope.

## ◆ cut() [2/3]

template<typename TSpace >
 unsigned int DGtal::BoundedRationalPolytope< TSpace >::cut ( const Vector & a, Integer b, bool large = true, bool valid_edge_constraint = false )

Cut the polytope by the given half space a.x <= b or a.x < b.

Parameters
 a any integer vector b any integer number large tells if the inequality is large (true) or strict (false). valid_edge_constraint when 'true', tells that the half-spaces that represents constraints on edges (n-2 cells) lying between two faces (n-1 cells) pointing to different orthants are still valid after this operation.
Returns
the index of the constraint in the polytope.
Note
For now complexity is O(n) where n=A.rows() because it checks if a parallel closed half-space defines already a face of the polytope.

## ◆ cut() [3/3]

template<typename TSpace >
 unsigned int DGtal::BoundedRationalPolytope< TSpace >::cut ( Dimension k, bool pos, Integer b, bool large = true )

Cut the polytope by the given half space a.x <= b or a.x < b where a is some axis vector.

Parameters
 k the dimension of the axis vector $$+/- e_k$$ pos 'true' is positive, 'false' is negative for the axis vector $$+/- e_k$$ b any integer number large tells if the inequality is large (true) or strict (false).
Returns
the index of the constraint in the polytope.

## ◆ denominator()

template<typename TSpace >
 Integer DGtal::BoundedRationalPolytope< TSpace >::denominator ( ) const
Returns
the denominator of the polytope, i.e. vertices lattice coordinates must be divided by this value, or otherwise said, constraints are multiplied by this factor.

## ◆ getA() [1/2]

template<typename TSpace >
 const InequalityMatrix & DGtal::BoundedRationalPolytope< TSpace >::getA ( ) const
Returns
the matrix A in the polytope representation $$Ax \le B$$.

## ◆ getA() [2/2]

template<typename TSpace >
 const Vector & DGtal::BoundedRationalPolytope< TSpace >::getA ( unsigned int i ) const
Parameters
 i the index of the half-space constraint between 0 and nbHalfSpaces() (excluded).
Returns
the normal vector of the i-th half space constraint (i.e. A in constraint Ax <= b).

## ◆ getB() [1/2]

template<typename TSpace >
 const InequalityVector & DGtal::BoundedRationalPolytope< TSpace >::getB ( ) const
Returns
the vector B in the polytope representation $$Ax \le B$$.

## ◆ getB() [2/2]

template<typename TSpace >
 Integer DGtal::BoundedRationalPolytope< TSpace >::getB ( unsigned int i ) const
Parameters
 i the index of the half-space constraint between 0 and nbHalfSpaces() (excluded).
Returns
the offset of the i-th half space constraint (i.e. b in constraint Ax <= b).

## ◆ getBoundaryPoints()

template<typename TSpace >
 void DGtal::BoundedRationalPolytope< TSpace >::getBoundaryPoints ( std::vector< Point > & pts ) const

Computes the integer points boundary to the polytope.

Parameters
 [out] pts the integer points boundary to the polytope.
Note
Quite slow: obtained by checking every point of the polytope domain.
At output, pts.size() == this->countBoundary()

## ◆ getDomain()

template<typename TSpace >
 const Domain & DGtal::BoundedRationalPolytope< TSpace >::getDomain ( ) const
Returns
the lattice domain of the current polytope.

## ◆ getI()

template<typename TSpace >
 const std::vector< bool > & DGtal::BoundedRationalPolytope< TSpace >::getI ( ) const
Returns
the vector I telling if inequalities are large in the polytope representation $$Ax \prec B$$, with $$\prec \in \{ <, \le \}$$.

## ◆ getInteriorPoints()

template<typename TSpace >
 void DGtal::BoundedRationalPolytope< TSpace >::getInteriorPoints ( std::vector< Point > & pts ) const

Computes the integer points interior to the polytope.

Parameters
 [out] pts the integer points interior to the polytope.
Note
Quite slow: obtained by checking every point of the polytope domain.
At output, pts.size() == this->countInterior()

## ◆ getLatticeDomain()

template<typename TSpace >
 const Domain & DGtal::BoundedRationalPolytope< TSpace >::getLatticeDomain ( ) const
Returns
the lattice domain of the current polytope.
Note
same as getDomain

## ◆ getPoints()

template<typename TSpace >
 void DGtal::BoundedRationalPolytope< TSpace >::getPoints ( std::vector< Point > & pts ) const

Computes the integer points within the polytope.

Parameters
 [out] pts the integer points within the polytope.
Note
Quite slow: obtained by checking every point of the polytope domain.
At output, pts.size() == this->count()

## ◆ getRationalDomain()

template<typename TSpace >
 const Domain & DGtal::BoundedRationalPolytope< TSpace >::getRationalDomain ( ) const
Returns
the rational domain of the current polytope.
Note
when divided by the polytope denominator, it is the lattice domain.

## ◆ init() [1/2]

template<typename TSpace >
template<typename HalfSpaceIterator >
 void DGtal::BoundedRationalPolytope< TSpace >::init ( Integer d, const Domain & domain, HalfSpaceIterator itB, HalfSpaceIterator itE, bool valid_edge_constraints = false, bool check_duplicate_constraints = false )

Initializes a polytope from a domain and a vector of half-spaces.

Template Parameters
 HalfSpaceIterator any model of forward iterator on HalfSpace.
Parameters
 d the common denominator of all given lattice point coordinates. domain a bounded lattice domain. itB the start of the range of half-spaces. itE past the end of the range of half-spaces. valid_edge_constraints when 'true', tells that there are half-spaces that represents th constraints on edges (n-2 cells) lying between two faces (n-1 cells) pointing to different orthants. check_duplicate_constraints when 'true', the initialization checks if the given range of half-spaces contains axis-aligned half-space constraints already defined by the domain and if so it merges the duplicated constraints, otherwise it accepts and stores the constraints as is.
Note
Asumme your real domain is { (-2.25,-1), (3.75, 4.25) } and real halfspaces are ‘{ (1.5*x+2.5*y <= 3), (0.5*x-1.25*y <= 2.5) }. Then for denominator 'd = 4’, you must pass domain={ (-9,-4), (15,17) }, and [itB,itE) = { (6*x+10*y <= 12), (2*x-5*y <= 10) }.

## ◆ init() [2/2]

template<typename TSpace >
template<typename PointIterator >
 bool DGtal::BoundedRationalPolytope< TSpace >::init ( Integer d, PointIterator itB, PointIterator itE )

Initializes the polytope from a simplex given as a range [itB,itE) of points.

Parameters
 d the common denominator of all given lattice point coordinates. itB the start of the range of no more than n+1 points defining the simplex. itE past the end the range of no more than n+1 points defining the simplex.
Returns
'true' if [itB,itE) was a valid simplex, otherwise return 'false' and the polytope is empty.
Note
If your range is [itB,itE) = { (3,2), (1,7), (6,6) } and the denominator d = 4, then your polytope is bounded by { (3/4,2/4), (1/4,7/4), (6/4,6/4) }.
Use DGtal SimpleMatrix::determinant which is not efficient when the dimension is high. Does not use Eigen to avoid dependency.

## ◆ insertPoints()

template<typename TSpace >
template<typename PointSet >
 void DGtal::BoundedRationalPolytope< TSpace >::insertPoints ( PointSet & pts_set ) const

Computes the integer points within the polytope.

Template Parameters
 PointSet any model of set with a method insert( Point ).
Parameters
 [in,out] pts_set the set of points where points within this polytope are inserted.
Note
Quite slow: obtained by checking every point of the polytope domain.

## ◆ interiorPolytope()

template<typename TSpace >
 BoundedRationalPolytope DGtal::BoundedRationalPolytope< TSpace >::interiorPolytope ( ) const
Returns
the interior (in the topological sense) of this polytope, by making all constraints strict.

## ◆ internalInitFromSegment2D()

template<typename TSpace >
 bool DGtal::BoundedRationalPolytope< TSpace >::internalInitFromSegment2D ( Point a, Point b )
private

In 2D, builds a valid lattice polytope with empty interior from 2 points.

Parameters
 a any point b any point
Returns
'true'

## ◆ internalInitFromSegment3D()

template<typename TSpace >
 bool DGtal::BoundedRationalPolytope< TSpace >::internalInitFromSegment3D ( Point a, Point b )
private

In 3D, builds a valid lattice polytope with empty interior from 2 points.

Parameters
 a any point b any point
Returns
'true'

## ◆ internalInitFromTriangle3D()

template<typename TSpace >
 bool DGtal::BoundedRationalPolytope< TSpace >::internalInitFromTriangle3D ( Point a, Point b, Point c )
private

In 3D, builds a valid lattice polytope with empty interior from 3 non-colinear points.

Parameters
 a any point such that a, b, and c are not colinear. b any point such that a, b, and c are not colinear. c any point such that a, b, and c are not colinear.
Returns
'true' if they were not colinear, false otherwise.

## ◆ isBoundary()

template<typename TSpace >
 bool DGtal::BoundedRationalPolytope< TSpace >::isBoundary ( const Point & p ) const
Parameters
 p any point of the space.
Returns
'true' if and only if p lies on the boundary of this polytope.

## ◆ isDomainPointInside()

template<typename TSpace >
 bool DGtal::BoundedRationalPolytope< TSpace >::isDomainPointInside ( const Point & p ) const
Parameters
 p any point inside the domain of this polytope.
Returns
'true' if and only if p is inside this polytope.
Note
Slightly faster than isInside.

## ◆ isInside()

template<typename TSpace >
 bool DGtal::BoundedRationalPolytope< TSpace >::isInside ( const Point & p ) const
Parameters
 p any point of the space.
Returns
'true' if and only if p is inside this polytope.

## ◆ isInterior()

template<typename TSpace >
 bool DGtal::BoundedRationalPolytope< TSpace >::isInterior ( const Point & p ) const
Parameters
 p any point of the space.
Returns
'true' if and only if p is strictly inside this polytope.

## ◆ isLarge()

template<typename TSpace >
 bool DGtal::BoundedRationalPolytope< TSpace >::isLarge ( unsigned int i ) const
Parameters
 i the index of the half-space constraint between 0 and nbHalfSpaces() (excluded).
Returns
'true' if the i-th half space constraint is of the form Ax <= b, 'false' if it is of the form Ax < b.

## ◆ isValid()

template<typename TSpace >
 bool DGtal::BoundedRationalPolytope< TSpace >::isValid ( ) const

Checks the validity/consistency of the object. If the polytope has been default constructed, it is invalid.

Returns
'true' if the object is valid, 'false' otherwise.

## ◆ nbHalfSpaces()

template<typename TSpace >
 unsigned int DGtal::BoundedRationalPolytope< TSpace >::nbHalfSpaces ( ) const
Returns
the number of half-space constraints.

## ◆ operator*=() [1/2]

template<typename TSpace >
 Self & DGtal::BoundedRationalPolytope< TSpace >::operator*= ( Integer t )

Dilates this polytope P by t.

Parameters
 t any integer.
Returns
a reference to 'this', which is now the polytope tP.

## ◆ operator*=() [2/2]

template<typename TSpace >
 Self & DGtal::BoundedRationalPolytope< TSpace >::operator*= ( Rational r )

Dilates this polytope P by rational r.p/r.q.

Parameters
 r any rational.
Returns
a reference to 'this', which is now the polytope rP.

## ◆ operator+=() [1/2]

template<typename TSpace >
 Self & DGtal::BoundedRationalPolytope< TSpace >::operator+= ( UnitCell c )

Minkowski sum of this polytope with an axis-aligned unit cell.

Parameters
 c any unit cell.
Returns
a reference to 'this'.

## ◆ operator+=() [2/2]

template<typename TSpace >
 Self & DGtal::BoundedRationalPolytope< TSpace >::operator+= ( UnitSegment s )

Minkowski sum of this polytope with a unit segment aligned with some axis.

Parameters
 s any unit segment.
Returns
a reference to 'this'.

## ◆ operator=()

template<typename TSpace >
 Self & DGtal::BoundedRationalPolytope< TSpace >::operator= ( const Self & other )
default

Assignment.

Parameters
 other the object to copy.
Returns
a reference on 'this'.

## ◆ selfDisplay()

template<typename TSpace >
 void DGtal::BoundedRationalPolytope< TSpace >::selfDisplay ( std::ostream & out ) const

Writes/Displays the object on an output stream.

Parameters
 out the output stream where the object is written.

## ◆ swap()

template<typename TSpace >
 void DGtal::BoundedRationalPolytope< TSpace >::swap ( BoundedRationalPolytope< TSpace > & other )

Swaps the content of this object with other. O(1) complexity.

Parameters
 other any other BoundedRationalPolytope.

## ◆ A

template<typename TSpace >
 InequalityMatrix DGtal::BoundedRationalPolytope< TSpace >::A
protected

Definition at line 633 of file BoundedRationalPolytope.h.

## ◆ B

template<typename TSpace >
 InequalityVector DGtal::BoundedRationalPolytope< TSpace >::B
protected

Definition at line 635 of file BoundedRationalPolytope.h.

## ◆ dimension

template<typename TSpace >
 const Dimension DGtal::BoundedRationalPolytope< TSpace >::dimension = Space::dimension
static

Definition at line 93 of file BoundedRationalPolytope.h.

## ◆ I

template<typename TSpace >
 std::vector DGtal::BoundedRationalPolytope< TSpace >::I
protected

Definition at line 641 of file BoundedRationalPolytope.h.

## ◆ latticeD

template<typename TSpace >
 Domain DGtal::BoundedRationalPolytope< TSpace >::latticeD
protected

Definition at line 639 of file BoundedRationalPolytope.h.

## ◆ myValidEdgeConstraints

template<typename TSpace >
 bool DGtal::BoundedRationalPolytope< TSpace >::myValidEdgeConstraints
protected

Definition at line 643 of file BoundedRationalPolytope.h.

## ◆ q

template<typename TSpace >
 Integer DGtal::BoundedRationalPolytope< TSpace >::q
protected

Definition at line 631 of file BoundedRationalPolytope.h.

## ◆ rationalD

template<typename TSpace >
 Domain DGtal::BoundedRationalPolytope< TSpace >::rationalD
protected

Definition at line 637 of file BoundedRationalPolytope.h.

The documentation for this class was generated from the following file: