SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DiagKernel.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/config.h>
12 #include <shogun/lib/common.h>
13 #include <shogun/io/SGIO.h>
14 
15 #include <shogun/base/Parameter.h>
17 
18 using namespace shogun;
19 
21 : CKernel()
22 {
23  init();
24 }
25 
27 : CKernel(size)
28 {
29  init();
30  diag=d;
31 }
32 
34 : CKernel()
35 {
36  init();
37  diag=d;
38  init(l, r);
39 }
40 
42 {
43 }
44 
45 bool CDiagKernel::init(CFeatures* l, CFeatures* r)
46 {
47  CKernel::init(l, r);
48  return init_normalizer();
49 }
50 
51 void CDiagKernel::init()
52 {
53  diag=1.0;
54  SG_ADD(&diag, "diag", "Value on kernel diagonal.", MS_AVAILABLE);
55 }

SHOGUN Machine Learning Toolbox - Documentation