SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConstKernel.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 _CONSTKERNEL_H___
12 #define _CONSTKERNEL_H___
13 
14 #include <shogun/lib/config.h>
15 
17 #include <shogun/lib/common.h>
18 #include <shogun/kernel/Kernel.h>
20 
21 namespace shogun
22 {
29 class CConstKernel: public CKernel
30 {
31  public:
33  CConstKernel();
34 
40 
48 
49  virtual ~CConstKernel();
50 
57  virtual bool init(CFeatures* l, CFeatures* r);
58 
63  virtual EKernelType get_kernel_type() { return K_CONST; }
64 
70  {
71  return F_ANY;
72  }
73 
79  {
80  return C_ANY;
81  }
82 
87  virtual const char* get_name() const { return "ConstKernel"; }
88 
89  protected:
96  virtual float64_t compute(int32_t row, int32_t col)
97  {
98  return const_value;
99  }
100 
101  private:
102  void init();
103 
104  protected:
107 };
108 }
109 #endif /* _CONSTKERNEL_H__ */

SHOGUN Machine Learning Toolbox - Documentation