PolyKernel.h

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-2010 Soeren Sonnenburg
00008  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
00009  * Copyright (C) 2010 Berlin Institute of Technology
00010  */
00011 
00012 #ifndef _POLYKERNEL_H___
00013 #define _POLYKERNEL_H___
00014 
00015 #include "lib/common.h"
00016 #include "kernel/DotKernel.h"
00017 #include "features/DotFeatures.h"
00018 
00019 namespace shogun
00020 {
00021     class CDotFeatures;
00022 
00036 class CPolyKernel: public CDotKernel
00037 {
00038     void init(void);
00039 
00040     public:
00042         CPolyKernel(void);
00043 
00052         CPolyKernel(CDotFeatures* l, CDotFeatures* r,
00053             int32_t d, bool inhom, int32_t size=10);
00054 
00061         CPolyKernel(int32_t size, int32_t degree, bool inhomogene=true);
00062 
00063         virtual ~CPolyKernel();
00064 
00071         virtual bool init(CFeatures* l, CFeatures* r);
00072 
00074         virtual void cleanup();
00075 
00080         virtual EKernelType get_kernel_type() { return K_POLY; }
00081 
00086         virtual const char* get_name() const { return "PolyKernel"; };
00087 
00088     protected:
00097         virtual float64_t compute(int32_t idx_a, int32_t idx_b);
00098 
00099     protected:
00101         int32_t degree;
00103         bool inhomogene;
00104 };
00105 }
00106 #endif /* _POLYKERNEL_H__ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation