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 #ifndef _KERNEL_MACHINE_H__ 00012 #define _KERNEL_MACHINE_H__ 00013 00014 #include "lib/common.h" 00015 #include "kernel/Kernel.h" 00016 #include "features/Labels.h" 00017 #include "classifier/Classifier.h" 00018 00019 #include <stdio.h> 00020 00021 class CClassifier; 00022 00038 class CKernelMachine : public CClassifier 00039 { 00040 public: 00042 CKernelMachine(); 00043 00045 virtual ~CKernelMachine(); 00046 00051 inline void set_kernel(CKernel* k) 00052 { 00053 SG_UNREF(kernel); 00054 SG_REF(k); 00055 kernel=k; 00056 } 00057 00062 inline CKernel* get_kernel() 00063 { 00064 SG_REF(kernel); 00065 return kernel; 00066 } 00067 00072 inline void set_batch_computation_enabled(bool enable) 00073 { 00074 use_batch_computation=enable; 00075 } 00076 00081 inline bool get_batch_computation_enabled() 00082 { 00083 return use_batch_computation; 00084 } 00085 00090 inline void set_linadd_enabled(bool enable) 00091 { 00092 use_linadd=enable; 00093 } 00094 00099 inline bool get_linadd_enabled() 00100 { 00101 return use_linadd ; 00102 } 00103 00109 virtual CLabels* classify(CLabels* output=NULL); 00110 00111 protected: 00113 CKernel* kernel; 00115 bool use_batch_computation; 00117 bool use_linadd; 00118 }; 00119 00120 #endif /* _KERNEL_MACHINE_H__ */