From cafbe7d63d0e16e27721864a1ffa1a67d8f0374f Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Thu, 25 Jan 2018 14:06:24 +0000 Subject: Code review : fix camel case for types and use of std::log instead of log Add CGAL dependency for Nerve_GIC (link to bottleneck) Add persistence representation in bibtex git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@3155 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 8a45497b3d1f34a5c4a1c7856113c6b7680a12a2 --- src/Nerve_GIC/include/gudhi/GIC.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/Nerve_GIC/include') diff --git a/src/Nerve_GIC/include/gudhi/GIC.h b/src/Nerve_GIC/include/gudhi/GIC.h index 2fd61f14..27030723 100644 --- a/src/Nerve_GIC/include/gudhi/GIC.h +++ b/src/Nerve_GIC/include/gudhi/GIC.h @@ -58,13 +58,13 @@ namespace cover_complex { using Simplex_tree = Gudhi::Simplex_tree<>; using Filtration_value = Simplex_tree::Filtration_value; using Rips_complex = Gudhi::rips_complex::Rips_complex; -using PersistenceDiagram = std::vector >; +using Persistence_diagram = std::vector >; using Graph = boost::subgraph< boost::adjacency_list > > >; -using vertex_t = boost::graph_traits::vertex_descriptor; -using IndexMap = boost::property_map::type; -using WeightMap = boost::property_map::type; +using Vertex_t = boost::graph_traits::vertex_descriptor; +using Index_map = boost::property_map::type; +using Weight_map = boost::property_map::type; /** * \class Cover_complex @@ -105,12 +105,12 @@ class Cover_complex { Graph one_skeleton_OFF; // one-skeleton given by the input OFF file (if it exists). Graph one_skeleton; // one-skeleton used to compute the connected components. - std::vector vertices; // vertices of one_skeleton. + std::vector vertices; // vertices of one_skeleton. std::vector > simplices; // simplices of output simplicial complex. std::vector voronoi_subsamples; // Voronoi germs (in case of Voronoi cover). - PersistenceDiagram PD; + Persistence_diagram PD; std::vector distribution; std::map > @@ -359,8 +359,8 @@ class Cover_complex { public: void set_graph_weights() { - IndexMap index = boost::get(boost::vertex_index, one_skeleton); - WeightMap weight = boost::get(boost::edge_weight, one_skeleton); + Index_map index = boost::get(boost::vertex_index, one_skeleton); + Weight_map weight = boost::get(boost::edge_weight, one_skeleton); boost::graph_traits::edge_iterator ei, ei_end; for (boost::tie(ei, ei_end) = boost::edges(one_skeleton); ei != ei_end; ++ei) boost::put(weight, *ei, @@ -420,7 +420,7 @@ class Cover_complex { */ template double set_graph_from_automatic_rips(Distance distance, int N = 100) { - int m = floor(n / exp((1 + rate_power) * log(log(n) / log(rate_constant)))); + int m = floor(n / std::exp((1 + rate_power) * std::log(std::log(n) / std::log(rate_constant)))); m = std::min(m, n - 1); std::vector samples(m); double delta = 0; @@ -521,7 +521,7 @@ class Cover_complex { } double reso = 0; - IndexMap index = boost::get(boost::vertex_index, one_skeleton); + Index_map index = boost::get(boost::vertex_index, one_skeleton); if (type == "GIC") { boost::graph_traits::edge_iterator ei, ei_end; @@ -660,7 +660,7 @@ class Cover_complex { int id = 0; int pos = 0; - IndexMap index = boost::get(boost::vertex_index, one_skeleton); // int maxc = -1; + Index_map index = boost::get(boost::vertex_index, one_skeleton); // int maxc = -1; std::map > preimages; std::map funcstd; @@ -799,8 +799,8 @@ class Cover_complex { SampleWithoutReplacement(n, m, voronoi_subsamples); if (distances.size() == 0) compute_pairwise_distances(distance); set_graph_weights(); - WeightMap weight = boost::get(boost::edge_weight, one_skeleton); - IndexMap index = boost::get(boost::vertex_index, one_skeleton); + Weight_map weight = boost::get(boost::edge_weight, one_skeleton); + Index_map index = boost::get(boost::vertex_index, one_skeleton); std::vector mindist(n); for (int j = 0; j < n; j++) mindist[j] = std::numeric_limits::max(); @@ -1220,7 +1220,7 @@ class Cover_complex { } if (type == "GIC") { - IndexMap index = boost::get(boost::vertex_index, one_skeleton); + Index_map index = boost::get(boost::vertex_index, one_skeleton); if (functional_cover) { // Computes the simplices in the GIC by looking at all the edges of the graph and adding the -- cgit v1.2.3