diff options
Diffstat (limited to 'example/Simplex_tree/graph_expansion_with_blocker.cpp')
-rw-r--r-- | example/Simplex_tree/graph_expansion_with_blocker.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/example/Simplex_tree/graph_expansion_with_blocker.cpp b/example/Simplex_tree/graph_expansion_with_blocker.cpp index 0d458cbd..f39de31f 100644 --- a/example/Simplex_tree/graph_expansion_with_blocker.cpp +++ b/example/Simplex_tree/graph_expansion_with_blocker.cpp @@ -4,7 +4,7 @@ * * Author(s): Vincent Rouvreau * - * Copyright (C) 2014 + * Copyright (C) 2014 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 @@ -29,33 +29,33 @@ using Simplex_handle = Simplex_tree::Simplex_handle; int main(int argc, char* const argv[]) { // Construct the Simplex Tree with a 1-skeleton graph example - Simplex_tree simplexTree; + Simplex_tree stree; - simplexTree.insert_simplex({0, 1}, 0.); - simplexTree.insert_simplex({0, 2}, 1.); - simplexTree.insert_simplex({0, 3}, 2.); - simplexTree.insert_simplex({1, 2}, 3.); - simplexTree.insert_simplex({1, 3}, 4.); - simplexTree.insert_simplex({2, 3}, 5.); - simplexTree.insert_simplex({2, 4}, 6.); - simplexTree.insert_simplex({3, 6}, 7.); - simplexTree.insert_simplex({4, 5}, 8.); - simplexTree.insert_simplex({4, 6}, 9.); - simplexTree.insert_simplex({5, 6}, 10.); - simplexTree.insert_simplex({6}, 10.); + stree.insert_simplex({0, 1}, 0.); + stree.insert_simplex({0, 2}, 1.); + stree.insert_simplex({0, 3}, 2.); + stree.insert_simplex({1, 2}, 3.); + stree.insert_simplex({1, 3}, 4.); + stree.insert_simplex({2, 3}, 5.); + stree.insert_simplex({2, 4}, 6.); + stree.insert_simplex({3, 6}, 7.); + stree.insert_simplex({4, 5}, 8.); + stree.insert_simplex({4, 6}, 9.); + stree.insert_simplex({5, 6}, 10.); + stree.insert_simplex({6}, 10.); - simplexTree.expansion_with_blockers(3, [&](Simplex_handle sh) { + stree.expansion_with_blockers(3, [&](Simplex_handle sh) { bool result = false; std::cout << "Blocker on ["; // User can loop on the vertices from the given simplex_handle i.e. - for (auto vertex : simplexTree.simplex_vertex_range(sh)) { + for (auto vertex : stree.simplex_vertex_range(sh)) { // We block the expansion, if the vertex '6' is in the given list of vertices if (vertex == 6) result = true; std::cout << vertex << ", "; } - std::cout << "] ( " << simplexTree.filtration(sh); + std::cout << "] ( " << stree.filtration(sh); // User can re-assign a new filtration value directly in the blocker (default is the maximal value of boudaries) - simplexTree.assign_filtration(sh, simplexTree.filtration(sh) + 1.); + stree.assign_filtration(sh, stree.filtration(sh) + 1.); std::cout << " + 1. ) = " << result << std::endl; @@ -63,13 +63,13 @@ int main(int argc, char* const argv[]) { }); std::cout << "********************************************************************\n"; - std::cout << "* The complex contains " << simplexTree.num_simplices() << " simplices"; - std::cout << " - dimension " << simplexTree.dimension() << "\n"; + std::cout << "* The complex contains " << stree.num_simplices() << " simplices"; + std::cout << " - dimension " << stree.dimension() << "\n"; std::cout << "* Iterator on Simplices in the filtration, with [filtration value]:\n"; - for (auto f_simplex : simplexTree.filtration_simplex_range()) { + for (auto f_simplex : stree.filtration_simplex_range()) { std::cout << " " - << "[" << simplexTree.filtration(f_simplex) << "] "; - for (auto vertex : simplexTree.simplex_vertex_range(f_simplex)) std::cout << "(" << vertex << ")"; + << "[" << stree.filtration(f_simplex) << "] "; + for (auto vertex : stree.simplex_vertex_range(f_simplex)) std::cout << "(" << vertex << ")"; std::cout << std::endl; } |