yat
0.8.3pre
|
00001 #ifndef _theplu_yat_classifier_kernel_function_ 00002 #define _theplu_yat_classifier_kernel_function_ 00003 00004 // $Id: KernelFunction.h 2119 2009-12-12 23:11:43Z peter $ 00005 00006 /* 00007 Copyright (C) 2003 Peter Johansson 00008 Copyright (C) 2004 Jari Häkkinen, Peter Johansson 00009 Copyright (C) 2005 Peter Johansson 00010 Copyright (C) 2006, 2007, 2008 Jari Häkkinen, Peter Johansson 00011 00012 This file is part of the yat library, http://dev.thep.lu.se/yat 00013 00014 The yat library is free software; you can redistribute it and/or 00015 modify it under the terms of the GNU General Public License as 00016 published by the Free Software Foundation; either version 3 of the 00017 License, or (at your option) any later version. 00018 00019 The yat library is distributed in the hope that it will be useful, 00020 but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00022 General Public License for more details. 00023 00024 You should have received a copy of the GNU General Public License 00025 along with yat. If not, see <http://www.gnu.org/licenses/>. 00026 */ 00027 00028 namespace theplu { 00029 namespace yat { 00030 namespace classifier { 00031 class DataLookup1D; 00032 class DataLookupWeighted1D; 00033 00037 class KernelFunction 00038 { 00039 00040 public: 00044 KernelFunction(void) {}; 00045 00049 virtual ~KernelFunction(void) {}; 00050 00054 virtual double operator()(const DataLookup1D&, 00055 const DataLookup1D&) const = 0; 00056 00060 virtual double operator()(const DataLookup1D&, 00061 const DataLookupWeighted1D&) const = 0; 00062 00066 inline double operator()(const DataLookupWeighted1D& vec_w, 00067 const DataLookup1D& vec) const 00068 { return this->operator()(vec,vec_w); } 00069 00073 virtual double operator()(const DataLookupWeighted1D&, 00074 const DataLookupWeighted1D&) const = 0; 00075 00076 }; // class KernelFunction 00077 00078 }}} // of namespace classifier, yat, and theplu 00079 00080 #endif