summaryrefslogtreecommitdiff
path: root/src/GudhUI
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-01-20 15:33:53 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-01-20 15:33:53 +0000
commit3f451b963739a595d990be5517d386259ddb487f (patch)
tree4e6b8ccbf21c28c103effd9342f75907c89cf42a /src/GudhUI
parentad6a64ad5a4f4121410250021eda0904eb9c718c (diff)
parentcbf1a50068a2c5dea6d732d40dfc66d34460d863 (diff)
Merge last trunk modifications in qt5 branch
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/qt5@1976 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 7f8c5b9443bf0996347fe459fe21c42a2fed0cca
Diffstat (limited to 'src/GudhUI')
-rw-r--r--src/GudhUI/utils/Critical_points.h2
-rw-r--r--src/GudhUI/utils/Is_manifold.h1
-rw-r--r--src/GudhUI/utils/Persistence_compute.h17
-rw-r--r--src/GudhUI/utils/Vertex_collapsor.h1
4 files changed, 10 insertions, 11 deletions
diff --git a/src/GudhUI/utils/Critical_points.h b/src/GudhUI/utils/Critical_points.h
index 3021a5fe..b88293e9 100644
--- a/src/GudhUI/utils/Critical_points.h
+++ b/src/GudhUI/utils/Critical_points.h
@@ -105,8 +105,6 @@ template<typename SkBlComplex> class Critical_points {
if (link.empty())
return 0;
- Edge_contractor<Complex> contractor(link, link.num_vertices() - 1);
-
if (link.num_connected_components() > 1)
// one than more CC -> not contractible
return 0;
diff --git a/src/GudhUI/utils/Is_manifold.h b/src/GudhUI/utils/Is_manifold.h
index 0640ea47..6dd7898e 100644
--- a/src/GudhUI/utils/Is_manifold.h
+++ b/src/GudhUI/utils/Is_manifold.h
@@ -76,7 +76,6 @@ template<typename SkBlComplex> class Is_manifold {
bool is_k_sphere(Vertex_handle v, int k) {
auto link = input_complex_.link(v);
- Edge_contractor<Complex> contractor(link, link.num_vertices() - 1);
return (is_sphere_simplex(link) == k);
}
diff --git a/src/GudhUI/utils/Persistence_compute.h b/src/GudhUI/utils/Persistence_compute.h
index 97165490..2dc03c8e 100644
--- a/src/GudhUI/utils/Persistence_compute.h
+++ b/src/GudhUI/utils/Persistence_compute.h
@@ -29,6 +29,7 @@
#include <gudhi/Simplex_tree.h>
#include <gudhi/distance_functions.h>
#include <gudhi/Persistent_cohomology.h>
+#include <gudhi/Rips_complex.h>
#include <vector>
@@ -69,21 +70,23 @@ template<typename SkBlComplex> class Persistence_compute {
points.emplace_back(std::move(pt_to_add));
}
+ using Simplex_tree = Gudhi::Simplex_tree<>;
+ using Filtration_value = Simplex_tree::Filtration_value;
+ using Rips_complex = Gudhi::rips_complex::Rips_complex<Filtration_value>;
+ using Field_Zp = Gudhi::persistent_cohomology::Field_Zp;
+ using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Field_Zp>;
- Graph_t prox_graph = compute_proximity_graph(points, params.threshold, euclidean_distance<Point_t>);
- Gudhi::Simplex_tree<> st;
- st.insert_graph(prox_graph);
- st.expansion(params.max_dim);
+ Rips_complex rips_complex(points, params.threshold, Euclidean_distance());
- Gudhi::persistent_cohomology::Persistent_cohomology< Gudhi::Simplex_tree<>,
- Gudhi::persistent_cohomology::Field_Zp > pcoh(st);
+ Simplex_tree st;
+ rips_complex.create_complex(st, params.max_dim);
+ Persistent_cohomology pcoh(st);
// initializes the coefficient field for homology
pcoh.init_coefficients(params.p);
// put params.min_pers
pcoh.compute_persistent_cohomology(params.min_pers);
stream << "persistence: \n";
stream << "p dimension birth death: \n";
-
pcoh.output_diagram(stream);
}
};
diff --git a/src/GudhUI/utils/Vertex_collapsor.h b/src/GudhUI/utils/Vertex_collapsor.h
index 2b36cb3a..3f0e7ffd 100644
--- a/src/GudhUI/utils/Vertex_collapsor.h
+++ b/src/GudhUI/utils/Vertex_collapsor.h
@@ -80,7 +80,6 @@ template<typename SkBlComplex> class Vertex_collapsor {
if (link.empty()) return false;
if (link.is_cone()) return true;
if (link.num_connected_components() > 1) return false;
- Edge_contractor<Complex> contractor(link, link.num_vertices() - 1);
return (link.num_vertices() == 1);
}
};