summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
authormathieu <mathieu.carriere3@gmail.com>2020-03-11 12:05:15 -0400
committermathieu <mathieu.carriere3@gmail.com>2020-03-11 12:05:15 -0400
commit45b918a17cfa26a0c58d7871b869aa13b0e45019 (patch)
tree9d8021f51dbc96f1c1cd8bba9a31af3b72d3f052 /src/python
parent3842ab4cb969db75beb984164a6737ee15be0272 (diff)
moved location of top_dimensional_coface function
Diffstat (limited to 'src/python')
-rw-r--r--src/python/gudhi/cubical_complex.pyx4
-rw-r--r--src/python/gudhi/periodic_cubical_complex.pyx4
-rw-r--r--src/python/include/Persistent_cohomology_interface.h16
3 files changed, 8 insertions, 16 deletions
diff --git a/src/python/gudhi/cubical_complex.pyx b/src/python/gudhi/cubical_complex.pyx
index 9e701fe6..84fec60e 100644
--- a/src/python/gudhi/cubical_complex.pyx
+++ b/src/python/gudhi/cubical_complex.pyx
@@ -163,7 +163,9 @@ cdef class CubicalComplex:
when calling the function on one of their common faces.
:returns: The top-dimensional cells/cofaces of the positive and negative cells, together with the corresponding homological dimension.
- :rtype: numpy array of integers of shape [number_of_persistence_points, 3], the integers of eah row being: (homological dimension, index of positive top-dimensional cell, index of negative top-dimensional cell). If the homological feature is essential, i.e., if the death time is +infinity, then the index of the corresponding negative top-dimensional cell is -1.
+ :rtype: numpy array of integers of shape [number_of_persistence_points, 3], the integers of eah row being: (homological dimension,
+ index of positive top-dimensional cell, index of negative top-dimensional cell). If the homological feature is essential, i.e., if
+ the death time is +infinity, then the index of the corresponding negative top-dimensional cell is -1.
"""
cdef vector[vector[int]] persistence_result
if self.pcohptr != NULL:
diff --git a/src/python/gudhi/periodic_cubical_complex.pyx b/src/python/gudhi/periodic_cubical_complex.pyx
index ba039e80..993d95c7 100644
--- a/src/python/gudhi/periodic_cubical_complex.pyx
+++ b/src/python/gudhi/periodic_cubical_complex.pyx
@@ -173,7 +173,9 @@ cdef class PeriodicCubicalComplex:
when calling the function on one of their common faces.
:returns: The top-dimensional cells/cofaces of the positive and negative cells, together with the corresponding homological dimension.
- :rtype: numpy array of integers of shape [number_of_persistence_points, 3], the integers of eah row being: (homological dimension, index of positive top-dimensional cell, index of negative top-dimensional cell). If the homological feature is essential, i.e., if the death time is +infinity, then the index of the corresponding negative top-dimensional cell is -1.
+ :rtype: numpy array of integers of shape [number_of_persistence_points, 3], the integers of eah row being: (homological dimension,
+ index of positive top-dimensional cell, index of negative top-dimensional cell). If the homological feature is essential, i.e., if
+ the death time is +infinity, then the index of the corresponding negative top-dimensional cell is -1.
"""
cdef vector[vector[int]] persistence_result
if self.pcohptr != NULL:
diff --git a/src/python/include/Persistent_cohomology_interface.h b/src/python/include/Persistent_cohomology_interface.h
index defac88c..77555349 100644
--- a/src/python/include/Persistent_cohomology_interface.h
+++ b/src/python/include/Persistent_cohomology_interface.h
@@ -72,18 +72,6 @@ persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomol
return persistence;
}
- int top_dimensional_coface(int splx){
- if (stptr_->dimension(splx) == stptr_->dimension()){return splx;}
- else{
- for (auto v : stptr_->get_coboundary_of_a_cell(splx)){
- if(stptr_->filtration(v) == stptr_->filtration(splx)){
- return top_dimensional_coface(v);
- }
- }
- }
- return splx;
- }
-
std::vector<std::vector<int>> cofaces_of_cubical_persistence_pairs() {
// Warning: this function is meant to be used with CubicalComplex only!!
@@ -104,14 +92,14 @@ persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomol
for (auto pair : pairs) {
int h = stptr_->dimension(get<0>(pair));
// Recursively get the top-dimensional cell / coface associated to the persistence generator
- int face0 = top_dimensional_coface(get<0>(pair));
+ int face0 = stptr_->get_top_dimensional_coface_of_a_cell(get<0>(pair));
// Retrieve the index of the corresponding top-dimensional cell in the input data
int splx0 = order[face0];
int splx1 = -1;
if (isfinite(stptr_->filtration(get<1>(pair)))){
// Recursively get the top-dimensional cell / coface associated to the persistence generator
- int face1 = top_dimensional_coface(get<1>(pair));
+ int face1 = stptr_->get_top_dimensional_coface_of_a_cell(get<1>(pair));
// Retrieve the index of the corresponding top-dimensional cell in the input data
splx1 = order[face1];
}