mlpack  1.0.12
ip_metric.hpp
Go to the documentation of this file.
1 
15 #ifndef __MLPACK_METHODS_FASTMKS_IP_METRIC_HPP
16 #define __MLPACK_METHODS_FASTMKS_IP_METRIC_HPP
17 
18 namespace mlpack {
19 namespace metric {
20 
21 template<typename KernelType>
22 class IPMetric
23 {
24  public:
26  IPMetric();
27 
29  IPMetric(KernelType& kernel);
30 
32  ~IPMetric();
33 
37  template<typename Vec1Type, typename Vec2Type>
38  double Evaluate(const Vec1Type& a, const Vec2Type& b);
39 
41  const KernelType& Kernel() const { return kernel; }
43  KernelType& Kernel() { return kernel; }
47  std::string ToString() const;
48  private:
50  KernelType* localKernel;
52  KernelType& kernel;
53 };
54 
55 }; // namespace metric
56 }; // namespace mlpack
57 
58 // Include implementation.
59 #include "ip_metric_impl.hpp"
60 
61 #endif
IPMetric()
Create the IPMetric without an instantiated kernel.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: load.hpp:23
const KernelType & Kernel() const
Get the kernel.
Definition: ip_metric.hpp:41
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:52
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:43
KernelType * localKernel
The locally stored kernel, if it is necessary.
Definition: ip_metric.hpp:50