diff options
Diffstat (limited to 'src/common/include/gudhi')
-rw-r--r-- | src/common/include/gudhi/distance_functions.h | 8 | ||||
-rw-r--r-- | src/common/include/gudhi/graph_simplicial_complex.h | 8 | ||||
-rw-r--r-- | src/common/include/gudhi/reader_utils.h | 3 |
3 files changed, 10 insertions, 9 deletions
diff --git a/src/common/include/gudhi/distance_functions.h b/src/common/include/gudhi/distance_functions.h index cd518581..006df275 100644 --- a/src/common/include/gudhi/distance_functions.h +++ b/src/common/include/gudhi/distance_functions.h @@ -28,13 +28,13 @@ /* Compute the Euclidean distance between two Points given * by a range of coordinates. The points are assumed to have * the same dimension. */ -template< typename Point > -double euclidean_distance(Point &p1, Point &p2) { - double dist = 0.; +template< typename Filtration_value, typename Point > +Filtration_value euclidean_distance(const Point &p1,const Point &p2) { + Filtration_value dist = 0.; auto it1 = p1.begin(); auto it2 = p2.begin(); for (; it1 != p1.end(); ++it1, ++it2) { - double tmp = *it1 - *it2; + Filtration_value tmp = (double)(*it1) - (double)(*it2); dist += tmp*tmp; } return std::sqrt(dist); diff --git a/src/common/include/gudhi/graph_simplicial_complex.h b/src/common/include/gudhi/graph_simplicial_complex.h index 042ef516..773889d9 100644 --- a/src/common/include/gudhi/graph_simplicial_complex.h +++ b/src/common/include/gudhi/graph_simplicial_complex.h @@ -39,14 +39,14 @@ struct vertex_filtration_t { typedef boost::vertex_property_tag kind; }; -typedef int Vertex_handle; +/*typedef int Vertex_handle; typedef double Filtration_value; typedef boost::adjacency_list < boost::vecS, boost::vecS, boost::undirectedS , boost::property < vertex_filtration_t, Filtration_value > , boost::property < edge_filtration_t, Filtration_value > > Graph_t; typedef std::pair< Vertex_handle, Vertex_handle > Edge_t; - +*/ /** \brief Output the proximity graph of the points. * * If points contains n elements, the proximity graph is the graph @@ -56,7 +56,7 @@ typedef std::pair< Vertex_handle, Vertex_handle > Edge_t; * The type PointCloud furnishes .begin() and .end() methods, that return * iterators with value_type Point. */ -template< typename PointCloud +/*template< typename PointCloud , typename Point > Graph_t compute_proximity_graph(PointCloud &points , Filtration_value threshold @@ -94,6 +94,6 @@ Graph_t compute_proximity_graph(PointCloud &points } return skel_graph; -} +}*/ #endif // GRAPH_SIMPLICIAL_COMPLEX_H_ diff --git a/src/common/include/gudhi/reader_utils.h b/src/common/include/gudhi/reader_utils.h index 899f9df6..4154acc9 100644 --- a/src/common/include/gudhi/reader_utils.h +++ b/src/common/include/gudhi/reader_utils.h @@ -77,6 +77,7 @@ 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) { std::ifstream in_(file_name.c_str(), std::ios::in); if (!in_.is_open()) { @@ -130,7 +131,7 @@ inline Graph_t read_graph(std::string file_name) { Graph_t skel_graph(edges.begin(), edges.end(), edges_fil.begin(), vertices.size()); auto vertex_prop = boost::get(vertex_filtration_t(), skel_graph); - boost::graph_traits<Graph_t>::vertex_iterator vi, vi_end; + typename boost::graph_traits<Graph_t>::vertex_iterator vi, vi_end; auto v_it = vertices.begin(); for (std::tie(vi, vi_end) = boost::vertices(skel_graph); vi != vi_end; ++vi, ++v_it) { boost::put(vertex_prop, *vi, v_it->second); |