diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-12-08 17:02:26 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-12-08 17:02:26 +0000 |
commit | ccc1ca066fa7c1fb35929eceb52f2f36179aea37 (patch) | |
tree | 0d3a407626c2074df39b5f4d5eb923498804465c /src/common | |
parent | 69907a03283337e76d7763f82250b4e2a6b8f631 (diff) |
Remove inline from read_graph (now inline)
Remove Edge_t template (not needed)
Add documentation on template params
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/distance_matrix_in_rips_module@1839 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: a011b11cddf1a20e29743e6b170dac054ac79c12
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/include/gudhi/reader_utils.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/common/include/gudhi/reader_utils.h b/src/common/include/gudhi/reader_utils.h index 2d774d4d..4c8d85cd 100644 --- a/src/common/include/gudhi/reader_utils.h +++ b/src/common/include/gudhi/reader_utils.h @@ -74,6 +74,10 @@ inline void read_points(std::string file_name, std::vector< std::vector< double /** * @brief Read a graph from a file. * + * \tparam Graph_t Type for the return graph. Must be constructible from iterators on pairs of Vertex_handle + * \tparam Filtration_value Type for the value of the read filtration + * \tparam Vertex_handle Type for the value of the read vertices + * * File format: 1 simplex per line<br> * Dim1 X11 X12 ... X1d Fil1<br> * Dim2 X21 X22 ... X2d Fil2<br> @@ -83,13 +87,14 @@ inline void read_points(std::string file_name, std::vector< std::vector< double * Every simplex must appear exactly once. * Simplices of dimension more than 1 are ignored. */ -template< typename Graph_t, typename Edge_t, typename Filtration_value, typename Vertex_handle > -inline Graph_t read_graph(std::string file_name) { +template< typename Graph_t, typename Filtration_value, typename Vertex_handle > +Graph_t read_graph(std::string file_name) { std::ifstream in_(file_name.c_str(), std::ios::in); if (!in_.is_open()) { std::cerr << "Unable to open file " << file_name << std::endl; } + typedef std::pair< Vertex_handle, Vertex_handle > Edge_t; std::vector< Edge_t > edges; std::vector< Filtration_value > edges_fil; std::map< Vertex_handle, Filtration_value > vertices; |