example_kernel.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_CORE_KERNELS_EXAMPLE_KERNEL_HPP
14 #define MLPACK_CORE_KERNELS_EXAMPLE_KERNEL_HPP
15 
16 #include <mlpack/prereqs.hpp>
17 
18 namespace mlpack {
19 
37 namespace kernel {
38 
77 {
78  public:
86 
100  template<typename VecTypeA, typename VecTypeB>
101  static double Evaluate(const VecTypeA& /* a */, const VecTypeB& /* b */)
102  { return 0; }
103 
108  template<typename Archive>
109  void serialize(Archive& /* ar */, const uint32_t /* version */) { }
110 
125  template<typename VecTypeA, typename VecTypeB>
126  static double ConvolutionIntegral(const VecTypeA& /* a */,
127  const VecTypeB& /* b */) { return 0; }
128 
138  static double Normalizer() { return 0; }
139 
140  // Modified to remove unused variable "dimension"
141  // static double Normalizer(size_t dimension=1) { return 0; }
142 };
143 
144 } // namespace kernel
145 } // namespace mlpack
146 
147 #endif
static double Normalizer()
Obtains the normalizing volume for the kernel with dimension $dimension$.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
ExampleKernel()
The default constructor, which takes no parameters.
An example kernel function.
static double Evaluate(const VecTypeA &, const VecTypeB &)
Evaluates the kernel function for two given vectors.
static double ConvolutionIntegral(const VecTypeA &, const VecTypeB &)
Obtains the convolution integral [integral K(||x-a||)K(||b-x||)dx] for the two vectors.
void serialize(Archive &, const uint32_t)
Serializes the kernel.