mlpack  1.0.12
linear_kernel.hpp
Go to the documentation of this file.
1 
16 #ifndef __MLPACK_CORE_KERNELS_LINEAR_KERNEL_HPP
17 #define __MLPACK_CORE_KERNELS_LINEAR_KERNEL_HPP
18 
19 #include <mlpack/core.hpp>
20 
21 namespace mlpack {
22 namespace kernel {
23 
35 {
36  public:
42 
52  template<typename VecType>
53  static double Evaluate(const VecType& a, const VecType& b)
54  {
55  return arma::dot(a, b);
56  }
57 
59  std::string ToString() const
60  {
61  std::ostringstream convert;
62  convert << "LinearKernel [" << this << "]" << std::endl;
63  return convert.str();
64  }
65 };
66 
67 }; // namespace kernel
68 }; // namespace mlpack
69 
70 #endif
LinearKernel()
This constructor does nothing; the linear kernel has no parameters to store.
static double Evaluate(const VecType &a, const VecType &b)
Simple evaluation of the dot product.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: load.hpp:23
std::string ToString() const
Return a string representation of the kernel.
The simple linear kernel (dot product).