summaryrefslogtreecommitdiff
path: root/src/Cech_complex
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-03-22 10:10:08 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-03-22 10:10:08 +0000
commit1f3716292673a56413d3501b4b98b54416d193ed (patch)
tree987e487ff243271328398d4d2110ee4936ebaba7 /src/Cech_complex
parent81c9548a189aa46ab7e71bbcf15a185ee68df24a (diff)
code review : Rename Radius_distance Minimal_enclosing_ball_radius
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cechcomplex_vincent@3304 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 204aa7a7098773b2d290e35a12a1c92449743d7d
Diffstat (limited to 'src/Cech_complex')
-rw-r--r--src/Cech_complex/benchmark/cech_complex_benchmark.cpp32
-rw-r--r--src/Cech_complex/example/cech_complex_step_by_step.cpp4
-rw-r--r--src/Cech_complex/include/gudhi/Cech_complex.h11
-rw-r--r--src/Cech_complex/include/gudhi/Cech_complex_blocker.h4
-rw-r--r--src/Cech_complex/test/test_cech_complex.cpp4
5 files changed, 30 insertions, 25 deletions
diff --git a/src/Cech_complex/benchmark/cech_complex_benchmark.cpp b/src/Cech_complex/benchmark/cech_complex_benchmark.cpp
index 6ba52419..2fa255ed 100644
--- a/src/Cech_complex/benchmark/cech_complex_benchmark.cpp
+++ b/src/Cech_complex/benchmark/cech_complex_benchmark.cpp
@@ -46,7 +46,7 @@ using Rips_complex = Gudhi::rips_complex::Rips_complex<Filtration_value>;
using Cech_complex = Gudhi::cech_complex::Cech_complex<Simplex_tree, Point_cloud>;
-class Radius_distance {
+class Minimal_enclosing_ball_radius {
public:
// boost::range_value is not SFINAE-friendly so we cannot use it in the return type
template< typename Point >
@@ -80,24 +80,26 @@ int main(int argc, char * argv[]) {
Gudhi::Clock euclidean_clock("Gudhi::Euclidean_distance");
// Compute the proximity graph of the points
Proximity_graph euclidean_prox_graph = Gudhi::compute_proximity_graph<Simplex_tree>(off_reader.get_point_cloud(),
- threshold,
- Gudhi::Euclidean_distance());
+ threshold,
+ Gudhi::Euclidean_distance());
std::cout << euclidean_clock << std::endl;
- Gudhi::Clock radius_clock("Radius_distance");
+ Gudhi::Clock miniball_clock("Minimal_enclosing_ball_radius");
// Compute the proximity graph of the points
- Proximity_graph radius_prox_graph = Gudhi::compute_proximity_graph<Simplex_tree>(off_reader.get_point_cloud(),
- threshold,
- Radius_distance());
- std::cout << radius_clock << std::endl;
+ Proximity_graph miniball_prox_graph =
+ Gudhi::compute_proximity_graph<Simplex_tree>(off_reader.get_point_cloud(),
+ threshold,
+ Minimal_enclosing_ball_radius());
+ std::cout << miniball_clock << std::endl;
- Gudhi::Clock common_radius_clock("Gudhi::Radius_distance()");
+ Gudhi::Clock common_miniball_clock("Gudhi::Minimal_enclosing_ball_radius()");
// Compute the proximity graph of the points
- Proximity_graph sq_radius_prox_graph = Gudhi::compute_proximity_graph<Simplex_tree>(off_reader.get_point_cloud(),
- threshold,
- Gudhi::Radius_distance());
- std::cout << common_radius_clock << std::endl;
+ Proximity_graph common_miniball_prox_graph =
+ Gudhi::compute_proximity_graph<Simplex_tree>(off_reader.get_point_cloud(),
+ threshold,
+ Gudhi::Minimal_enclosing_ball_radius());
+ std::cout << common_miniball_clock << std::endl;
boost::filesystem::path full_path(boost::filesystem::current_path());
@@ -121,7 +123,9 @@ int main(int argc, char * argv[]) {
std::cout << itr->path().stem() << ";";
std::cout << radius << ";";
Gudhi::Clock rips_clock("Rips computation");
- Rips_complex rips_complex_from_points(off_reader.get_point_cloud(), radius, Gudhi::Radius_distance());
+ Rips_complex rips_complex_from_points(off_reader.get_point_cloud(),
+ radius,
+ Gudhi::Minimal_enclosing_ball_radius());
Simplex_tree rips_stree;
rips_complex_from_points.create_complex(rips_stree, p0.size() - 1);
// ------------------------------------------
diff --git a/src/Cech_complex/example/cech_complex_step_by_step.cpp b/src/Cech_complex/example/cech_complex_step_by_step.cpp
index 0e7c4bbd..760b53dc 100644
--- a/src/Cech_complex/example/cech_complex_step_by_step.cpp
+++ b/src/Cech_complex/example/cech_complex_step_by_step.cpp
@@ -65,7 +65,7 @@ class Cech_blocker {
std::cout << "#(" << vertex << ")#";
#endif // DEBUG_TRACES
}
- Filtration_value radius = Gudhi::Radius_distance()(points);
+ Filtration_value radius = Gudhi::Minimal_enclosing_ball_radius()(points);
#ifdef DEBUG_TRACES
std::cout << "radius = " << radius << " - " << (radius > max_radius_) << std::endl;
#endif // DEBUG_TRACES
@@ -105,7 +105,7 @@ int main(int argc, char * argv[]) {
// Compute the proximity graph of the points
Proximity_graph prox_graph = Gudhi::compute_proximity_graph<Simplex_tree>(off_reader.get_point_cloud(),
max_radius,
- Gudhi::Radius_distance());
+ Gudhi::Minimal_enclosing_ball_radius());
// Construct the Rips complex in a Simplex Tree
Simplex_tree st;
diff --git a/src/Cech_complex/include/gudhi/Cech_complex.h b/src/Cech_complex/include/gudhi/Cech_complex.h
index 612c73c3..8b1a9221 100644
--- a/src/Cech_complex/include/gudhi/Cech_complex.h
+++ b/src/Cech_complex/include/gudhi/Cech_complex.h
@@ -23,7 +23,7 @@
#ifndef CECH_COMPLEX_H_
#define CECH_COMPLEX_H_
-#include <gudhi/distance_functions.h> // for Gudhi::Radius_distance
+#include <gudhi/distance_functions.h> // for Gudhi::Minimal_enclosing_ball_radius
#include <gudhi/graph_simplicial_complex.h> // for Gudhi::Proximity_graph
#include <gudhi/Debug_utils.h> // for GUDHI_CHECK
#include <gudhi/Cech_complex_blocker.h> // for Gudhi::cech_complex::Cech_blocker
@@ -43,7 +43,7 @@ namespace cech_complex {
*
* \details
* The data structure is a proximity graph, containing edges when the edge length is less or equal
- * to a given max_radius. Edge length is computed from `Gudhi::Radius_distance` distance function.
+ * to a given max_radius. Edge length is computed from `Gudhi::Minimal_enclosing_ball_radius` distance function.
*
* \tparam SimplicialComplexForProximityGraph furnishes `Vertex_handle` and `Filtration_value` type definition required
* by `Gudhi::Proximity_graph`.
@@ -71,9 +71,10 @@ class Cech_complex {
Cech_complex(const ForwardPointRange& points, Filtration_value max_radius)
: max_radius_(max_radius),
point_cloud_(points) {
- cech_skeleton_graph_ = Gudhi::compute_proximity_graph<SimplicialComplexForProximityGraph>(point_cloud_,
- max_radius_,
- Gudhi::Radius_distance());
+ cech_skeleton_graph_ =
+ Gudhi::compute_proximity_graph<SimplicialComplexForProximityGraph>(point_cloud_,
+ max_radius_,
+ Gudhi::Minimal_enclosing_ball_radius());
}
/** \brief Initializes the simplicial complex from the proximity graph and expands it until a given maximal
diff --git a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
index 5ba17c51..c082815d 100644
--- a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
+++ b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
@@ -24,7 +24,7 @@
#define CECH_COMPLEX_BLOCKER_H_
#include <gudhi/Cech_complex.h> // Cech_blocker is using a pointer on Gudhi::cech_complex::Cech_complex
-#include <gudhi/distance_functions.h> // for Gudhi::Radius_distance
+#include <gudhi/distance_functions.h> // for Gudhi::Minimal_enclosing_ball_radius
#include <iostream>
#include <vector>
@@ -75,7 +75,7 @@ class Cech_blocker {
std::cout << "#(" << vertex << ")#";
#endif // DEBUG_TRACES
}
- Filtration_value radius = Gudhi::Radius_distance()(points);
+ Filtration_value radius = Gudhi::Minimal_enclosing_ball_radius()(points);
#ifdef DEBUG_TRACES
if (radius > cc_ptr_->max_radius())
std::cout << "radius > max_radius => expansion is blocked\n";
diff --git a/src/Cech_complex/test/test_cech_complex.cpp b/src/Cech_complex/test/test_cech_complex.cpp
index 4aa85057..8658729b 100644
--- a/src/Cech_complex/test/test_cech_complex.cpp
+++ b/src/Cech_complex/test/test_cech_complex.cpp
@@ -111,10 +111,10 @@ BOOST_AUTO_TEST_CASE(Cech_complex_for_documentation) {
std::cout << vertex << ",";
vp.push_back(points.at(vertex));
}
- std::cout << ") - distance =" << Gudhi::Radius_distance()(vp.at(0), vp.at(1)) <<
+ std::cout << ") - distance =" << Gudhi::Minimal_enclosing_ball_radius()(vp.at(0), vp.at(1)) <<
" - filtration =" << st.filtration(f_simplex) << std::endl;
BOOST_CHECK(vp.size() == 2);
- GUDHI_TEST_FLOAT_EQUALITY_CHECK(st.filtration(f_simplex), Gudhi::Radius_distance()(vp.at(0), vp.at(1)));
+ GUDHI_TEST_FLOAT_EQUALITY_CHECK(st.filtration(f_simplex), Gudhi::Minimal_enclosing_ball_radius()(vp.at(0), vp.at(1)));
}
}