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 _REALDISTANCE_H__ 00012 #define _REALDISTANCE_H__ 00013 00014 #include <shogun/distance/SimpleDistance.h> 00015 #include <shogun/lib/common.h> 00016 00017 namespace shogun 00018 { 00020 class CRealDistance : public CSimpleDistance<float64_t> 00021 { 00022 public: 00024 CRealDistance() : CSimpleDistance<float64_t>() {} 00025 00032 virtual bool init(CFeatures* l, CFeatures* r) 00033 { 00034 CSimpleDistance<float64_t>::init(l,r); 00035 00036 ASSERT(l->get_feature_type()==F_DREAL); 00037 ASSERT(r->get_feature_type()==F_DREAL); 00038 00039 return true; 00040 } 00041 00046 inline virtual EFeatureType get_feature_type() { return F_DREAL; } 00047 00053 virtual const char* get_name() const { return "RealDistance"; } 00054 00059 virtual void cleanup()=0; 00060 00067 virtual EDistanceType get_distance_type()=0 ; 00068 00069 protected: 00073 virtual float64_t compute(int32_t x, int32_t y)=0; 00074 }; 00075 } // namespace shogun 00076 #endif