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 
19 namespace mlpack {
20 namespace 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 uint32_t /* version */) { }
61 };
62 
63 } // namespace kernel
64 } // namespace mlpack
65 
66 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
The simple linear kernel (dot product).
The core includes that mlpack expects; standard C++ includes and Armadillo.
void serialize(Archive &, const uint32_t)
Serialize the kernel (it has no members... do nothing).
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.