DiagKernel.cpp

Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 3 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * Written (W) 1999-2009 Soeren Sonnenburg
00008  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
00009  */
00010 
00011 #include <shogun/lib/config.h>
00012 #include <shogun/lib/common.h>
00013 #include <shogun/io/SGIO.h>
00014 
00015 #include <shogun/base/Parameter.h>
00016 #include <shogun/kernel/DiagKernel.h>
00017 
00018 using namespace shogun;
00019 
00020 CDiagKernel::CDiagKernel()
00021 : CKernel()
00022 {
00023     init();
00024 }
00025 
00026 CDiagKernel::CDiagKernel(int32_t size, float64_t d)
00027 : CKernel(size)
00028 {
00029     init();
00030     diag=d;
00031 }
00032 
00033 CDiagKernel::CDiagKernel(CFeatures* l, CFeatures* r, float64_t d)
00034 : CKernel()
00035 {
00036     init();
00037     diag=d;
00038     init(l, r);
00039 }
00040 
00041 CDiagKernel::~CDiagKernel()
00042 {
00043 }
00044 
00045 bool CDiagKernel::init(CFeatures* l, CFeatures* r)
00046 {
00047     CKernel::init(l, r);
00048     return init_normalizer();
00049 }
00050 
00051 void CDiagKernel::init()
00052 {
00053     diag=1.0;
00054     m_parameters->add(&diag, "diag", "Value on kernel diagonal.");
00055 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation