Delaunay complex reference manual#

class gudhi.DelaunayComplex#

DelaunayComplex is a simplicial complex constructed from the finite cells of a Delaunay Triangulation.

When filtration is:

  • None (default value) - The filtration value of each simplex is not computed (set to NaN)

  • ‘alpha’ - The filtration value of each simplex is computed as an AlphaComplex

  • ‘cech’ - The filtration value of each simplex is computed as a DelaunayCechComplex

__init__()#
Parameters:
  • points (Iterable[Iterable[float]]) – A list of points in d-Dimension.

  • weights (Optional[Iterable[float]]) – A list of weights. If set, the number of weights must correspond to the number of points.

  • precision (str) – Complex precision can be ‘fast’, ‘safe’ or ‘exact’. Default is ‘safe’.

Raises:

ValueError – In case of inconsistency between the number of points and weights.

create_simplex_tree(max_alpha_square=inf, filtration=None, output_squared_values=True)#
Parameters:
  • max_alpha_square (float) – The maximum alpha square threshold the simplices shall not exceed. Default is set to infinity, and there is very little point using anything else since it does not save time.

  • filtration (Literal['alpha', 'cech'] | None) – Set this value to None (default value) if filtration values are not needed to be computed (will be set to NaN). Set it to alpha to compute the filtration values with the Alpha complex, or to cech to compute the Delaunay Cech complex.

  • output_squared_values (bool) – Square filtration values when True. Default is True.

Returns:

A simplex tree created from the Delaunay Triangulation. The vertex k corresponds to the k-th

input point. The vertices may not be numbered contiguously as some points may be discarded in the triangulation (duplicate points, weighted hidden point, …).

Return type:

SimplexTree

static get_float_relative_precision()#
Return type:

float

Returns:

The float relative precision of filtration values computation when constructing with precision = 'safe' (the default).

static set_float_relative_precision(precision)#
Parameters:

precision (float) – When constructing delaunay_cech_complex(), alpha_complex(), or weighted_alpha_complex() with precision = 'safe' (the default), one can set the float relative precision of filtration values computed. Default is 1e-5 (cf. get_float_relative_precision()). For more details, please refer to CGAL::Lazy_exact_nt<NT>::set_relative_precision_of_to_double

Raises:

ValueError – If precision is not in (0, 1).

Alpha complex reference manual#

class gudhi.AlphaComplex#

Bases: DelaunayComplex

AlphaComplex is a simplicial complex constructed from the finite cells of a Delaunay Triangulation.

The filtration value of each simplex is computed as the squared radius of the smallest empty sphere passing through all of its vertices.

All simplices that have a filtration value strictly greater than a given alpha squared value are not inserted into the complex.

For more details about the algorithm, please refer to the Alpha complex C++ documentation

Note

When Alpha Complex is constructed with an infinite value of alpha, the complex is a Delaunay complex.

create_simplex_tree(max_alpha_square=inf, default_filtration_value=False, output_squared_values=True)#
Parameters:
  • max_alpha_square (float) – The maximum alpha square threshold the simplices shall not exceed. Default is set to infinity, and there is very little point using anything else since it does not save time.

  • default_filtration_value (bool) – Default value is False (which means compute the filtration values). Set this value to True if filtration values are not needed to be computed (will be set to NaN), but please consider constructing a DelaunayComplex instead.

  • output_squared_values (bool) – Square filtration values when True. Default is True to keep backward

  • compatibility.

Returns:

A simplex tree created from the Delaunay Triangulation. The vertex k corresponds to the k-th

input point. The vertices may not be numbered contiguously as some points may be discarded in the triangulation (duplicate points, weighted hidden point, …).

Return type:

SimplexTree

get_point(vertex)#

This function returns the point corresponding to a given vertex from the SimplexTree (the same as the k-th input point, where k=vertex)

Parameters:

vertex (int) – The vertex.

Return type:

list[float]

Returns:

the point.

Raises:

IndexError – In case the point has no associated vertex in the diagram (because of weights or because it is a duplicate).

Delaunay Čech complex reference manual#

class gudhi.DelaunayCechComplex#

Bases: DelaunayComplex

DelaunayCechComplex is a simplicial complex constructed from the finite cells of a Delaunay Triangulation.

The filtration value of each simplex is equal to the squared radius of its minimal enclosing ball (MEB).

All simplices that have a filtration value strictly greater than a given alpha squared value are not inserted into the complex.

Note

When DelaunayCechComplex is constructed with an infinite value of alpha, the complex is a Delaunay complex.

__init__()#
Parameters:
  • points (Iterable[Iterable[float]]) – A list of points in d-Dimension.

  • precision (str) – Complex precision can be ‘fast’, ‘safe’ or ‘exact’. Default is ‘safe’.

create_simplex_tree(max_alpha_square=inf, output_squared_values=True)#
Parameters:
  • max_alpha_square (float) – The maximum alpha square threshold the simplices shall not exceed. Default is set to infinity, and there is very little point using anything else since it does not save time.

  • output_squared_values (bool) – Square filtration values when True. Default is True.

Returns:

A simplex tree created from the Delaunay Čech Triangulation. The vertex k corresponds to the k-th input point. The vertices may not be numbered contiguously as some points may be discarded in the triangulation(duplicate points, …).

Return type:

SimplexTree