MLPACK  1.0.10
ip_metric.hpp
Go to the documentation of this file.
1 
23 #ifndef __MLPACK_METHODS_FASTMKS_IP_METRIC_HPP
24 #define __MLPACK_METHODS_FASTMKS_IP_METRIC_HPP
25 
26 namespace mlpack {
27 namespace metric {
28 
29 template<typename KernelType>
30 class IPMetric
31 {
32  public:
34  IPMetric();
35 
37  IPMetric(KernelType& kernel);
38 
40  ~IPMetric();
41 
45  template<typename Vec1Type, typename Vec2Type>
46  double Evaluate(const Vec1Type& a, const Vec2Type& b);
47 
49  const KernelType& Kernel() const { return kernel; }
51  KernelType& Kernel() { return kernel; }
55  std::string ToString() const;
56  private:
58  KernelType* localKernel;
60  KernelType& kernel;
61 };
62 
63 }; // namespace metric
64 }; // namespace mlpack
65 
66 // Include implementation.
67 #include "ip_metric_impl.hpp"
68 
69 #endif
IPMetric()
Create the IPMetric without an instantiated kernel.
const KernelType & Kernel() const
Get the kernel.
Definition: ip_metric.hpp:49
double Evaluate(const Vec1Type &a, const Vec2Type &b)
Evaluate the metric.
KernelType & kernel
The reference to the kernel that is being used.
Definition: ip_metric.hpp:60
std::string ToString() const
Returns a string representation of this object.
~IPMetric()
Destroy the IPMetric object.
KernelType & Kernel()
Modify the kernel.
Definition: ip_metric.hpp:51
KernelType * localKernel
The locally stored kernel, if it is necessary.
Definition: ip_metric.hpp:58