00001 // Copyright 2007, Massachusetts Institute of Technology. 00002 // The use of this code is permitted for research only. There is 00003 // absolutely no warranty for this software. 00004 // 00005 // Author: John Lee (jjl@mit.edu) 00006 // 00007 00008 #ifndef UTIL_DISTANCE_COMPUTER_H 00009 #define UTIL_DISTANCE_COMPUTER_H 00010 00011 #include "point_set/feature.h" 00012 00013 namespace libpmk { 00014 00016 class DistanceComputer { 00017 public: 00018 virtual ~DistanceComputer(); 00019 00021 virtual double ComputeDistance(const Feature& f1, 00022 const Feature& f2) const = 0; 00023 00025 00030 virtual double ComputeDistance(const Feature& f1, const Feature& f2, 00031 double max_distance) const; 00032 }; 00033 00035 class L1DistanceComputer : public DistanceComputer { 00036 public: 00037 virtual double ComputeDistance(const Feature& f1, const Feature& f2) const; 00038 virtual double ComputeDistance(const Feature& f1, const Feature& f2, 00039 double max_distance) const; 00040 00041 }; 00042 00044 class L2DistanceComputer : public DistanceComputer { 00045 public: 00046 virtual double ComputeDistance(const Feature& f1, const Feature& f2) const; 00047 virtual double ComputeDistance(const Feature& f1, const Feature& f2, 00048 double max_distance) const; 00049 00050 }; 00051 } // namespace libpmk 00052 #endif // UTIL_DISTANCE_COMPUTER_H