SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConstKernel.cpp
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 #include <shogun/lib/common.h>
12 #include <shogun/io/SGIO.h>
13 
14 #include <shogun/base/Parameter.h>
15 
18 
19 using namespace shogun;
20 
22 : CKernel()
23 {
24  init();
25 }
26 
28 : CKernel()
29 {
30  init();
31  const_value=c;
32 }
33 
35 : CKernel()
36 {
37  init();
38  const_value=c;
39  init(l, r);
40 }
41 
43 {
44 }
45 
46 bool CConstKernel::init(CFeatures* l, CFeatures* r)
47 {
48  CKernel::init(l, r);
49  return init_normalizer();
50 }
51 
52 void CConstKernel::init()
53 {
54  const_value=1.0;
55  SG_ADD(&const_value, "const_value", "Value for kernel elements.",
56  MS_AVAILABLE);
57 }

SHOGUN Machine Learning Toolbox - Documentation