MLPACK
1.0.4
|
00001 00026 #ifndef __MLPACK_CORE_KERNELS_PSPECTRUM_STRING_KERNEL_HPP 00027 #define __MLPACK_CORE_KERNELS_PSPECTRUM_STRING_KERNEL_HPP 00028 00029 #include <map> 00030 #include <string> 00031 #include <vector> 00032 00033 #include <mlpack/core.hpp> 00034 00035 namespace mlpack { 00036 namespace kernel { 00037 00074 class PSpectrumStringKernel 00075 { 00076 public: 00084 PSpectrumStringKernel(const std::vector<std::vector<std::string> >& datasets, 00085 const size_t p); 00086 00098 template<typename VecType> 00099 double Evaluate(const VecType& a, const VecType& b) const; 00100 00102 const std::vector<std::vector<std::map<std::string, int> > >& Counts() const 00103 { return counts; } 00105 std::vector<std::vector<std::map<std::string, int> > >& Counts() 00106 { return counts; } 00107 00109 size_t P() const { return p; } 00111 size_t& P() { return p; } 00112 00113 private: 00115 const std::vector<std::vector<std::string> >& datasets; 00116 00119 std::vector<std::vector<std::map<std::string, int> > > counts; 00120 00122 size_t p; 00123 }; 00124 00125 }; // namespace kernel 00126 }; // namespace mlpack 00127 00128 // Include implementation of templated Evaluate(). 00129 #include "pspectrum_string_kernel_impl.hpp" 00130 00131 #endif