From e734e9d6063b83f4bb389b8073e456cbba0b7f3a Mon Sep 17 00:00:00 2001 From: glisse Date: Sat, 15 Aug 2015 08:36:23 +0000 Subject: Remove unnecessary friends (they were befriending the wrong classes anyway). Use variadic templates to be more robust to a change in the number of template parameters. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@732 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 5d2e7af2d656a26159e2e331fd0de92ed9b3bc04 --- src/Simplex_tree/include/gudhi/Simplex_tree.h | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'src/Simplex_tree') diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h index b300e144..153401d6 100644 --- a/src/Simplex_tree/include/gudhi/Simplex_tree.h +++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h @@ -110,13 +110,6 @@ class Simplex_tree { /* Type of dictionary Vertex_handle -> Node for traversing the simplex tree. */ typedef typename boost::container::flat_map Dictionary; - friend class Simplex_tree_node_explicit_storage< Simplex_tree >; - friend class Simplex_tree_siblings< Simplex_tree, Dictionary>; - friend class Simplex_tree_simplex_vertex_iterator< Simplex_tree >; - friend class Simplex_tree_boundary_simplex_iterator< Simplex_tree >; - friend class Simplex_tree_complex_simplex_iterator< Simplex_tree >; - friend class Simplex_tree_skeleton_simplex_iterator< Simplex_tree >; - /* \brief Set of nodes sharing a same parent in the simplex tree. */ /* \brief Set of nodes sharing a same parent in the simplex tree. */ typedef Simplex_tree_siblings Siblings; @@ -931,8 +924,8 @@ class Simplex_tree { // Print a Simplex_tree in os. -template -std::ostream& operator<<(std::ostream & os, Simplex_tree & st) { +template +std::ostream& operator<<(std::ostream & os, Simplex_tree & st) { for (auto sh : st.filtration_simplex_range()) { os << st.dimension(sh) << " "; for (auto v : st.simplex_vertex_range(sh)) { @@ -943,13 +936,14 @@ std::ostream& operator<<(std::ostream & os, Simplex_tree & st) { return os; } -template -std::istream& operator>>(std::istream & is, Simplex_tree & st) { +template +std::istream& operator>>(std::istream & is, Simplex_tree & st) { // assert(st.num_simplices() == 0); - std::vector::Vertex_handle> simplex; - typename Simplex_tree::Filtration_value fil; - typename Simplex_tree::Filtration_value max_fil = 0; + typedef Simplex_tree ST; + std::vector simplex; + typename ST::Filtration_value fil; + typename ST::Filtration_value max_fil = 0; int max_dim = -1; size_t num_simplices = 0; while (read_simplex(is, simplex, fil)) { -- cgit v1.2.3