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_R2_S1_DISTANCE_H_
28 #define MPBLOCKS_KD_TREE_R2_S1_DISTANCE_H_
29 
30 
31 
32 namespace mpblocks {
33 namespace kd_tree {
34 namespace r2_s1 {
35 
37 template <class Traits>
38 class Distance
39 {
40  public:
41  typedef typename Traits::Format_t Format_t;
42  typedef typename Traits::HyperRect Hyper_t;
43 
44  typedef Eigen::Matrix<Format_t,Traits::NDim,1> Point_t;
45 
46  private:
50 
51  public:
52  // default is [0,1] with weight of 1.0
53  Distance();
54 
55  Distance(Format_t min, Format_t max, Format_t weight );
56  void configure(Format_t min, Format_t max, Format_t weight );
57 
59  Format_t operator()( const Point_t& pa, const Point_t& pb );
60 
62  Format_t operator()( const Point_t& p, const Hyper_t& h );
63 };
64 
65 
66 
67 } // namespace eucliean
68 } // namespace kd_tree
69 } // namespace mpblocks
70 
71 
72 
73 #endif // DEFAULTDISTANCE_H_
Format_t m_max
max interval
Definition: Distance.h:48
Format_t m_weight
weight of s1 in group metric,
Definition: Distance.h:49
provides r2_s1 distance computation
Definition: Distance.h:38
Eigen::Matrix< Format_t, Traits::NDim, 1 > Point_t
Definition: Distance.h:44
void configure(Format_t min, Format_t max, Format_t weight)
Definition: Distance.hpp:51
double Format_t
number format (i.e. double, float)
Definition: Traits.h:38
Format_t operator()(const Point_t &pa, const Point_t &pb)
return the r2_s1 distance between two points
Definition: Distance.hpp:63
Format_t m_min
min interval
Definition: Distance.h:47
an NDim dimensional hyperrectangle, represented as a min and max extent
Definition: HyperRect.h:23