SHOGUN  v3.0.0
 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 
16 
17 namespace shogun
18 {
19 
35 {
36 public:
39 
46  CDistantSegmentsKernel(int32_t size, int32_t delta, int32_t theta);
47 
57  int32_t size, int32_t delta, int32_t theta);
58 
65  virtual bool init(CFeatures* l, CFeatures* r);
66 
71  {
72  return K_DISTANTSEGMENTS;
73  }
74 
78  virtual const char* get_name() const
79  {
80  return "DistantSegmentsKernel";
81  }
82 
83 protected:
93  virtual float64_t compute(int32_t idx_a, int32_t idx_b);
94 
95 private:
97  void init();
98 
103  int32_t bin(int32_t j, int32_t i);
104 
118  int32_t compute(char* s, int32_t sLength, char* b, int32_t bLength,
119  int32_t delta_m, int32_t theta_m);
120 
121 protected:
123  int32_t m_delta;
124 
126  int32_t m_theta;
127 
128 
129 };
130 
131 }
132 
133 #endif /* DISTANTSEGMENTSKERNEL_H_ */

SHOGUN Machine Learning Toolbox - Documentation