Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
EuclideanDistance.hpp
Go to the documentation of this file.
1
6// Copyright (c) 2017 Czech Technical University in Prague | Faculty of Information Technology. All rights reserved.
7
8#pragma once
9
10#include <cmath>
11#include <alib/pair>
12#include <functional>
13
14namespace graph {
15
16namespace heuristic {
17
19// ---------------------------------------------------------------------------------------------------------------------
20
21 public:
22 template<typename TCoordinate>
25
26// ---------------------------------------------------------------------------------------------------------------------
27
28 template<typename TCoordinate>
29 static std::function<double(const ext::pair<TCoordinate, TCoordinate> &,
31
32// ---------------------------------------------------------------------------------------------------------------------
33
34};
35
36// =====================================================================================================================
37
38template<typename TCoordinate>
41 return std::sqrt(
42 (node.first - goal.first) * (node.first - goal.first) +
43 (node.second - goal.second) * (node.second - goal.second));
44}
45
46// ---------------------------------------------------------------------------------------------------------------------
47
48template<typename TCoordinate>
49std::function<double(const ext::pair<TCoordinate, TCoordinate> &,
51 return euclideanDistance < TCoordinate >;
52}
53
54// ---------------------------------------------------------------------------------------------------------------------
55
56} // namespace heuristic
57
58} // namespace graph
59
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
Definition: EuclideanDistance.hpp:18
static std::function< double(const ext::pair< TCoordinate, TCoordinate > &, const ext::pair< TCoordinate, TCoordinate > &)> euclideanDistanceFunction()
Definition: EuclideanDistance.hpp:50
static double euclideanDistance(const ext::pair< TCoordinate, TCoordinate > &goal, const ext::pair< TCoordinate, TCoordinate > &node)
Definition: EuclideanDistance.hpp:39
Definition: ReconstructPath.hpp:14
Definition: Node.cpp:11