InverseMultiQuadricKernel.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) 2011 Abhinav Maurya
00008  * Copyright (C) 2007-2011 Fraunhofer Institute FIRST and Max-Planck-Society
00009  * Copyright (C) 2011 Indian Institute of Technology Bombay
00010  */
00011 
00012 #include <shogun/lib/config.h>
00013 
00014 #ifndef INVERSEMULTIQUADRIC_H_
00015 #define INVERSEMULTIQUADRIC_H_
00016 
00017 #include <shogun/lib/common.h>
00018 #include <shogun/kernel/Kernel.h>
00019 #include <shogun/distance/Distance.h>
00020 
00021 namespace shogun
00022 {
00023 
00024 class CDistance;
00032 class CInverseMultiQuadricKernel: public CKernel
00033 {
00034 public:
00036     CInverseMultiQuadricKernel();
00037 
00043     CInverseMultiQuadricKernel(int32_t cache, float64_t coef, CDistance* dist);
00044 
00051     CInverseMultiQuadricKernel(CFeatures *l, CFeatures *r, float64_t coef, CDistance* dist);
00052 
00058     virtual bool init(CFeatures* l, CFeatures* r);
00059 
00063     inline virtual EKernelType get_kernel_type() { return K_INVERSEMULTIQUADRIC; }
00064 
00068     inline virtual EFeatureType get_feature_type() { return distance->get_feature_type(); }
00069 
00073     inline virtual EFeatureClass get_feature_class() { return distance->get_feature_class(); }
00074 
00078     inline virtual const char* get_name() const { return "InverseMultiQuadricKernel"; }
00079 
00083     inline float64_t get_coef() { return this->coef; }
00084 
00088     inline void set_coef(float64_t value) { this->coef = value; }
00089 
00090     virtual ~CInverseMultiQuadricKernel();
00091 
00092 protected:
00093 
00096     CDistance* distance;
00097 
00100     float64_t coef;
00101 
00109     virtual float64_t compute(int32_t idx_a, int32_t idx_b);
00110 
00119     virtual void load_serializable_post(void) throw (ShogunException);
00120 
00121 private:
00122 
00123     void init();
00124 };
00125 
00126 }
00127 
00128 #endif /* INVERSEMULTIQUADRIC_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation