SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LinearARDKernel.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  * (W) 2012 Jacob Walker
8  *
9  * Adapted from WeightedDegreeRBFKernel.h
10  */
11 
12 #ifndef LINEARARDKERNEL_H_
13 #define LINEARARDKERNEL_H_
14 
15 #include <shogun/lib/config.h>
16 
17 #include <shogun/lib/common.h>
20 
21 namespace shogun
22 {
23 
26 {
27 public:
30 
35  CLinearARDKernel(int32_t size);
36 
44  int32_t size=10);
45 
46  virtual ~CLinearARDKernel();
47 
54  virtual bool init(CFeatures* l, CFeatures* r);
55 
60  virtual EKernelType get_kernel_type() { return K_LINEARARD; }
61 
66  virtual const char* get_name() const { return "LinearARDKernel"; }
67 
72  virtual EFeatureClass get_feature_class() { return C_DENSE; }
73 
78  virtual EFeatureType get_feature_type() { return F_DREAL; }
79 
85  virtual void set_weight(float64_t w, index_t i);
86 
93  virtual float64_t get_weight(index_t i);
94 
97 
102  virtual void set_weights(SGVector<float64_t> weights) { m_weights=weights; }
103 
104 protected:
113  virtual float64_t compute(int32_t idx_a, int32_t idx_b);
114 
119  void init_ft_weights();
120 
129  index_t index=-1);
130 
131 private:
132  void init();
133 
134 protected:
137 };
138 }
139 #endif /* LINEARARDKERNEL_H_ */

SHOGUN Machine Learning Toolbox - Documentation