summaryrefslogtreecommitdiff
path: root/src/python/gudhi/simplex_tree.pyx
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2022-10-16 18:17:36 +0200
committerMarc Glisse <marc.glisse@inria.fr>2022-10-16 18:17:36 +0200
commitb99c9621fb7e1433eb67cc973825e2ee49936571 (patch)
tree9db6f6f86d3ae549a4f8d7ba5f604d33381a43b3 /src/python/gudhi/simplex_tree.pyx
parent7b7d71e3a8d1302dc81eb020114fe4c4d767ccb0 (diff)
parent524718d63a8f633dbcc4fe7db3fe920ebd7e972c (diff)
Merge branch 'master' into insert
Diffstat (limited to 'src/python/gudhi/simplex_tree.pyx')
-rw-r--r--src/python/gudhi/simplex_tree.pyx24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/python/gudhi/simplex_tree.pyx b/src/python/gudhi/simplex_tree.pyx
index 1ac03afa..6b1b5c00 100644
--- a/src/python/gudhi/simplex_tree.pyx
+++ b/src/python/gudhi/simplex_tree.pyx
@@ -558,8 +558,7 @@ cdef class SimplexTree:
del self.pcohptr
self.pcohptr = new Simplex_tree_persistence_interface(self.get_ptr(), False)
self.pcohptr.compute_persistence(homology_coeff_field, -1.)
- persistence_result = self.pcohptr.get_persistence()
- return self.get_ptr().compute_extended_persistence_subdiagrams(persistence_result, min_persistence)
+ return self.pcohptr.compute_extended_persistence_subdiagrams(min_persistence)
def expansion_with_blocker(self, max_dim, blocker_func):
"""Expands the Simplex_tree containing only a graph. Simplices corresponding to cliques in the graph are added
@@ -572,9 +571,9 @@ cdef class SimplexTree:
otherwise it is kept. The algorithm then proceeds with the next candidate.
.. warning::
- Several candidates of the same dimension may be inserted simultaneously before calling `block_simplex`, so
- if you examine the complex in `block_simplex`, you may hit a few simplices of the same dimension that have
- not been vetted by `block_simplex` yet, or have already been rejected but not yet removed.
+ Several candidates of the same dimension may be inserted simultaneously before calling `blocker_func`, so
+ if you examine the complex in `blocker_func`, you may hit a few simplices of the same dimension that have
+ not been vetted by `blocker_func` yet, or have already been rejected but not yet removed.
:param max_dim: Expansion maximal dimension value.
:type max_dim: int
@@ -760,18 +759,17 @@ cdef class SimplexTree:
return (normal0, normals, infinite0, infinites)
def collapse_edges(self, nb_iterations = 1):
- """Assuming the simplex tree is a 1-skeleton graph, this method collapse edges (simplices of higher dimension
- are ignored) and resets the simplex tree from the remaining edges.
- A good candidate is to build a simplex tree on top of a :class:`~gudhi.RipsComplex` of dimension 1 before
- collapsing edges
+ """Assuming the complex is a graph (simplices of higher dimension are ignored), this method implicitly
+ interprets it as the 1-skeleton of a flag complex, and replaces it with another (smaller) graph whose
+ expansion has the same persistent homology, using a technique known as edge collapses
+ (see :cite:`edgecollapsearxiv`).
+
+ A natural application is to get a simplex tree of dimension 1 from :class:`~gudhi.RipsComplex`,
+ then collapse edges, perform :meth:`expansion()` and finally compute persistence
(cf. :download:`rips_complex_edge_collapse_example.py <../example/rips_complex_edge_collapse_example.py>`).
- For implementation details, please refer to :cite:`edgecollapsesocg2020`.
:param nb_iterations: The number of edge collapse iterations to perform. Default is 1.
:type nb_iterations: int
-
- :note: collapse_edges method requires `Eigen <installation.html#eigen>`_ >= 3.1.0 and an exception is thrown
- if this method is not available.
"""
# Backup old pointer
cdef Simplex_tree_interface_full_featured* ptr = self.get_ptr()