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) 2007-2009 Christian Gehl 00008 * Copyright (C) 2007-2009 Fraunhofer Institute FIRST and Max-Planck-Society 00009 */ 00010 00011 #include "lib/config.h" 00012 00013 00014 #ifndef _DISTANCEKERNEL_H___ 00015 #define _DISTANCEKERNEL_H___ 00016 00017 #include "lib/common.h" 00018 #include "kernel/Kernel.h" 00019 #include "distance/Distance.h" 00020 00029 class CDistanceKernel: public CKernel 00030 { 00031 public: 00038 CDistanceKernel(int32_t cache, float64_t width, CDistance* dist); 00039 00047 CDistanceKernel( 00048 CFeatures *l, CFeatures *r, float64_t width, CDistance* dist); 00049 00050 virtual ~CDistanceKernel(); 00051 00058 virtual bool init(CFeatures* l, CFeatures* r); 00059 00064 inline virtual EKernelType get_kernel_type() { return K_DISTANCE; } 00069 inline virtual EFeatureType get_feature_type() { return distance->get_feature_type(); } 00070 00075 inline virtual EFeatureClass get_feature_class() { return distance->get_feature_class(); } 00076 00081 inline virtual const char* get_name() const { return distance->get_name(); } 00082 00088 bool load_init(FILE* src); 00089 00095 bool save_init(FILE* dest); 00096 00097 protected: 00106 float64_t compute(int32_t idx_a, int32_t idx_b); 00107 00108 private: 00110 CDistance* distance; 00112 float64_t width; 00113 }; 00114 00115 #endif /* _DISTANCEKERNEL_H__ */ 00116