summaryrefslogtreecommitdiff
path: root/src/Cech_complex/example
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-02-20 16:30:27 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-02-20 16:30:27 +0000
commitd57e3dfbf15f8aaa3afa097a4e3ed49cd23d26ea (patch)
tree9774c15d0c99b4bc679bb4555b2ce3012f910bc2 /src/Cech_complex/example
parent0586a149b5bb3a4b65b63b2ab7d3ecdd9682ee1b (diff)
Add doc, example renamed
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cechcomplex_vincent@3254 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 666bacd07c711b89167c87155c21fe88688e2e68
Diffstat (limited to 'src/Cech_complex/example')
-rw-r--r--src/Cech_complex/example/CMakeLists.txt6
-rw-r--r--src/Cech_complex/example/cech_complex_example_from_points.cpp (renamed from src/Cech_complex/example/example_one_skeleton_cech_from_points.cpp)10
-rw-r--r--src/Cech_complex/example/cech_complex_example_from_points_for_doc.txt16
3 files changed, 24 insertions, 8 deletions
diff --git a/src/Cech_complex/example/CMakeLists.txt b/src/Cech_complex/example/CMakeLists.txt
index 8097871f..ac32ff95 100644
--- a/src/Cech_complex/example/CMakeLists.txt
+++ b/src/Cech_complex/example/CMakeLists.txt
@@ -7,8 +7,8 @@ if (TBB_FOUND)
target_link_libraries(Cech_complex_example_step_by_step ${TBB_LIBRARIES})
endif()
-add_executable ( Cech_complex_example_one_skeleton_from_points example_one_skeleton_cech_from_points.cpp)
+add_executable ( Cech_complex_example_from_points cech_complex_example_from_points.cpp)
if (TBB_FOUND)
- target_link_libraries(Cech_complex_example_one_skeleton_from_points ${TBB_LIBRARIES})
+ target_link_libraries(Cech_complex_example_from_points ${TBB_LIBRARIES})
endif()
-add_test(NAME Cech_complex_example_one_skeleton_from_points COMMAND $<TARGET_FILE:Cech_complex_example_one_skeleton_from_points>)
+add_test(NAME Cech_complex_example_from_points COMMAND $<TARGET_FILE:Cech_complex_example_from_points>)
diff --git a/src/Cech_complex/example/example_one_skeleton_cech_from_points.cpp b/src/Cech_complex/example/cech_complex_example_from_points.cpp
index 73679716..882849c3 100644
--- a/src/Cech_complex/example/example_one_skeleton_cech_from_points.cpp
+++ b/src/Cech_complex/example/cech_complex_example_from_points.cpp
@@ -28,7 +28,6 @@
#include <string>
#include <vector>
#include <array>
-#include <limits> // for std::numeric_limits
int main() {
// Type definitions
@@ -47,15 +46,16 @@ int main() {
points.push_back({9.0, 17.0});
// ----------------------------------------------------------------------------
- // Init of a Rips complex from points
+ // Init of a Cech complex from points
// ----------------------------------------------------------------------------
- Filtration_value threshold = 12.0;
+ // 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());
Simplex_tree stree;
- cech_complex_from_points.create_complex(stree, 3);
+ cech_complex_from_points.create_complex(stree, 2);
// ----------------------------------------------------------------------------
- // Display information about the one skeleton Rips complex
+ // Display information about the one skeleton Cech complex
// ----------------------------------------------------------------------------
std::cout << "Cech complex is of dimension " << stree.dimension() <<
" - " << stree.num_simplices() << " simplices - " <<
diff --git a/src/Cech_complex/example/cech_complex_example_from_points_for_doc.txt b/src/Cech_complex/example/cech_complex_example_from_points_for_doc.txt
new file mode 100644
index 00000000..684e120b
--- /dev/null
+++ b/src/Cech_complex/example/cech_complex_example_from_points_for_doc.txt
@@ -0,0 +1,16 @@
+Cech complex is of dimension 2 - 14 simplices - 7 vertices.
+Iterator on Cech complex simplices in the filtration order, with [filtration value]:
+ ( 0 ) -> [0]
+ ( 1 ) -> [0]
+ ( 2 ) -> [0]
+ ( 3 ) -> [0]
+ ( 4 ) -> [0]
+ ( 5 ) -> [0]
+ ( 6 ) -> [0]
+ ( 3 2 ) -> [5]
+ ( 5 4 ) -> [5.38516]
+ ( 2 0 ) -> [5.83095]
+ ( 1 0 ) -> [6.08276]
+ ( 3 1 ) -> [6.32456]
+ ( 2 1 ) -> [6.7082]
+ ( 3 2 1 ) -> [7.07107]