summaryrefslogtreecommitdiff
path: root/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-02-22 23:16:55 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-02-22 23:16:55 +0000
commit3cd1e01f0b0d4fdb46f49ec640c389374ca2fe70 (patch)
treeafe2bec947f098942d021e62d62546d56b9acabd /src/Cech_complex/include/gudhi/Cech_complex_blocker.h
parentd57e3dfbf15f8aaa3afa097a4e3ed49cd23d26ea (diff)
Fix Cech with radius distance
Add a meta generation script for off_file_generator git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cechcomplex_vincent@3256 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: fb13baa124ddc97c0dc61835ab0c72595d666155
Diffstat (limited to 'src/Cech_complex/include/gudhi/Cech_complex_blocker.h')
-rw-r--r--src/Cech_complex/include/gudhi/Cech_complex_blocker.h19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
index fb52f712..d718b56e 100644
--- a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
+++ b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
@@ -23,9 +23,8 @@
#ifndef CECH_COMPLEX_BLOCKER_H_
#define CECH_COMPLEX_BLOCKER_H_
-#include <gudhi/Cech_complex.h> // Cech_blocker is using a pointer on Gudhi::cech_complex::Cech_complex
-
-#include <Miniball/Miniball.hpp>
+#include <gudhi/Cech_complex.h> // Cech_blocker is using a pointer on Gudhi::cech_complex::Cech_complex
+#include <gudhi/distance_functions.h> // for Gudhi::Squared_radius
#include <iostream>
#include <vector>
@@ -58,9 +57,6 @@ class Cech_blocker {
private:
using Point = std::vector<double>;
using Point_cloud = std::vector<Point>;
- using Point_iterator = Point_cloud::const_iterator;
- using Coordinate_iterator = Point::const_iterator;
- using Min_sphere = Miniball::Miniball<Miniball::CoordAccessor<Point_iterator, Coordinate_iterator>>;
using Simplex_handle = typename SimplicialComplexForCech::Simplex_handle;
using Filtration_value = typename SimplicialComplexForCech::Filtration_value;
using Cech_complex = Gudhi::cech_complex::Cech_complex<SimplicialComplexForCech, ForwardPointRange>;
@@ -69,7 +65,7 @@ class Cech_blocker {
/** \internal \brief Cech complex blocker operator() - the oracle - assigns the filtration value from the simplex
* radius and returns if the simplex expansion must be blocked.
* \param[in] sh The Simplex_handle.
- * \return true if the simplex radius is greater than the Cech_complex threshold*/
+ * \return true if the simplex radius is greater than the Cech_complex max_radius*/
bool operator()(Simplex_handle sh) {
Point_cloud points;
for (auto vertex : simplicial_complex_.simplex_vertex_range(sh)) {
@@ -79,13 +75,12 @@ class Cech_blocker {
std::cout << "#(" << vertex << ")#";
#endif // DEBUG_TRACES
}
- Min_sphere ms(cc_ptr_->dimension(), points.begin(),points.end());
- Filtration_value diameter = 2 * std::sqrt(ms.squared_radius());
+ Filtration_value squared_radius = Gudhi::Radius_distance()(points);
#ifdef DEBUG_TRACES
- std::cout << "diameter = " << diameter << " - " << (diameter > cc_ptr_->threshold()) << std::endl;
+ std::cout << "squared_radius = " << squared_radius << " - " << (squared_radius > cc_ptr_->max_radius()) << std::endl;
#endif // DEBUG_TRACES
- simplicial_complex_.assign_filtration(sh, diameter);
- return (diameter > cc_ptr_->threshold());
+ simplicial_complex_.assign_filtration(sh, squared_radius);
+ return (squared_radius > cc_ptr_->max_radius());
}
/** \internal \brief Cech complex blocker constructor. */