summaryrefslogtreecommitdiff
path: root/src/Cech_complex/example/cech_complex_example_from_points.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Cech_complex/example/cech_complex_example_from_points.cpp')
-rw-r--r--src/Cech_complex/example/cech_complex_example_from_points.cpp43
1 files changed, 10 insertions, 33 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 882849c3..97327e69 100644
--- a/src/Cech_complex/example/cech_complex_example_from_points.cpp
+++ b/src/Cech_complex/example/cech_complex_example_from_points.cpp
@@ -1,25 +1,3 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
- * Author(s): Vincent Rouvreau
- *
- * Copyright (C) 2018 Inria
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
#include <gudhi/Cech_complex.h>
#include <gudhi/Simplex_tree.h>
#include <gudhi/distance_functions.h>
@@ -37,23 +15,22 @@ int main() {
using Cech_complex = Gudhi::cech_complex::Cech_complex<Simplex_tree, Point_cloud>;
Point_cloud points;
- points.push_back({1.0, 1.0});
- points.push_back({7.0, 0.0});
- points.push_back({4.0, 6.0});
- points.push_back({9.0, 6.0});
- points.push_back({0.0, 14.0});
- points.push_back({2.0, 19.0});
- points.push_back({9.0, 17.0});
+ points.push_back({0., 0.});
+ points.push_back({0., 2.});
+ points.push_back({std::sqrt(3.), 1.});
+ points.push_back({1., 0.});
+ points.push_back({1., 2.});
+ points.push_back({1. - std::sqrt(3.), 1.});
// ----------------------------------------------------------------------------
// Init of a Cech complex from points
// ----------------------------------------------------------------------------
- // 7.1 is a magic number to force one blocker, and one non-blocker
- Filtration_value threshold = 7.1;
- Cech_complex cech_complex_from_points(points, threshold, Gudhi::Euclidean_distance());
+ // 5. is a magic number to force one blocker, and one non-blocker
+ Filtration_value max_radius = 12.;
+ Cech_complex cech_complex_from_points(points, max_radius);
Simplex_tree stree;
- cech_complex_from_points.create_complex(stree, 2);
+ cech_complex_from_points.create_complex(stree, -1);
// ----------------------------------------------------------------------------
// Display information about the one skeleton Cech complex
// ----------------------------------------------------------------------------