diff options
author | Gard Spreemann <gspreemann@gmail.com> | 2017-04-20 11:10:45 +0200 |
---|---|---|
committer | Gard Spreemann <gspreemann@gmail.com> | 2017-04-20 11:10:45 +0200 |
commit | 8d7329f3e5ad843e553c3c5503cecc28ef2eead6 (patch) | |
tree | 6d80d83a7c4bcd3296e12a28404bfe84ef84ed55 /GudhUI/utils | |
parent | 55c7181126aa7defce38c9b82872d14223d4c1dd (diff) |
GUDHI 2.0.0 as released by upstream in a tarball.upstream/2.0.0
Diffstat (limited to 'GudhUI/utils')
-rw-r--r-- | GudhUI/utils/Critical_points.h | 1 | ||||
-rw-r--r-- | GudhUI/utils/Edge_contractor.h | 2 | ||||
-rw-r--r-- | GudhUI/utils/Furthest_point_epsilon_net.h | 2 | ||||
-rw-r--r-- | GudhUI/utils/Is_manifold.h | 1 | ||||
-rw-r--r-- | GudhUI/utils/Persistence_compute.h | 17 | ||||
-rw-r--r-- | GudhUI/utils/Vertex_collapsor.h | 1 |
6 files changed, 15 insertions, 9 deletions
diff --git a/GudhUI/utils/Critical_points.h b/GudhUI/utils/Critical_points.h index 3021a5fe..2a18e079 100644 --- a/GudhUI/utils/Critical_points.h +++ b/GudhUI/utils/Critical_points.h @@ -106,6 +106,7 @@ template<typename SkBlComplex> class Critical_points { return 0; Edge_contractor<Complex> contractor(link, link.num_vertices() - 1); + (void)contractor; if (link.num_connected_components() > 1) // one than more CC -> not contractible diff --git a/GudhUI/utils/Edge_contractor.h b/GudhUI/utils/Edge_contractor.h index 45079a40..8a29ff4b 100644 --- a/GudhUI/utils/Edge_contractor.h +++ b/GudhUI/utils/Edge_contractor.h @@ -65,7 +65,7 @@ template<typename SkBlComplex> class Edge_contractor { Placement_type operator()(const EdgeProfile& profile) const override { std::vector<double> mid_coords(profile.p0().dimension(), 0); - for (size_t i = 0; i < profile.p0().dimension(); ++i) { + for (int i = 0; i < profile.p0().dimension(); ++i) { mid_coords[i] = (profile.p0()[i] + profile.p1()[i]) / 2.; } return Point(profile.p0().dimension(), mid_coords.begin(), mid_coords.end()); diff --git a/GudhUI/utils/Furthest_point_epsilon_net.h b/GudhUI/utils/Furthest_point_epsilon_net.h index f2a216f6..98346daa 100644 --- a/GudhUI/utils/Furthest_point_epsilon_net.h +++ b/GudhUI/utils/Furthest_point_epsilon_net.h @@ -73,7 +73,7 @@ template<typename SkBlComplex> class Furthest_point_epsilon_net { complex_(complex) { if (!complex.empty()) { init_filtration(); - for (int k = 2; k < net_filtration_.size(); ++k) { + for (std::size_t k = 2; k < net_filtration_.size(); ++k) { update_radius_value(k); } } diff --git a/GudhUI/utils/Is_manifold.h b/GudhUI/utils/Is_manifold.h index 0640ea47..d0974463 100644 --- a/GudhUI/utils/Is_manifold.h +++ b/GudhUI/utils/Is_manifold.h @@ -77,6 +77,7 @@ 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); + (void)contractor; return (is_sphere_simplex(link) == k); } diff --git a/GudhUI/utils/Persistence_compute.h b/GudhUI/utils/Persistence_compute.h index 97165490..2dc03c8e 100644 --- a/GudhUI/utils/Persistence_compute.h +++ b/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/GudhUI/utils/Vertex_collapsor.h b/GudhUI/utils/Vertex_collapsor.h index 2b36cb3a..568dab2f 100644 --- a/GudhUI/utils/Vertex_collapsor.h +++ b/GudhUI/utils/Vertex_collapsor.h @@ -81,6 +81,7 @@ template<typename SkBlComplex> class Vertex_collapsor { if (link.is_cone()) return true; if (link.num_connected_components() > 1) return false; Edge_contractor<Complex> contractor(link, link.num_vertices() - 1); + (void)contractor; return (link.num_vertices() == 1); } }; |