ConstKernel.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/common.h>
00012 #include <shogun/io/SGIO.h>
00013 
00014 #include <shogun/base/Parameter.h>
00015 
00016 #include <shogun/kernel/ConstKernel.h>
00017 #include <shogun/features/Features.h>
00018 
00019 using namespace shogun;
00020 
00021 CConstKernel::CConstKernel()
00022 : CKernel()
00023 {
00024     init();
00025 }
00026 
00027 CConstKernel::CConstKernel(float64_t c)
00028 : CKernel()
00029 {
00030     init();
00031     const_value=c;
00032 }
00033 
00034 CConstKernel::CConstKernel(CFeatures* l, CFeatures* r, float64_t c)
00035 : CKernel()
00036 {
00037     init();
00038     const_value=c;
00039     init(l, r);
00040 }
00041 
00042 CConstKernel::~CConstKernel()
00043 {
00044 }
00045 
00046 bool CConstKernel::init(CFeatures* l, CFeatures* r)
00047 {
00048     CKernel::init(l, r);
00049     return init_normalizer();
00050 }
00051 
00052 void CConstKernel::init()
00053 {
00054     const_value=1.0;
00055     m_parameters->add(&const_value, "const_value", "Value for kernel elements.");
00056 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation