summaryrefslogtreecommitdiff
path: root/src/Simplex_tree
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-03-16 13:38:18 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-03-16 13:38:18 +0100
commit6ed2a97421a223b4ebe31b91f48d779c2209f470 (patch)
treeba6fbeab3dcc9bd1aa343045e53da076ca26c46a /src/Simplex_tree
parentef519f6169f03aa6186d092b959454df1e2a3e50 (diff)
Add get_simplices method - contrary to get_filtration method, sort is not performed
Diffstat (limited to 'src/Simplex_tree')
-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) << "] ";