DGtal  1.5.beta
DGtal::BoundedLatticePolytopeCounter< TSpace > Class Template Reference

Aim: Useful to compute quickly the lattice points within a polytope, i.e. a convex polyhedron. More...

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

Public Types

typedef BoundedLatticePolytopeCounter< TSpace > Self
 
typedef TSpace Space
 
typedef BoundedLatticePolytope< TSpace > Polytope
 
using Integer = typename Polytope::Integer
 
using Point = typename Polytope::Point
 
using Vector = typename Polytope::Vector
 
using InequalityMatrix = typename Polytope::InequalityMatrix
 
using InequalityVector = typename Polytope::InequalityVector
 
using Domain = typename Polytope::Domain
 
using HalfSpace = typename Polytope::HalfSpace
 
using BigInteger = typename Polytope::BigInteger
 
using Intervals = IntegralIntervals< Integer >
 
using Interval = typename Intervals::Interval
 
using PointRange = std::vector< Point >
 
using LatticeSetByInterval = std::map< Point, Interval >
 Internal type used to represent a convex lattice point set. More...
 
using LatticeSetByIntervals = std::map< Point, Intervals >
 Internal type used to represent any lattice point set. More...
 

Public Member Functions

 BoundedLatticePolytopeCounter ()=default
 Default constructor. More...
 
 BoundedLatticePolytopeCounter (const Polytope &P)
 
void init (const Polytope *ptrP)
 
Interval intersectionIntervalAlongAxis (Point p, Dimension a) const
 
Interval interiorIntersectionIntervalAlongAxis (Point p, Dimension a) const
 
Integer countAlongAxis (Dimension a) const
 
Integer countInteriorAlongAxis (Dimension a) const
 
void getPointsAlongAxis (PointRange &pts, Dimension a) const
 
void getInteriorPointsAlongAxis (PointRange &pts, Dimension a) const
 
LatticeSetByInterval getLatticeSet (Dimension a) const
 
LatticeSetByInterval getLatticeCells (Dimension a) const
 
Dimension longestAxis () const
 
Point lowerBound () const
 
Point upperBound () const
 

Data Fields

const PolytopemyPolytope
 The associated polytope. More...
 
Point myLower
 The lower point of the tight bounding box to the associated polytope. More...
 
Point myUpper
 The upper point of the tight bounding box to the associated polytope. More...
 

Static Public Attributes

static const Dimension dimension = Space::dimension
 

Private Member Functions

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

Detailed Description

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

Aim: Useful to compute quickly the lattice points within a polytope, i.e. a convex polyhedron.

Description of template class 'BoundedLatticePolytopeCounter'

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

Template Parameters
TSpacean arbitrary model of CSpace.

Definition at line 66 of file BoundedLatticePolytopeCounter.h.

Member Typedef Documentation

◆ BigInteger

template<typename TSpace >
using DGtal::BoundedLatticePolytopeCounter< TSpace >::BigInteger = typename Polytope::BigInteger

Definition at line 80 of file BoundedLatticePolytopeCounter.h.

◆ Domain

template<typename TSpace >
using DGtal::BoundedLatticePolytopeCounter< TSpace >::Domain = typename Polytope::Domain

Definition at line 78 of file BoundedLatticePolytopeCounter.h.

◆ HalfSpace

template<typename TSpace >
using DGtal::BoundedLatticePolytopeCounter< TSpace >::HalfSpace = typename Polytope::HalfSpace

Definition at line 79 of file BoundedLatticePolytopeCounter.h.

◆ InequalityMatrix

template<typename TSpace >
using DGtal::BoundedLatticePolytopeCounter< TSpace >::InequalityMatrix = typename Polytope::InequalityMatrix

Definition at line 76 of file BoundedLatticePolytopeCounter.h.

◆ InequalityVector

template<typename TSpace >
using DGtal::BoundedLatticePolytopeCounter< TSpace >::InequalityVector = typename Polytope::InequalityVector

Definition at line 77 of file BoundedLatticePolytopeCounter.h.

◆ Integer

template<typename TSpace >
using DGtal::BoundedLatticePolytopeCounter< TSpace >::Integer = typename Polytope::Integer

Definition at line 73 of file BoundedLatticePolytopeCounter.h.

◆ Interval

template<typename TSpace >
using DGtal::BoundedLatticePolytopeCounter< TSpace >::Interval = typename Intervals::Interval

Definition at line 82 of file BoundedLatticePolytopeCounter.h.

◆ Intervals

template<typename TSpace >
using DGtal::BoundedLatticePolytopeCounter< TSpace >::Intervals = IntegralIntervals< Integer >

Definition at line 81 of file BoundedLatticePolytopeCounter.h.

◆ LatticeSetByInterval

template<typename TSpace >
using DGtal::BoundedLatticePolytopeCounter< TSpace >::LatticeSetByInterval = std::map< Point, Interval >

Internal type used to represent a convex lattice point set.

Definition at line 87 of file BoundedLatticePolytopeCounter.h.

◆ LatticeSetByIntervals

template<typename TSpace >
using DGtal::BoundedLatticePolytopeCounter< TSpace >::LatticeSetByIntervals = std::map< Point, Intervals >

Internal type used to represent any lattice point set.

Definition at line 90 of file BoundedLatticePolytopeCounter.h.

◆ Point

template<typename TSpace >
using DGtal::BoundedLatticePolytopeCounter< TSpace >::Point = typename Polytope::Point

Definition at line 74 of file BoundedLatticePolytopeCounter.h.

◆ PointRange

template<typename TSpace >
using DGtal::BoundedLatticePolytopeCounter< TSpace >::PointRange = std::vector< Point >

Definition at line 83 of file BoundedLatticePolytopeCounter.h.

◆ Polytope

template<typename TSpace >
typedef BoundedLatticePolytope<TSpace> DGtal::BoundedLatticePolytopeCounter< TSpace >::Polytope

Definition at line 72 of file BoundedLatticePolytopeCounter.h.

◆ Self

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

Definition at line 70 of file BoundedLatticePolytopeCounter.h.

◆ Space

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

Definition at line 71 of file BoundedLatticePolytopeCounter.h.

◆ Vector

template<typename TSpace >
using DGtal::BoundedLatticePolytopeCounter< TSpace >::Vector = typename Polytope::Vector

Definition at line 75 of file BoundedLatticePolytopeCounter.h.

Constructor & Destructor Documentation

◆ BoundedLatticePolytopeCounter() [1/2]

template<typename TSpace >
DGtal::BoundedLatticePolytopeCounter< TSpace >::BoundedLatticePolytopeCounter ( )
default

Default constructor.

◆ BoundedLatticePolytopeCounter() [2/2]

template<typename TSpace >
DGtal::BoundedLatticePolytopeCounter< TSpace >::BoundedLatticePolytopeCounter ( const Polytope P)

Constructor from valid polytope

Parameters
Pany polytope

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

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

◆ countAlongAxis()

template<typename TSpace >
Integer DGtal::BoundedLatticePolytopeCounter< TSpace >::countAlongAxis ( Dimension  a) const
Parameters
aany axis with 0 <= a < d, where d is the dimension of the space.
Returns
the number of lattice point inside the current polytope.
Note
The result does not depend on parameter a, but the speed of computations depend on this choixe. The best choice is the one that minimizes the projected area of the polytope along this axis.
See also
longestAxis

◆ countInteriorAlongAxis()

template<typename TSpace >
Integer DGtal::BoundedLatticePolytopeCounter< TSpace >::countInteriorAlongAxis ( Dimension  a) const
Parameters
aany axis with 0 <= a < d, where d is the dimension of the space.
Returns
the number of lattice point strictly inside the current polytope.
Note
The result does not depend on parameter a, but the speed of computation depends on this choice. The best choice is the one that minimizes the projected area of the polytope along this axis.
See also
longestAxis

◆ getInteriorPointsAlongAxis()

template<typename TSpace >
void DGtal::BoundedLatticePolytopeCounter< TSpace >::getInteriorPointsAlongAxis ( PointRange pts,
Dimension  a 
) const
Parameters
[out]ptsthe range of lattice points that are interior to this polytope.
aany axis with 0 <= a < d, where d is the dimension of the space.
Returns
the lattice points strictly inside the current polytope.
Note
The result does not depend on parameter a, but the speed of computation depends on this choice. The best choice is the one that minimizes the projected area of the polytope along this axis.
See also
longestAxis

◆ getLatticeCells()

template<typename TSpace >
LatticeSetByInterval DGtal::BoundedLatticePolytopeCounter< TSpace >::getLatticeCells ( Dimension  a) const
Parameters
aany axis with 0 <= a < d, where d is the dimension of the space.
Returns
the set of cells (as points with Khalimsky coordinates) whose closure touched the current polytope, represented as intervals along the given rows specified by the axis.
Note
The given polytope should have been built from a set of points dilated by the unit cube in order to get exactly the Star of the initial polytope.

◆ getLatticeSet()

template<typename TSpace >
LatticeSetByInterval DGtal::BoundedLatticePolytopeCounter< TSpace >::getLatticeSet ( Dimension  a) const
Parameters
aany axis with 0 <= a < d, where d is the dimension of the space.
Returns
the set of lattice points within the current polytope, represented as intervals along the given rows specified by the axis.

◆ getPointsAlongAxis()

template<typename TSpace >
void DGtal::BoundedLatticePolytopeCounter< TSpace >::getPointsAlongAxis ( PointRange pts,
Dimension  a 
) const
Parameters
[out]ptsthe range of lattice points that are inside this polytope.
aany axis with 0 <= a < d, where d is the dimension of the space.
Note
The result does not depend on parameter a, but the speed of computation depends on this choice. The best choice is the one that minimizes the projected area of the polytope along this axis.
See also
longestAxis

◆ init()

template<typename TSpace >
void DGtal::BoundedLatticePolytopeCounter< TSpace >::init ( const Polytope ptrP)

Initialization from polytope pointer (nullptr if you want to create an invalid polytope).

Parameters
ptrPany pointer on a polytope or nullptr.

◆ interiorIntersectionIntervalAlongAxis()

template<typename TSpace >
Interval DGtal::BoundedLatticePolytopeCounter< TSpace >::interiorIntersectionIntervalAlongAxis ( Point  p,
Dimension  a 
) const

Computes the intersection of the lattice points of the infinite line going through point p along axis a and the interior of the current polytope, returned as an interval [b,e), where bis the a-th coordinate of the first lattice point in common, while e is the a-th coordinate after the last lattice point in common.

Parameters
pany point with the current domain
aany axis between 0 (included) and dimension (excluded).
Returns
the interval [b,e) of intersection, which is such that b==e when there is no intersection.

◆ intersectionIntervalAlongAxis()

template<typename TSpace >
Interval DGtal::BoundedLatticePolytopeCounter< TSpace >::intersectionIntervalAlongAxis ( Point  p,
Dimension  a 
) const

Computes the intersection of the lattice points of the infinite line going through point p along axis a and the current polytope, returned as an interval [b,e), where bis the a-th coordinate of the first lattice point in common, while e is the a-th coordinate after the last lattice point in common.

Parameters
pany point with the current domain
aany axis between 0 (included) and dimension (excluded).
Returns
the interval [b,e) of intersection, which is such that b==e when there is no intersection.

◆ longestAxis()

template<typename TSpace >
Dimension DGtal::BoundedLatticePolytopeCounter< TSpace >::longestAxis ( ) const
Returns
the most elongated axis of the bounding box of the current polytope.

◆ lowerBound()

template<typename TSpace >
Point DGtal::BoundedLatticePolytopeCounter< TSpace >::lowerBound ( ) const
inline
Returns
the lower point of the tight bounding box of the current polytope.

Definition at line 197 of file BoundedLatticePolytopeCounter.h.

197 { return myLower; }
Point myLower
The lower point of the tight bounding box to the associated polytope.

References DGtal::BoundedLatticePolytopeCounter< TSpace >::myLower.

◆ upperBound()

template<typename TSpace >
Point DGtal::BoundedLatticePolytopeCounter< TSpace >::upperBound ( ) const
inline
Returns
the upper point of the tight bounding box of the current polytope.

Definition at line 199 of file BoundedLatticePolytopeCounter.h.

199 { return myUpper; }
Point myUpper
The upper point of the tight bounding box to the associated polytope.

References DGtal::BoundedLatticePolytopeCounter< TSpace >::myUpper.

Field Documentation

◆ dimension

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

Definition at line 84 of file BoundedLatticePolytopeCounter.h.

◆ myLower

template<typename TSpace >
Point DGtal::BoundedLatticePolytopeCounter< TSpace >::myLower

The lower point of the tight bounding box to the associated polytope.

Definition at line 206 of file BoundedLatticePolytopeCounter.h.

Referenced by DGtal::BoundedLatticePolytopeCounter< TSpace >::lowerBound().

◆ myPolytope

template<typename TSpace >
const Polytope* DGtal::BoundedLatticePolytopeCounter< TSpace >::myPolytope

The associated polytope.

Definition at line 204 of file BoundedLatticePolytopeCounter.h.

◆ myUpper

template<typename TSpace >
Point DGtal::BoundedLatticePolytopeCounter< TSpace >::myUpper

The upper point of the tight bounding box to the associated polytope.

Definition at line 208 of file BoundedLatticePolytopeCounter.h.

Referenced by DGtal::BoundedLatticePolytopeCounter< TSpace >::upperBound().


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