summaryrefslogtreecommitdiff
path: root/src/cython/gudhi
diff options
context:
space:
mode:
Diffstat (limited to 'src/cython/gudhi')
-rw-r--r--src/cython/gudhi/euclidean_strong_witness_complex.pyx14
-rw-r--r--src/cython/gudhi/euclidean_witness_complex.pyx14
-rw-r--r--src/cython/gudhi/nerve_gic.pyx12
-rw-r--r--src/cython/gudhi/tangential_complex.pyx3
4 files changed, 29 insertions, 14 deletions
diff --git a/src/cython/gudhi/euclidean_strong_witness_complex.pyx b/src/cython/gudhi/euclidean_strong_witness_complex.pyx
index 26bd8375..465635c4 100644
--- a/src/cython/gudhi/euclidean_strong_witness_complex.pyx
+++ b/src/cython/gudhi/euclidean_strong_witness_complex.pyx
@@ -1,6 +1,10 @@
from cython cimport numeric
from libcpp.vector cimport vector
from libcpp.utility cimport pair
+from libc.stdint cimport intptr_t
+
+from gudhi.simplex_tree cimport *
+from gudhi.simplex_tree import SimplexTree
""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
@@ -65,12 +69,14 @@ cdef class EuclideanStrongWitnessComplex:
:returns: A simplex tree created from the Delaunay Triangulation.
:rtype: SimplexTree
"""
- simplex_tree = SimplexTree()
+ stree = SimplexTree()
+ cdef intptr_t stree_int_ptr=stree.thisptr
+ cdef Simplex_tree_interface_full_featured* stree_ptr = <Simplex_tree_interface_full_featured*>stree_int_ptr
if limit_dimension is not -1:
- self.thisptr.create_simplex_tree(simplex_tree.thisptr, max_alpha_square, limit_dimension)
+ self.thisptr.create_simplex_tree(stree_ptr, max_alpha_square, limit_dimension)
else:
- self.thisptr.create_simplex_tree(simplex_tree.thisptr, max_alpha_square)
- return simplex_tree
+ self.thisptr.create_simplex_tree(stree_ptr, max_alpha_square)
+ return stree
def get_point(self, vertex):
"""This function returns the point corresponding to a given vertex.
diff --git a/src/cython/gudhi/euclidean_witness_complex.pyx b/src/cython/gudhi/euclidean_witness_complex.pyx
index e687c6f3..92d54eb5 100644
--- a/src/cython/gudhi/euclidean_witness_complex.pyx
+++ b/src/cython/gudhi/euclidean_witness_complex.pyx
@@ -1,6 +1,10 @@
from cython cimport numeric
from libcpp.vector cimport vector
from libcpp.utility cimport pair
+from libc.stdint cimport intptr_t
+
+from gudhi.simplex_tree cimport *
+from gudhi.simplex_tree import SimplexTree
""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
@@ -65,12 +69,14 @@ cdef class EuclideanWitnessComplex:
:returns: A simplex tree created from the Delaunay Triangulation.
:rtype: SimplexTree
"""
- simplex_tree = SimplexTree()
+ stree = SimplexTree()
+ cdef intptr_t stree_int_ptr=stree.thisptr
+ cdef Simplex_tree_interface_full_featured* stree_ptr = <Simplex_tree_interface_full_featured*>stree_int_ptr
if limit_dimension is not -1:
- self.thisptr.create_simplex_tree(simplex_tree.thisptr, max_alpha_square, limit_dimension)
+ self.thisptr.create_simplex_tree(stree_ptr, max_alpha_square, limit_dimension)
else:
- self.thisptr.create_simplex_tree(simplex_tree.thisptr, max_alpha_square)
- return simplex_tree
+ self.thisptr.create_simplex_tree(stree_ptr, max_alpha_square)
+ return stree
def get_point(self, vertex):
"""This function returns the point corresponding to a given vertex.
diff --git a/src/cython/gudhi/nerve_gic.pyx b/src/cython/gudhi/nerve_gic.pyx
index 3c8f1200..9fec626f 100644
--- a/src/cython/gudhi/nerve_gic.pyx
+++ b/src/cython/gudhi/nerve_gic.pyx
@@ -4,6 +4,10 @@ from libcpp.utility cimport pair
from libcpp.string cimport string
from libcpp cimport bool
import os
+from libc.stdint cimport intptr_t
+
+from gudhi.simplex_tree cimport *
+from gudhi.simplex_tree import SimplexTree
""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
@@ -158,9 +162,11 @@ cdef class CoverComplex:
:returns: A simplex tree created from the Cover complex.
:rtype: SimplexTree
"""
- simplex_tree = SimplexTree()
- self.thisptr.create_simplex_tree(simplex_tree.thisptr)
- return simplex_tree
+ stree = SimplexTree()
+ cdef intptr_t stree_int_ptr=stree.thisptr
+ cdef Simplex_tree_interface_full_featured* stree_ptr = <Simplex_tree_interface_full_featured*>stree_int_ptr
+ self.thisptr.create_simplex_tree(stree_ptr)
+ return stree
def find_simplices(self):
"""Computes the simplices of the simplicial complex.
diff --git a/src/cython/gudhi/tangential_complex.pyx b/src/cython/gudhi/tangential_complex.pyx
index b2d55520..9eb22115 100644
--- a/src/cython/gudhi/tangential_complex.pyx
+++ b/src/cython/gudhi/tangential_complex.pyx
@@ -147,9 +147,6 @@ cdef class TangentialComplex:
cdef Simplex_tree_interface_full_featured* stree_ptr = <Simplex_tree_interface_full_featured*>stree_int_ptr
self.thisptr.create_simplex_tree(stree_ptr)
return stree
- simplex_tree = SimplexTree()
- self.thisptr.create_simplex_tree(simplex_tree.thisptr)
- return simplex_tree
def fix_inconsistencies_using_perturbation(self, max_perturb, time_limit=-1.0):
"""Attempts to fix inconsistencies by perturbing the point positions.