summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-07-10 18:58:12 +0000
committerglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-07-10 18:58:12 +0000
commitb8fdc4c7f6c30df5e7a28a0a23e697640f9d67cc (patch)
tree43dad33a512df7e128b2a113d4fbb9361cd20410 /src
parent2c353d0c3db1c5c8fc11cb28ea65c90c559766a1 (diff)
simplex / complex confusion
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@2596 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 77c093029d3e2518260ce59705110df3fbfe11e3
Diffstat (limited to 'src')
-rw-r--r--src/cython/cython/simplex_tree.pyx48
-rw-r--r--src/cython/include/Simplex_tree_interface.h8
2 files changed, 28 insertions, 28 deletions
diff --git a/src/cython/cython/simplex_tree.pyx b/src/cython/cython/simplex_tree.pyx
index 9d40a8b5..2acdac3c 100644
--- a/src/cython/cython/simplex_tree.pyx
+++ b/src/cython/cython/simplex_tree.pyx
@@ -183,10 +183,10 @@ cdef class SimplexTree:
:returns: true if the simplex was found, false otherwise.
:rtype: bool
"""
- cdef vector[int] complex
+ cdef vector[int] csimplex
for i in simplex:
- complex.push_back(i)
- return self.thisptr.find_simplex(complex)
+ csimplex.push_back(i)
+ return self.thisptr.find_simplex(csimplex)
def insert(self, simplex, filtration=0.0):
"""This function inserts the given N-simplex and its subfaces with the
@@ -200,10 +200,10 @@ cdef class SimplexTree:
:returns: true if the simplex was found, false otherwise.
:rtype: bool
"""
- cdef vector[int] complex
+ cdef vector[int] csimplex
for i in simplex:
- complex.push_back(i)
- return self.thisptr.insert_simplex_and_subfaces(complex,
+ csimplex.push_back(i)
+ return self.thisptr.insert_simplex_and_subfaces(csimplex,
<double>filtration)
def get_filtration(self):
@@ -232,35 +232,35 @@ cdef class SimplexTree:
:returns: The (simplices of the) skeleton of a maximum dimension.
:rtype: list of tuples(simplex, filtration)
"""
- cdef vector[pair[vector[int], double]] skeletons \
+ cdef vector[pair[vector[int], double]] skeleton \
= self.thisptr.get_skeleton(<int>dimension)
ct = []
- for filtered_complex in skeletons:
+ for filtered_simplex in skeleton:
v = []
- for vertex in filtered_complex.first:
+ for vertex in filtered_simplex.first:
v.append(vertex)
- ct.append((v, filtered_complex.second))
+ ct.append((v, filtered_simplex.second))
return ct
def get_star(self, simplex):
- """This function returns the stars of a given N-simplex.
+ """This function returns the star of a given N-simplex.
:param simplex: The N-simplex, represented by a list of vertex.
:type simplex: list of int.
:returns: The (simplices of the) star of a simplex.
:rtype: list of tuples(simplex, filtration)
"""
- cdef vector[int] complex
+ cdef vector[int] csimplex
for i in simplex:
- complex.push_back(i)
- cdef vector[pair[vector[int], double]] stars \
- = self.thisptr.get_star(complex)
+ csimplex.push_back(i)
+ cdef vector[pair[vector[int], double]] star \
+ = self.thisptr.get_star(csimplex)
ct = []
- for filtered_complex in stars:
+ for filtered_simplex in star:
v = []
- for vertex in filtered_complex.first:
+ for vertex in filtered_simplex.first:
v.append(vertex)
- ct.append((v, filtered_complex.second))
+ ct.append((v, filtered_simplex.second))
return ct
def get_cofaces(self, simplex, codimension):
@@ -275,17 +275,17 @@ cdef class SimplexTree:
:returns: The (simplices of the) cofaces of a simplex
:rtype: list of tuples(simplex, filtration)
"""
- cdef vector[int] complex
+ cdef vector[int] csimplex
for i in simplex:
- complex.push_back(i)
+ csimplex.push_back(i)
cdef vector[pair[vector[int], double]] cofaces \
- = self.thisptr.get_cofaces(complex, <int>codimension)
+ = self.thisptr.get_cofaces(csimplex, <int>codimension)
ct = []
- for filtered_complex in cofaces:
+ for filtered_simplex in cofaces:
v = []
- for vertex in filtered_complex.first:
+ for vertex in filtered_simplex.first:
v.append(vertex)
- ct.append((v, filtered_complex.second))
+ ct.append((v, filtered_simplex.second))
return ct
def remove_maximal_simplex(self, simplex):
diff --git a/src/cython/include/Simplex_tree_interface.h b/src/cython/include/Simplex_tree_interface.h
index 45ce1916..09e7e992 100644
--- a/src/cython/include/Simplex_tree_interface.h
+++ b/src/cython/include/Simplex_tree_interface.h
@@ -70,14 +70,14 @@ class Simplex_tree_interface : public Simplex_tree<SimplexTreeOptions> {
}
// Do not interface this function, only used in strong witness interface for complex creation
- bool insert_simplex(const std::vector<std::size_t>& complex, Filtration_value filtration = 0) {
- Insertion_result result = Base::insert_simplex(complex, filtration);
+ bool insert_simplex(const std::vector<std::size_t>& simplex, Filtration_value filtration = 0) {
+ Insertion_result result = Base::insert_simplex(simplex, filtration);
return (result.second);
}
// Do not interface this function, only used in strong witness interface for complex creation
- bool insert_simplex_and_subfaces(const std::vector<std::size_t>& complex, Filtration_value filtration = 0) {
- Insertion_result result = Base::insert_simplex_and_subfaces(complex, filtration);
+ bool insert_simplex_and_subfaces(const std::vector<std::size_t>& simplex, Filtration_value filtration = 0) {
+ Insertion_result result = Base::insert_simplex_and_subfaces(simplex, filtration);
return (result.second);
}