mlpack 3.4.2
ip_metric.hpp
Go to the documentation of this file.
1
13#ifndef MLPACK_METHODS_FASTMKS_IP_METRIC_HPP
14#define MLPACK_METHODS_FASTMKS_IP_METRIC_HPP
15
16namespace mlpack {
17namespace metric {
18
31template<typename KernelType>
33{
34 public:
37
39 IPMetric(KernelType& kernel);
40
43
45 IPMetric(const IPMetric& other);
46
48 IPMetric& operator=(const IPMetric& other);
49
59 template<typename VecTypeA, typename VecTypeB>
60 typename VecTypeA::elem_type Evaluate(const VecTypeA& a, const VecTypeB& b);
61
63 const KernelType& Kernel() const { return *kernel; }
65 KernelType& Kernel() { return *kernel; }
66
68 template<typename Archive>
69 void serialize(Archive& ar, const unsigned int version);
70
71 private:
73 KernelType* kernel;
75 bool kernelOwner;
76};
77
78} // namespace metric
79} // namespace mlpack
80
81// Include implementation.
82#include "ip_metric_impl.hpp"
83
84#endif
The inner product metric, IPMetric, takes a given Mercer kernel (KernelType), and when Evaluate() is ...
Definition: ip_metric.hpp:33
IPMetric(const IPMetric &other)
Copy the parameters of the given metric.
IPMetric()
Create the IPMetric without an instantiated kernel.
KernelType & Kernel()
Modify the kernel.
Definition: ip_metric.hpp:65
IPMetric & operator=(const IPMetric &other)
Assign this metric to be a copy of the given metric.
VecTypeA::elem_type Evaluate(const VecTypeA &a, const VecTypeB &b)
Evaluate the metric.
void serialize(Archive &ar, const unsigned int version)
Serialize the metric.
IPMetric(KernelType &kernel)
Create the IPMetric with an instantiated kernel.
const KernelType & Kernel() const
Get the kernel.
Definition: ip_metric.hpp:63
~IPMetric()
Destroy the IPMetric object.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1