summaryrefslogtreecommitdiff
path: root/src/Cech_complex/example
diff options
context:
space:
mode:
authorHind-M <hind.montassif@gmail.com>2021-09-30 11:05:17 +0200
committerHind-M <hind.montassif@gmail.com>2021-09-30 11:05:17 +0200
commit767d9fca5da2d3dd9698a5c27e9bedc159271f67 (patch)
treedefb85dddefbe6cd2064059baf9baeed0e72b87e /src/Cech_complex/example
parent44f754ee58aeee043891f4494892798b9807374b (diff)
Move minimal enclosing balls cache to Cech_complex.h instead of the blocker
Modify cech test to be more relevant regarding the current algorithm Do some cleaning
Diffstat (limited to 'src/Cech_complex/example')
-rw-r--r--src/Cech_complex/example/cech_complex_example_from_points.cpp42
-rw-r--r--src/Cech_complex/example/cech_complex_step_by_step.cpp8
2 files changed, 3 insertions, 47 deletions
diff --git a/src/Cech_complex/example/cech_complex_example_from_points.cpp b/src/Cech_complex/example/cech_complex_example_from_points.cpp
index e78ad51d..78861951 100644
--- a/src/Cech_complex/example/cech_complex_example_from_points.cpp
+++ b/src/Cech_complex/example/cech_complex_example_from_points.cpp
@@ -10,25 +10,15 @@
int main() {
// Type definitions
-// using Point_cloud = std::vector<std::array<double, 2>>;
using Simplex_tree = Gudhi::Simplex_tree<Gudhi::Simplex_tree_options_fast_persistence>;
using Filtration_value = Simplex_tree::Filtration_value;
using Kernel = CGAL::Epeck_d<CGAL::Dynamic_dimension_tag>;
using FT = typename Kernel::FT;
using Point = typename Kernel::Point_d;
using Point_cloud = std::vector<Point>;
- using Cech_complex = Gudhi::cech_complex::Cech_complex<Simplex_tree, Point_cloud, Kernel>;
+ using Cech_complex = Gudhi::cech_complex::Cech_complex<Simplex_tree, Point_cloud, Kernel, Simplex_tree>;
Point_cloud points;
-// points.push_back({1., 0.}); // 0
-// points.push_back({0., 1.}); // 1
-// points.push_back({2., 1.}); // 2
-// points.push_back({3., 2.}); // 3
-// points.push_back({0., 3.}); // 4
-// points.push_back({3. + std::sqrt(3.), 3.}); // 5
-
-// std::vector<FT> point({0.0, 0.0, 0.0, 0.0});
-// points.emplace_back(point.begin(), point.end());
std::vector<FT> point0({1., 0.});
points.emplace_back(point0.begin(), point0.end());
@@ -42,8 +32,6 @@ int main() {
points.emplace_back(point4.begin(), point4.end());
std::vector<FT> point5({3. + std::sqrt(3.), 3.});
points.emplace_back(point5.begin(), point5.end());
-
-/*
std::vector<FT> point6({1., 4.});
points.emplace_back(point6.begin(), point6.end());
std::vector<FT> point7({3., 4.});
@@ -54,39 +42,15 @@ int main() {
points.emplace_back(point9.begin(), point9.end());
std::vector<FT> point10({-0.5, 2.});
points.emplace_back(point10.begin(), point10.end());
-*/
-// points.emplace_back(Point(std::vector<FT>({1., 0.})));
-// points.emplace_back(Point(std::vector<FT>({0., 1.})));
-// points.emplace_back(Point(std::vector<FT>({2., 1.})));
-// points.emplace_back(Point(std::vector<FT>({3., 2.})));
-// points.emplace_back(Point(std::vector<FT>({0., 3.})));
-// points.emplace_back(Point(std::vector<FT>({3. + std::sqrt(3.), 3.})));
-
-
-// points.push_back(Point(1.0, 0.0));
-// points.push_back(Point(0.0, 1.0));
-// points.push_back(Point(2.0, 1.0));
-// points.push_back(Point(3.0, 2.0));
-// points.push_back(Point(0.0, 3.0));
-// points.push_back(Point(3.0 + std::sqrt(3.0), 3.0));
-
-
-// points.push_back({1., 4.}); // 6
-// points.push_back({3., 4.}); // 7
-// points.push_back({2., 4. + std::sqrt(3.)}); // 8
-// points.push_back({0., 4.}); // 9
-// points.push_back({-0.5, 2.}); // 10
// ----------------------------------------------------------------------------
// Init of a Cech complex from points
// ----------------------------------------------------------------------------
- Filtration_value max_radius = 10.; //100.;
- std::clog << "Hind: Just before the Cech constructor" << std::endl;
+ Filtration_value max_radius = 100.; //100.;
Cech_complex cech_complex_from_points(points, max_radius);
- std::clog << "Hind: Just after the Cech constructor" << std::endl;
Simplex_tree stree;
- cech_complex_from_points.create_complex(stree, 3); //6
+ cech_complex_from_points.create_complex(stree, 6); //6
// ----------------------------------------------------------------------------
// Display information about the one skeleton Cech complex
// ----------------------------------------------------------------------------
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 ac08e6cc..44e7f945 100644
--- a/src/Cech_complex/example/cech_complex_step_by_step.cpp
+++ b/src/Cech_complex/example/cech_complex_step_by_step.cpp
@@ -13,8 +13,6 @@
#include <gudhi/Simplex_tree.h>
#include <gudhi/Points_off_io.h>
-#include <gudhi/Miniball.hpp> // TODO to remove ?
-
#include <CGAL/Epeck_d.h>
#include <boost/program_options.hpp>
@@ -36,7 +34,6 @@
using Simplex_tree = Gudhi::Simplex_tree<>;
using Simplex_handle = Simplex_tree::Simplex_handle;
using Filtration_value = Simplex_tree::Filtration_value;
-// using Point = std::vector<double>;
using Kernel = CGAL::Epeck_d<CGAL::Dynamic_dimension_tag>;
using Point = typename Kernel::Point_d;
using Points_off_reader = Gudhi::Points_off_reader<Point>;
@@ -45,9 +42,6 @@ using Proximity_graph = Gudhi::Proximity_graph<Simplex_tree>;
class Cech_blocker {
private:
using Point_cloud = std::vector<Point>;
-// using Point_iterator = Point_cloud::const_iterator;
-// using Coordinate_iterator = Point::const_iterator;
-// using Min_sphere = Gudhi::Miniball::Miniball<Gudhi::Miniball::CoordAccessor<Point_iterator, Coordinate_iterator>>;
public:
bool operator()(Simplex_handle sh) {
@@ -67,14 +61,12 @@ class Cech_blocker {
}
Cech_blocker(Simplex_tree& simplex_tree, Filtration_value max_radius, const std::vector<Point>& point_cloud)
: simplex_tree_(simplex_tree), max_radius_(max_radius), point_cloud_(point_cloud) {
-// dimension_ = point_cloud_[0].size();
}
private:
Simplex_tree simplex_tree_;
Filtration_value max_radius_;
std::vector<Point> point_cloud_;
-// int dimension_;
};
void program_options(int argc, char* argv[], std::string& off_file_points, Filtration_value& max_radius, int& dim_max);