diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2020-05-11 23:40:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-11 23:40:20 +0200 |
commit | 1efd71c502bacce375e1950e10a8112208acd0cf (patch) | |
tree | 22becdf1fb6059ca93fd82651e7bf173b8d2debb /src/python/gudhi/rips_complex.pyx | |
parent | fa969d52cfbb7474a717c548c8c3275710fe8247 (diff) | |
parent | 894462a364dd5d4bf4a5250c0c3c075c561fb174 (diff) |
Merge pull request #304 from mglisse/nogil1
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 |