SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LinearStringKernel.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) 1999-2009 Soeren Sonnenburg
8  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #ifndef _LINEARSTRINGKERNEL_H___
12 #define _LINEARSTRINGKERNEL_H___
13 
14 #include <shogun/lib/config.h>
15 
16 #include <shogun/lib/common.h>
18 
19 namespace shogun
20 {
32 {
33  public:
37 
44 
45  virtual ~CLinearStringKernel();
46 
53  virtual bool init(CFeatures* l, CFeatures* r);
54 
56  virtual void cleanup();
57 
63  {
64  return K_LINEAR;
65  }
66 
71  virtual const char* get_name() const { return "LinearStringKernel"; }
72 
81  virtual bool init_optimization(
82  int32_t num_suppvec, int32_t* sv_idx, float64_t* alphas);
83 
88  virtual bool delete_optimization();
89 
95  virtual float64_t compute_optimized(int32_t idx);
96 
98  virtual void clear_normal();
99 
105  virtual void add_to_normal(int32_t idx, float64_t weight);
106 
107  protected:
116  virtual float64_t compute(int32_t idx_a, int32_t idx_b);
117 
118  protected:
121 };
122 }
123 #endif /* _LINEARSTRINGKERNEL_H___ */

SHOGUN Machine Learning Toolbox - Documentation