00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef HISTOGRAMDISTANCES_H_
00024 #define HISTOGRAMDISTANCES_H_
00025
00026 #include <vector>
00027 #include <cmath>
00028
00035 template<class Numeric>
00036 class HistogramDistance{
00037 public:
00039 virtual double distance(const std::vector<Numeric>& first, const std::vector<Numeric>& last) const = 0;
00040
00042 virtual double distance(const std::vector< std::vector<Numeric> >& first, const std::vector< std::vector<Numeric> >& last) const;
00043 };
00044
00052 template<class Numeric>
00053 class EuclideanDistance: public HistogramDistance<Numeric>{
00054 public:
00055 virtual double distance(const std::vector<Numeric>& first, const std::vector<Numeric>& last) const;
00056 virtual double distance(const std::vector< std::vector<Numeric> >& first, const std::vector< std::vector<Numeric> >& last) const;
00057 };
00058
00065 template<class Numeric>
00066 class Chi2Distance: public HistogramDistance<Numeric>{
00067 public:
00068 virtual double distance(const std::vector<Numeric>& first, const std::vector<Numeric>& last) const;
00069 };
00070
00078 template<class Numeric>
00079 class SymmetricChi2Distance: public HistogramDistance<Numeric>{
00080 public:
00081 virtual double distance(const std::vector<Numeric>& first, const std::vector<Numeric>& last) const;
00082 };
00083
00090 template<class Numeric>
00091 class BatthacharyyaDistance: public HistogramDistance<Numeric>{
00092 public:
00093 virtual double distance(const std::vector<Numeric>& first, const std::vector<Numeric>& last) const;
00094 virtual double distance(const std::vector< std::vector<Numeric> >& first, const std::vector< std::vector<Numeric> >& last) const;
00095 };
00096
00103 template<class Numeric>
00104 class KullbackLeiblerDistance: public HistogramDistance<Numeric>{
00105 public:
00106 virtual double distance(const std::vector<Numeric>& first, const std::vector<Numeric>& last) const;
00107 };
00108
00116 template<class Numeric>
00117 class JensenShannonDistance: public HistogramDistance<Numeric>{
00118 public:
00119 virtual double distance(const std::vector<Numeric>& first, const std::vector<Numeric>& last) const;
00120 };
00121
00122 #include <utils/HistogramDistances.hpp>
00123
00124 #endif