SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DistantSegmentsKernel.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2011 Heiko Strathmann
8  * DS-Kernel implementation Written (W) 2008 S├ębastien Boisvert under GPLv3
9  * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
10  */
11 
12 #ifndef DISTANTSEGMENTSKERNEL_H_
13 #define DISTANTSEGMENTSKERNEL_H_
14 
15 #include <shogun/lib/config.h>
16 
18 
19 namespace shogun
20 {
21 
37 {
38 public:
41 
48  CDistantSegmentsKernel(int32_t size, int32_t delta, int32_t theta);
49 
59  int32_t size, int32_t delta, int32_t theta);
60 
67  virtual bool init(CFeatures* l, CFeatures* r);
68 
73  {
74  return K_DISTANTSEGMENTS;
75  }
76 
80  virtual const char* get_name() const
81  {
82  return "DistantSegmentsKernel";
83  }
84 
85 protected:
95  virtual float64_t compute(int32_t idx_a, int32_t idx_b);
96 
97 private:
99  void init();
100 
105  int32_t bin(int32_t j, int32_t i);
106 
120  int32_t compute(char* s, int32_t sLength, char* b, int32_t bLength,
121  int32_t delta_m, int32_t theta_m);
122 
123 protected:
125  int32_t m_delta;
126 
128  int32_t m_theta;
129 
130 
131 };
132 
133 }
134 
135 #endif /* DISTANTSEGMENTSKERNEL_H_ */

SHOGUN Machine Learning Toolbox - Documentation