16 #ifndef MLPACK_CORE_KERNELS_PSPECTRUM_STRING_KERNEL_IMPL_HPP 17 #define MLPACK_CORE_KERNELS_PSPECTRUM_STRING_KERNEL_IMPL_HPP 35 template<
typename VecType>
37 const VecType& b)
const 40 const std::map<std::string, int>& aMap = counts[a[0]][a[1]];
41 const std::map<std::string, int>& bMap = counts[b[0]][b[1]];
47 std::map<std::string, int>::const_iterator aIt = aMap.begin();
48 std::map<std::string, int>::const_iterator bIt = bMap.begin();
50 while ((aIt != aMap.end()) && (bIt != bMap.end()))
53 int result = (*aIt).first.compare((*bIt).first);
57 eval += ((*aIt).second * (*bIt).second);
double Evaluate(const VecType &a, const VecType &b) const
Evaluate the kernel for the string indices given.
Definition: pspectrum_string_kernel_impl.hpp:36
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1