summaryrefslogtreecommitdiff
path: root/src/common/include/gudhi/distance_functions.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/include/gudhi/distance_functions.h')
-rw-r--r--src/common/include/gudhi/distance_functions.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/include/gudhi/distance_functions.h b/src/common/include/gudhi/distance_functions.h
index f6e2ab5a..f683136b 100644
--- a/src/common/include/gudhi/distance_functions.h
+++ b/src/common/include/gudhi/distance_functions.h
@@ -48,6 +48,11 @@ class Euclidean_distance {
}
return std::sqrt(dist);
}
+ template< typename T >
+ T operator() ( const std::pair< T,T >& f , const std::pair< T,T >& s )
+ {
+ return sqrt( (f.first-s.first)*(f.first-s.first) + (f.second-s.second)*(f.second-s.second) );
+ }
};
} // namespace Gudhi