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-2008 Soeren Sonnenburg 00008 * Written (W) 1999-2008 Gunnar Raetsch 00009 * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society 00010 */ 00011 00012 #ifndef __GUIDISTANCE_H__ 00013 #define __GUIDISTANCE_H__ 00014 00015 #include <shogun/lib/config.h> 00016 #include <shogun/base/SGObject.h> 00017 #include <shogun/distance/Distance.h> 00018 #include <shogun/features/Features.h> 00019 00020 namespace shogun 00021 { 00022 class CSGInterface; 00023 00025 class CGUIDistance : public CSGObject 00026 { 00027 public: 00029 CGUIDistance() {}; 00033 CGUIDistance(CSGInterface* interface); 00035 ~CGUIDistance(); 00036 00038 CDistance* get_distance(); 00040 bool set_distance(CDistance* dist); 00041 00043 CDistance* create_generic(EDistanceType type); 00045 CDistance* create_minkowski(float64_t k=3); 00047 CDistance* create_hammingword(bool use_sign=false); 00048 00050 bool init_distance(const char* target); 00054 bool save_distance(char* param); 00055 00057 bool is_initialized() { return initialized; } 00058 00060 inline virtual const char* get_name() const { return "GUIDistance"; } 00061 00062 protected: 00064 CDistance* distance; 00066 CSGInterface* ui; 00068 bool initialized; 00069 }; 00070 } 00071 #endif //__GUIDISTANCE_H__