Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef ECOCUTIL_H__
00012 #define ECOCUTIL_H__
00013
00014 #include <shogun/mathematics/Math.h>
00015
00016 namespace shogun
00017 {
00018
00020 class CECOCUtil
00021 {
00022 public:
00028 template<typename T1, typename T2>
00029 static int32_t hamming_distance(T1 *c1, T2 *c2, int32_t len)
00030 {
00031 int32_t dist = 0;
00032 for (int32_t i=0; i < len; ++i)
00033 dist += static_cast<int32_t>(CMath::abs((c1[i]-c2[i])));
00034 return dist/2;
00035 }
00036 };
00037
00038 }
00039
00040 #endif
00041