11#ifndef DISTANCE_FUNCTIONS_H_
12#define DISTANCE_FUNCTIONS_H_
14#include <gudhi/Debug_utils.h>
16#include <boost/range/metafunctions.hpp>
17#include <boost/range/size.hpp>
35 template<
typename Po
int >
36 typename std::iterator_traits<typename boost::range_iterator<Point>::type>::value_type
37 operator()(
const Point& p1,
const Point& p2)
const {
38 auto it1 = std::begin(p1);
39 auto it2 = std::begin(p2);
40 typedef typename boost::range_value<Point>::type NT;
42 for (; it1 != std::end(p1); ++it1, ++it2) {
43 GUDHI_CHECK(it2 != std::end(p2),
"inconsistent point dimensions");
47 GUDHI_CHECK(it2 == std::end(p2),
"inconsistent point dimensions");
51 template<
typename T >
52 T operator() (
const std::pair< T, T >& f,
const std::pair< T, T >& s)
const {
53 T dx = f.first - s.first;
54 T dy = f.second - s.second;
56 return sqrt(dx*dx + dy*dy);
Compute the Euclidean distance between two Points given by a range of coordinates....
Definition: distance_functions.h:32
Gudhi namespace.
Definition: SimplicialComplexForAlpha.h:14