23 #ifndef DISTANCE_FUNCTIONS_H_ 24 #define DISTANCE_FUNCTIONS_H_ 26 #include <gudhi/Debug_utils.h> 28 #include <boost/range/metafunctions.hpp> 31 #include <type_traits> 46 template<
typename Po
int >
47 typename std::iterator_traits<typename boost::range_iterator<Point>::type>::value_type
48 operator()(
const Point& p1,
const Point& p2)
const {
49 auto it1 = std::begin(p1);
50 auto it2 = std::begin(p2);
51 typedef typename boost::range_value<Point>::type NT;
53 for (; it1 != std::end(p1); ++it1, ++it2) {
54 GUDHI_CHECK(it2 != std::end(p2),
"inconsistent point dimensions");
58 GUDHI_CHECK(it2 == std::end(p2),
"inconsistent point dimensions");
62 template<
typename T >
63 T operator() (
const std::pair< T, T >& f,
const std::pair< T, T >& s)
const {
64 T dx = f.first - s.first;
65 T dy = f.second - s.second;
67 return sqrt(dx*dx + dy*dy);
73 #endif // DISTANCE_FUNCTIONS_H_ Compute the Euclidean distance between two Points given by a range of coordinates. The points are assumed to have the same dimension.
Definition: distance_functions.h:43
Definition: SimplicialComplexForAlpha.h:26