summaryrefslogtreecommitdiff
path: root/src/cython/include
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-08-18 15:33:26 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-08-18 15:33:26 +0000
commit355dc2a0ae73f243fc0aa8d7c797509d8ba5e6b4 (patch)
tree14a55c916804af2ba5254374590d2a1ec8904005 /src/cython/include
parent777ed59f7d723139114b072682729eaed8596881 (diff)
Move pandas files points into data/pandas
Fix example and tests New persistence constructor for cubical to increase max_persistence_dim (and only for cubical, periodic or not) git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@1442 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 243a843a65a82b9d3d8d564aa906c0a17eda176a
Diffstat (limited to 'src/cython/include')
-rw-r--r--src/cython/include/Persistent_cohomology_interface.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/cython/include/Persistent_cohomology_interface.h b/src/cython/include/Persistent_cohomology_interface.h
index faabc497..1ff0e09b 100644
--- a/src/cython/include/Persistent_cohomology_interface.h
+++ b/src/cython/include/Persistent_cohomology_interface.h
@@ -34,6 +34,7 @@ template<class FilteredComplex>
class Persistent_cohomology_interface : public
persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomology::Field_Zp> {
private:
+
/*
* Compare two intervals by dimension, then by length.
*/
@@ -56,18 +57,23 @@ persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomol
public:
Persistent_cohomology_interface(FilteredComplex* stptr)
- : persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomology::Field_Zp>(*stptr, true),
+ : persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomology::Field_Zp>(*stptr),
+ stptr_(stptr) { }
+
+ Persistent_cohomology_interface(FilteredComplex* stptr, bool persistence_dim_max)
+ : persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomology::Field_Zp>(*stptr,
+ persistence_dim_max),
stptr_(stptr) { }
std::vector<std::pair<int, std::pair<double, double>>> get_persistence(int homology_coeff_field, double min_persistence) {
persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomology::Field_Zp>::init_coefficients(homology_coeff_field);
persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomology::Field_Zp>::compute_persistent_cohomology(min_persistence);
-
+
// Custom sort and output persistence
cmp_intervals_by_dim_then_length cmp(stptr_);
auto persistent_pairs = persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomology::Field_Zp>::get_persistent_pairs();
std::sort(std::begin(persistent_pairs), std::end(persistent_pairs), cmp);
-
+
std::vector<std::pair<int, std::pair<double, double>>> persistence;
for (auto pair : persistent_pairs) {
persistence.push_back(std::make_pair(stptr_->dimension(get<0>(pair)),
@@ -77,7 +83,7 @@ persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomol
return persistence;
}
-
+
private:
// A copy
FilteredComplex* stptr_;