SHOGUN
v3.2.0
|
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) 2012-2013 Heiko Strathmann 00008 */ 00009 00010 #ifndef __KERNELTWOSAMPLETESTSTATISTIC_H_ 00011 #define __KERNELTWOSAMPLETESTSTATISTIC_H_ 00012 00013 #include <shogun/statistics/TwoDistributionsTestStatistic.h> 00014 #include <shogun/kernel/Kernel.h> 00015 00016 namespace shogun 00017 { 00018 00019 class CFeatures; 00020 class CKernel; 00021 00034 class CKernelTwoSampleTestStatistic : public CTwoDistributionsTestStatistic 00035 { 00036 public: 00037 CKernelTwoSampleTestStatistic(); 00038 00049 CKernelTwoSampleTestStatistic(CKernel* kernel, CFeatures* p_and_q, 00050 index_t q_start); 00051 00063 CKernelTwoSampleTestStatistic(CKernel* kernel, CFeatures* p, 00064 CFeatures* q); 00065 00066 virtual ~CKernelTwoSampleTestStatistic(); 00067 00071 inline virtual void set_kernel(CKernel* kernel) 00072 { 00073 /* ref before unref to prevent deleting in case objects are the same */ 00074 SG_REF(kernel); 00075 SG_UNREF(m_kernel); 00076 m_kernel=kernel; 00077 } 00078 00080 inline virtual CKernel* get_kernel() 00081 { 00082 SG_REF(m_kernel); 00083 return m_kernel; 00084 } 00085 00093 virtual SGVector<float64_t> bootstrap_null(); 00094 00102 virtual SGVector<float64_t> compute_statistic( 00103 bool multiple_kernels)=0; 00104 00106 virtual float64_t compute_statistic()=0; 00107 00108 virtual const char* get_name() const=0; 00109 00110 private: 00111 void init(); 00112 00113 protected: 00115 CKernel* m_kernel; 00116 }; 00117 00118 } 00119 00120 #endif /* __KERNELTWOSAMPLETESTSTATISTIC_H_ */