MLPACK  1.0.8
pspectrum_string_kernel.hpp
Go to the documentation of this file.
1 
26 #ifndef __MLPACK_CORE_KERNELS_PSPECTRUM_STRING_KERNEL_HPP
27 #define __MLPACK_CORE_KERNELS_PSPECTRUM_STRING_KERNEL_HPP
28 
29 #include <map>
30 #include <string>
31 #include <vector>
32 
33 #include <mlpack/core.hpp>
34 
35 namespace mlpack {
36 namespace kernel {
37 
75 {
76  public:
84  PSpectrumStringKernel(const std::vector<std::vector<std::string> >& datasets,
85  const size_t p);
86 
98  template<typename VecType>
99  double Evaluate(const VecType& a, const VecType& b) const;
100 
102  const std::vector<std::vector<std::map<std::string, int> > >& Counts() const
103  { return counts; }
105  std::vector<std::vector<std::map<std::string, int> > >& Counts()
106  { return counts; }
107 
109  size_t P() const { return p; }
111  size_t& P() { return p; }
112 
113  private:
115  const std::vector<std::vector<std::string> >& datasets;
116 
119  std::vector<std::vector<std::map<std::string, int> > > counts;
120 
122  size_t p;
123 };
124 
125 }; // namespace kernel
126 }; // namespace mlpack
127 
128 // Include implementation of templated Evaluate().
129 #include "pspectrum_string_kernel_impl.hpp"
130 
131 #endif