00001 #ifndef Impala_Core_Vector_MinimumSimilarity_h
00002 #define Impala_Core_Vector_MinimumSimilarity_h
00003
00004 #include "Core/Vector/VectorSet.h"
00005
00006 namespace Impala
00007 {
00008 namespace Core
00009 {
00010 namespace Vector
00011 {
00012
00013
00014 template <class ArrayT, class SimFtorT>
00015 inline Real64
00016 MinimumSimilarity(typename VectorSet<ArrayT>::VectorT example,
00017 VectorSet<ArrayT>* src, int end, SimFtorT simFunc)
00018 {
00019 Real64 minSim = simFunc.DoIt(example, src->GetVector(0, true));
00020 for (int i=1 ; i<end ; i++)
00021 {
00022 Real64 sim = simFunc.DoIt(example, src->GetVector(i, true));
00023 if (sim < minSim)
00024 minSim = sim;
00025 }
00026 return minSim;
00027 }
00028
00029 }
00030 }
00031 }
00032
00033 #endif