diff options
author | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2020-05-25 08:55:34 +0200 |
---|---|---|
committer | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2020-05-25 08:55:34 +0200 |
commit | 8f8f1b6f6197bac633ae059776e7b265e3ef5fb6 (patch) | |
tree | 39960653868c54b5ab5206ec13caf00fc33a565c /src/python/gudhi/alpha_complex.pyx | |
parent | 0d5556975f7977f6fd41cde4841b1ccd23a66f6b (diff) | |
parent | 80dc3b26a91280f9da8b9630d983499846d42ea6 (diff) |
Merge last master version
Diffstat (limited to 'src/python/gudhi/alpha_complex.pyx')
-rw-r--r-- | src/python/gudhi/alpha_complex.pyx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/python/gudhi/alpha_complex.pyx b/src/python/gudhi/alpha_complex.pyx index e04dc652..d75e374a 100644 --- a/src/python/gudhi/alpha_complex.pyx +++ b/src/python/gudhi/alpha_complex.pyx @@ -27,11 +27,11 @@ __license__ = "GPL v3" cdef extern from "Alpha_complex_interface.h" namespace "Gudhi": cdef cppclass Alpha_complex_interface "Gudhi::alpha_complex::Alpha_complex_interface": - Alpha_complex_interface(vector[vector[double]] points) except + + Alpha_complex_interface(vector[vector[double]] points) nogil except + # bool from_file is a workaround for cython to find the correct signature - Alpha_complex_interface(string off_file, bool from_file) except + - vector[double] get_point(int vertex) except + - void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square) except + + Alpha_complex_interface(string off_file, bool from_file) nogil except + + vector[double] get_point(int vertex) nogil except + + void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square) nogil except + # AlphaComplex python interface cdef class AlphaComplex: @@ -70,6 +70,7 @@ cdef class AlphaComplex: # The real cython constructor def __cinit__(self, points = None, off_file = ''): + cdef vector[vector[double]] pts if off_file: if os.path.isfile(off_file): self.thisptr = new Alpha_complex_interface( @@ -80,7 +81,9 @@ cdef class AlphaComplex: if points is None: # Empty Alpha construction points=[] - self.thisptr = new Alpha_complex_interface(points) + pts = points + with nogil: + self.thisptr = new Alpha_complex_interface(pts) def __dealloc__(self): @@ -113,6 +116,8 @@ cdef class AlphaComplex: :rtype: SimplexTree """ stree = SimplexTree() + cdef double mas = max_alpha_square cdef intptr_t stree_int_ptr=stree.thisptr - self.thisptr.create_simplex_tree(<Simplex_tree_interface_full_featured*>stree_int_ptr, max_alpha_square) + with nogil: + self.thisptr.create_simplex_tree(<Simplex_tree_interface_full_featured*>stree_int_ptr, mas) return stree |