mlpack  master
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 
78 {
79  public:
87 
101  template<typename VecTypeA, typename VecTypeB>
102  static double Evaluate(const VecTypeA& /* a */, const VecTypeB& /* b */)
103  { return 0; }
104 
109  template<typename Archive>
110  void Serialize(Archive& /* ar */, const unsigned int /* version */) { }
111 
126  template<typename VecTypeA, typename VecTypeB>
127  static double ConvolutionIntegral(const VecTypeA& /* a */,
128  const VecTypeB& /* b */) { return 0; }
129 
140  static double Normalizer() { return 0; }
141 
142  // Modified to remove unused variable "dimension"
143  //static double Normalizer(size_t dimension=1) { return 0; }
144 };
145 
146 } // namespace kernel
147 } // namespace mlpack
148 
149 #endif
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.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: binarize.hpp:18
The core includes that mlpack expects; standard C++ includes and Armadillo.
An example kernel function.
static double Normalizer()
Obtains the normalizing volume for the kernel with dimension $dimension$.
ExampleKernel()
The default constructor, which takes no parameters.
void Serialize(Archive &, const unsigned int)
Serializes the kernel.