SHOGUN  5.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
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__ */
EKernelType
Definition: Kernel.h:57
EFeatureClass
shogun feature class
Definition: FeatureTypes.h:38
virtual EFeatureClass get_feature_class()
Definition: ConstKernel.h:78
The Constant Kernel returns a constant for all elements.
Definition: ConstKernel.h:29
double float64_t
Definition: common.h:50
virtual bool init(CFeatures *l, CFeatures *r)
Definition: ConstKernel.cpp:46
virtual EFeatureType get_feature_type()
Definition: ConstKernel.h:69
EFeatureType
shogun feature type
Definition: FeatureTypes.h:19
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual const char * get_name() const
Definition: ConstKernel.h:87
virtual EKernelType get_kernel_type()
Definition: ConstKernel.h:63
The class Features is the base class of all feature objects.
Definition: Features.h:68
The Kernel base class.
Definition: Kernel.h:159
virtual float64_t compute(int32_t row, int32_t col)
Definition: ConstKernel.h:96

SHOGUN Machine Learning Toolbox - Documentation