mlpack 3.4.2
Loading...
Searching...
No Matches
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
18namespace mlpack {
19
37namespace 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 unsigned int /* 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
An example kernel function.
static double Normalizer()
Obtains the normalizing volume for the kernel with dimension $dimension$.
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 unsigned int)
Serializes the kernel.
static double Evaluate(const VecTypeA &, const VecTypeB &)
Evaluates the kernel function for two given vectors.
ExampleKernel()
The default constructor, which takes no parameters.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.