summaryrefslogtreecommitdiff
path: root/src/Simplex_tree
diff options
context:
space:
mode:
authorglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-08-15 08:36:23 +0000
committerglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-08-15 08:36:23 +0000
commite734e9d6063b83f4bb389b8073e456cbba0b7f3a (patch)
tree4f49c82c803e64274736a47ea915ca624b255c5f /src/Simplex_tree
parent3e72827aa8baf2af1efe682673ae1abd1327ab47 (diff)
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
Diffstat (limited to 'src/Simplex_tree')
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree.h22
1 files changed, 8 insertions, 14 deletions
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<Vertex_handle, Node> Dictionary;
- friend class Simplex_tree_node_explicit_storage< Simplex_tree<FiltrationValue, SimplexKey, VertexHandle> >;
- friend class Simplex_tree_siblings< Simplex_tree<FiltrationValue, SimplexKey, VertexHandle>, Dictionary>;
- friend class Simplex_tree_simplex_vertex_iterator< Simplex_tree<FiltrationValue, SimplexKey, VertexHandle> >;
- friend class Simplex_tree_boundary_simplex_iterator< Simplex_tree<FiltrationValue, SimplexKey, VertexHandle> >;
- friend class Simplex_tree_complex_simplex_iterator< Simplex_tree<FiltrationValue, SimplexKey, VertexHandle> >;
- friend class Simplex_tree_skeleton_simplex_iterator< Simplex_tree<FiltrationValue, SimplexKey, VertexHandle> >;
-
/* \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<Simplex_tree, Dictionary> Siblings;
@@ -931,8 +924,8 @@ class Simplex_tree {
// Print a Simplex_tree in os.
-template<typename T1, typename T2, typename T3>
-std::ostream& operator<<(std::ostream & os, Simplex_tree<T1, T2, T3> & st) {
+template<typename...T>
+std::ostream& operator<<(std::ostream & os, Simplex_tree<T...> & 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<T1, T2, T3> & st) {
return os;
}
-template<typename T1, typename T2, typename T3>
-std::istream& operator>>(std::istream & is, Simplex_tree<T1, T2, T3> & st) {
+template<typename...T>
+std::istream& operator>>(std::istream & is, Simplex_tree<T...> & st) {
// assert(st.num_simplices() == 0);
- std::vector<typename Simplex_tree<T1, T2, T3>::Vertex_handle> simplex;
- typename Simplex_tree<T1, T2, T3>::Filtration_value fil;
- typename Simplex_tree<T1, T2, T3>::Filtration_value max_fil = 0;
+ typedef Simplex_tree<T...> ST;
+ std::vector<typename ST::Vertex_handle> 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)) {