summaryrefslogtreecommitdiff
path: root/src/cython/cython
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-03-21 20:54:28 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-03-21 20:54:28 +0000
commitf0d8d8507bff9667289ac29539fe8714119f816a (patch)
tree02b119759bfe383d99e9694e84117b3ef2041218 /src/cython/cython
parent54ed7a649fd461880693f5e9985dc529ae72a39f (diff)
expansion method and its associated test
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@2215 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 32ad429f301b35c064eadef36dbe4e7f64f6490e
Diffstat (limited to 'src/cython/cython')
-rw-r--r--src/cython/cython/simplex_tree.pyx20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/cython/cython/simplex_tree.pyx b/src/cython/cython/simplex_tree.pyx
index bb6fd1db..489c711f 100644
--- a/src/cython/cython/simplex_tree.pyx
+++ b/src/cython/cython/simplex_tree.pyx
@@ -52,6 +52,7 @@ cdef extern from "Simplex_tree_interface.h" namespace "Gudhi":
vector[pair[vector[int], double]] get_cofaces(vector[int] simplex,
int dimension)
void remove_maximal_simplex(vector[int] simplex)
+ void expansion(int max_dim)
cdef extern from "Persistent_cohomology_interface.h" namespace "Gudhi":
cdef cppclass Simplex_tree_persistence_interface "Gudhi::Persistent_cohomology_interface<Gudhi::Simplex_tree<Gudhi::Simplex_tree_options_full_featured>>":
@@ -304,6 +305,25 @@ cdef class SimplexTree:
"""
self.thisptr.remove_maximal_simplex(simplex)
+ def expansion(self, max_dim):
+ """Expands the Simplex_tree containing only its one skeleton
+ until dimension max_dim.
+
+ The expanded simplicial complex until dimension :math:`d`
+ attached to a graph :math:`G` is the maximal simplicial complex of
+ dimension at most :math:`d` admitting the graph :math:`G` as
+ :math:`1`-skeleton.
+ The filtration value assigned to a simplex is the maximal filtration
+ value of one of its edges.
+
+ The Simplex_tree must contain no simplex of dimension bigger than
+ 1 when calling the method.
+
+ :param max_dim: The maximal dimension.
+ :type max_dim: int.
+ """
+ self.thisptr.expansion(max_dim)
+
def persistence(self, homology_coeff_field=11, min_persistence=0, persistence_dim_max = False):
"""This function returns the persistence of the simplicial complex.