Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
EuclideanDistanceNoSQRT.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 <alib/pair>
11#include <functional>
12
13namespace graph {
14
15namespace heuristic {
16
18// ---------------------------------------------------------------------------------------------------------------------
19
20 public:
21
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 (node.first - goal.first) * (node.first - goal.first) +
42 (node.second - goal.second) * (node.second - goal.second);
43}
44
45// ---------------------------------------------------------------------------------------------------------------------
46
47template<typename TCoordinate>
48std::function<double(const ext::pair<TCoordinate, TCoordinate> &,
49 const ext::pair<TCoordinate,
51 return euclideanDistanceNoSQRT < 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: EuclideanDistanceNoSQRT.hpp:17
static double euclideanDistanceNoSQRT(const ext::pair< TCoordinate, TCoordinate > &goal, const ext::pair< TCoordinate, TCoordinate > &node)
Definition: EuclideanDistanceNoSQRT.hpp:39
static std::function< double(const ext::pair< TCoordinate, TCoordinate > &, const ext::pair< TCoordinate, TCoordinate > &)> euclideanDistanceNoSQRTFunction()
Definition: EuclideanDistanceNoSQRT.hpp:50
Definition: ReconstructPath.hpp:14
Definition: Node.cpp:11