diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2020-05-04 20:13:05 +0200 |
---|---|---|
committer | Marc Glisse <marc.glisse@inria.fr> | 2020-05-04 20:13:05 +0200 |
commit | 5ad8f41550d94988214fbf128a179d918635c3cf (patch) | |
tree | 5d3acb989e3f7ec27e53e66ca5ab4fb95cbc1430 /src/python/gudhi/rips_complex.pyx | |
parent | 07a017ca26238847e9d9ab75dcb17e52c81e6865 (diff) |
Add some nogil for cython
Diffstat (limited to 'src/python/gudhi/rips_complex.pyx')
-rw-r--r-- | src/python/gudhi/rips_complex.pyx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/python/gudhi/rips_complex.pyx b/src/python/gudhi/rips_complex.pyx index deb8057a..72e82c79 100644 --- a/src/python/gudhi/rips_complex.pyx +++ b/src/python/gudhi/rips_complex.pyx @@ -23,12 +23,12 @@ __license__ = "MIT" cdef extern from "Rips_complex_interface.h" namespace "Gudhi": cdef cppclass Rips_complex_interface "Gudhi::rips_complex::Rips_complex_interface": - Rips_complex_interface() - void init_points(vector[vector[double]] values, double threshold) - void init_matrix(vector[vector[double]] values, double threshold) - void init_points_sparse(vector[vector[double]] values, double threshold, double sparse) - void init_matrix_sparse(vector[vector[double]] values, double threshold, double sparse) - void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, int dim_max) except + + Rips_complex_interface() nogil + void init_points(vector[vector[double]] values, double threshold) nogil + void init_matrix(vector[vector[double]] values, double threshold) nogil + void init_points_sparse(vector[vector[double]] values, double threshold, double sparse) nogil + void init_matrix_sparse(vector[vector[double]] values, double threshold, double sparse) nogil + void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, int dim_max) nogil except + # RipsComplex python interface cdef class RipsComplex: @@ -97,6 +97,7 @@ cdef class RipsComplex: """ stree = SimplexTree() cdef intptr_t stree_int_ptr=stree.thisptr - self.thisref.create_simplex_tree(<Simplex_tree_interface_full_featured*>stree_int_ptr, - max_dimension) + cdef int maxdim = max_dimension + with nogil: + self.thisref.create_simplex_tree(<Simplex_tree_interface_full_featured*>stree_int_ptr, maxdim) return stree |