summaryrefslogtreecommitdiff
path: root/src/Simplex_tree/example/simple_simplex_tree.cpp
diff options
context:
space:
mode:
authorVincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com>2020-03-16 19:16:34 +0100
committerGitHub <noreply@github.com>2020-03-16 19:16:34 +0100
commitf40161072b8f74f68b0ff67b6ef2be7abebec950 (patch)
tree1b72b9bd381f52e578b1a8c889f288bbeb4d5efe /src/Simplex_tree/example/simple_simplex_tree.cpp
parent592d58a95dbe5851c9f4ded9e8740c1e7a9c1502 (diff)
parent6ed2a97421a223b4ebe31b91f48d779c2209f470 (diff)
Merge pull request #211 from VincentRouvreau/iterator_over_simplex_tree
Iterator over simplex tree
Diffstat (limited to 'src/Simplex_tree/example/simple_simplex_tree.cpp')
-rw-r--r--src/Simplex_tree/example/simple_simplex_tree.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Simplex_tree/example/simple_simplex_tree.cpp b/src/Simplex_tree/example/simple_simplex_tree.cpp
index 4353939f..47ea7e36 100644
--- a/src/Simplex_tree/example/simple_simplex_tree.cpp
+++ b/src/Simplex_tree/example/simple_simplex_tree.cpp
@@ -166,10 +166,19 @@ int main(int argc, char* const argv[]) {
// ++ GENERAL VARIABLE SET
std::cout << "********************************************************************\n";
- // Display the Simplex_tree - Can not be done in the middle of 2 inserts
std::cout << "* The complex contains " << simplexTree.num_simplices() << " simplices\n";
std::cout << " - dimension " << simplexTree.dimension() << "\n";
- std::cout << "* Iterator on Simplices in the filtration, with [filtration value]:\n";
+ std::cout << "* Iterator on simplices, with [filtration value]:\n";
+ for (Simplex_tree::Simplex_handle f_simplex : simplexTree.complex_simplex_range()) {
+ std::cout << " "
+ << "[" << simplexTree.filtration(f_simplex) << "] ";
+ for (auto vertex : simplexTree.simplex_vertex_range(f_simplex)) std::cout << "(" << vertex << ")";
+ std::cout << std::endl;
+ }
+
+ std::cout << "********************************************************************\n";
+ // Can not be done in the middle of 2 inserts
+ std::cout << "* Iterator on simplices sorted by filtration values, with [filtration value]:\n";
for (auto f_simplex : simplexTree.filtration_simplex_range()) {
std::cout << " "
<< "[" << simplexTree.filtration(f_simplex) << "] ";