MLPACK  1.0.10
lmetric.hpp
Go to the documentation of this file.
1 
25 #ifndef __MLPACK_CORE_METRICS_LMETRIC_HPP
26 #define __MLPACK_CORE_METRICS_LMETRIC_HPP
27 
28 #include <mlpack/core.hpp>
29 
30 namespace mlpack {
31 namespace metric {
32 
72 template<int Power, bool TakeRoot = true>
73 class LMetric
74 {
75  public:
76  /***
77  * Default constructor does nothing, but is required to satisfy the Kernel
78  * policy.
79  */
80  LMetric() { }
81 
85  template<typename VecType1, typename VecType2>
86  static double Evaluate(const VecType1& a, const VecType2& b);
87  std::string ToString() const;
88 };
89 
90 // Convenience typedefs.
91 
92 /***
93  * The Manhattan (L1) distance.
94  */
96 
97 /***
98  * The squared Euclidean (L2) distance.
99  */
101 
102 /***
103  * The Euclidean (L2) distance.
104  */
106 
107 /***
108  * The L-infinity distance
109  */
111 
112 
113 }; // namespace metric
114 }; // namespace mlpack
115 
116 // Include implementation.
117 #include "lmetric_impl.hpp"
118 
119 #endif