mlpack 3.4.2
linear_kernel.hpp
Go to the documentation of this file.
1
14#ifndef MLPACK_CORE_KERNELS_LINEAR_KERNEL_HPP
15#define MLPACK_CORE_KERNELS_LINEAR_KERNEL_HPP
16
17#include <mlpack/prereqs.hpp>
18
19namespace mlpack {
20namespace kernel {
21
33{
34 public:
40
52 template<typename VecTypeA, typename VecTypeB>
53 static double Evaluate(const VecTypeA& a, const VecTypeB& b)
54 {
55 return arma::dot(a, b);
56 }
57
59 template<typename Archive>
60 void serialize(Archive& /* ar */, const unsigned int /* version */) { }
61};
62
63} // namespace kernel
64} // namespace mlpack
65
66#endif
The simple linear kernel (dot product).
LinearKernel()
This constructor does nothing; the linear kernel has no parameters to store.
static double Evaluate(const VecTypeA &a, const VecTypeB &b)
Simple evaluation of the dot product.
void serialize(Archive &, const unsigned int)
Serialize the kernel (it has no members... do nothing).
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.