cheshirekow  v0.1.0
Distance.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Josh Bialkowski (jbialk@mit.edu)
3  *
4  * This file is part of mpblocks.
5  *
6  * mpblocks is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * mpblocks is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with mpblocks. If not, see <http://www.gnu.org/licenses/>.
18  */
27 #ifndef MPBLOCKS_KD_TREE_EUCLIDEAN_DISTANCE_H_
28 #define MPBLOCKS_KD_TREE_EUCLIDEAN_DISTANCE_H_
29 
30 
31 
32 namespace mpblocks {
33 namespace kd_tree {
34 namespace euclidean {
35 
37 template <class Traits>
38 class Distance
39 {
40  public:
41  typedef typename Traits::Format_t Format_t;
42  typedef Eigen::Matrix<Format_t,Traits::NDim,1> Point_t;
44 
45  public:
47  Format_t operator()( const Point_t& pa, const Point_t& pb );
48 
50  Format_t operator()( const Point_t& p, const Hyper_t& h );
51 };
52 
53 
54 
55 } // namespace eucliean
56 } // namespace kd_tree
57 } // namespace mpblocks
58 
59 
60 
61 #endif // DEFAULTDISTANCE_H_
provides euclidean distance computation
Definition: Distance.h:38
Format_t operator()(const Point_t &pa, const Point_t &pb)
return the euclidean distance between two points
Definition: Distance.hpp:38
Eigen::Matrix< Format_t, Traits::NDim, 1 > Point_t
Definition: Distance.h:42
double Format_t
number format (i.e. double, float)
Definition: Traits.h:38
an NDim dimensional hyperrectangle, represented as a min and max extent
Definition: HyperRect.h:23