![]() |
SynAPSE
0.6.0
Synergistic Analysis of Phase Space Evolution
|
Computes the Voronoi tessellation of a set of points. More...
#include <Voronoi.hh>
Public Member Functions | |
| Voronoi () | |
| Default constructor, initilizes everything to 0. More... | |
| Voronoi (const std::vector< std::vector< double >> &points, const bool bounded=true, const double alpha=0., const double eps=1e-6) | |
| Cloud constructor, sets the vector of points. More... | |
| Voronoi (const Voronoi &vor) | |
| Copy constructor. More... | |
| Voronoi & | operator= (const Voronoi &vor) |
| Equality operator. More... | |
| ~Voronoi () | |
| Destructor. More... | |
| void | Initialize (const double alpha, const double eps) |
| Find the Voronoi tessellation of the N points. More... | |
| void | Initialize1D (const double alpha, const double eps) |
| Find the Voronoi tessellation of the N points in 1D (special case) More... | |
| const size_t | GetNpoints () const |
| Returns the array of points on which the triangulation is constructed. More... | |
| const std::vector< std::vector < double > > & | GetPointArray () const |
| Returns the array of points on which the triangulation is constructed. More... | |
| const std::vector< double > & | GetPoint (const size_t i) const |
| Returns a specific vertex. More... | |
| const std::vector< Hull > & | GetCellArray () const |
| Returns the array of cells corresponding to the array of vertice. More... | |
| const Hull & | GetCell (const size_t i) const |
| Returns a specific cell. More... | |
| const size_t & | GetDimension () const |
| Returns the dimension of the tesselated space. More... | |
| const bool & | IsBounded () const |
| Returns true if box points have been added. More... | |
| size_t | GetBestCellID (const std::vector< double > &v) const |
| Finds the closest cell and returns its hull. More... | |
| const Hull & | GetBestCell (const std::vector< double > &v) const |
| Finds the closest cell and returns its hull. More... | |
| double | SimplexVolume (const std::vector< double > &point) const |
| Returns the volume of a simplex in the current space. More... | |
| TPolyLine * | BoundingBox () const |
| Returns a rectangle to be drawn in ROOT (only 2D) More... | |
| std::vector< TPolyLine * > | Polygons () const |
| Returns an array of polygons to be drawn in ROOT (only 2D) More... | |
| TH2Poly * | DensityProfile () const |
| Returns a histogram where each bin is a cell and its content is its density. More... | |
| void | Draw (std::string name="", bool color=true, bool points=false, bool axes=false) const |
| Draws the Voronoi tesselation on a canvas. More... | |
Private Attributes | |
| size_t | _dim |
| Dimension of the space. More... | |
| std::vector< std::vector < double > > | _points |
| Vector of N points. More... | |
| std::vector< Hull > | _cells |
| Voronoi cells (subhulls) More... | |
| bool | _bounded |
| Switch to bound the points. More... | |
| std::vector< double > | _lower |
| Lower bounds in each dimension. More... | |
| std::vector< double > | _upper |
| Upper bounds in each dimension. More... | |
| KDTree * | _kdtree |
| k-d Tree of the points to find NNs More... | |
Computes the Voronoi tessellation of a set of points.
The Voronoi tessellation is obtained by computing the (n+1)-dimensional convex hull of the points by adding the L2 vector norm as an additional coordinate. This forms a paraboloid which projected bottom end corresponds to the Delaunay triangulation. The Voronoi tessellation is the dual graph of the Delaunay triangulation.
Qhull performs the heavy lifting, this is a front end class.
| Voronoi::Voronoi | ( | ) |
Default constructor, initilizes everything to 0.
| Voronoi::Voronoi | ( | const std::vector< std::vector< double >> & | points, |
| const bool | bounded = true, |
||
| const double | alpha = 0., |
||
| const double | eps = 1e-6 |
||
| ) |
Cloud constructor, sets the vector of points.
| points | N points in a _dim dimensional space |
| bounded | Add 2^_dim box points to contain the tessellation |
| alpha | Penalised Centroidal Voronoi Tessellation parameter |
| eps | Precision required for the pure CVT (alpha = 1.) |
| Voronoi::Voronoi | ( | const Voronoi & | vor | ) |
Copy constructor.
| Voronoi::~Voronoi | ( | ) |
Destructor.
| TPolyLine * Voronoi::BoundingBox | ( | ) | const |
Returns a rectangle to be drawn in ROOT (only 2D)
| TH2Poly * Voronoi::DensityProfile | ( | ) | const |
Returns a histogram where each bin is a cell and its content is its density.
| void Voronoi::Draw | ( | std::string | name = "", |
| bool | color = true, |
||
| bool | points = false, |
||
| bool | axes = false |
||
| ) | const |
Draws the Voronoi tesselation on a canvas.
| name | Will print the canvas as "VT_name.pdf" |
| color | Implements a color scale inverse proportional to the cell volume |
| points | Draws the points on which the tesselation is constructed |
| axes | Draws axes |
| const Hull & Voronoi::GetBestCell | ( | const std::vector< double > & | v | ) | const |
Finds the closest cell and returns its hull.
| size_t Voronoi::GetBestCellID | ( | const std::vector< double > & | v | ) | const |
Finds the closest cell and returns its hull.
|
inline |
Returns a specific cell.
|
inline |
Returns the array of cells corresponding to the array of vertice.
|
inline |
Returns the dimension of the tesselated space.
|
inline |
Returns the array of points on which the triangulation is constructed.
|
inline |
Returns a specific vertex.
|
inline |
Returns the array of points on which the triangulation is constructed.
| void Voronoi::Initialize | ( | const double | alpha, |
| const double | eps | ||
| ) |
Find the Voronoi tessellation of the N points.
| void Voronoi::Initialize1D | ( | const double | alpha, |
| const double | eps | ||
| ) |
Find the Voronoi tessellation of the N points in 1D (special case)
|
inline |
Returns true if box points have been added.
| std::vector< TPolyLine * > Voronoi::Polygons | ( | ) | const |
Returns an array of polygons to be drawn in ROOT (only 2D)
| double Voronoi::SimplexVolume | ( | const std::vector< double > & | point | ) | const |
Returns the volume of a simplex in the current space.
|
private |
Switch to bound the points.
|
private |
Dimension of the space.
|
private |
k-d Tree of the points to find NNs
|
private |
Lower bounds in each dimension.
|
private |
Vector of N points.
|
private |
Upper bounds in each dimension.
1.8.6