Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

AverageSimilarity.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Vector_AverageSimilarity_h
00002 #define Impala_Core_Vector_AverageSimilarity_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 AverageSimilarity(typename VectorSet<ArrayT>::VectorT example,
00017                   VectorSet<ArrayT>* src, int end, SimFtorT simFunc)
00018 {
00019     Real64 totSim = 0;
00020     for (int i=0 ; i<end ; i++)
00021     {
00022         Real64 sim = simFunc.DoIt(example, src->GetVector(i, true));
00023         totSim += sim;
00024     }
00025     return totSim / end;
00026 }
00027 
00028 } // namespace Vector
00029 } // namespace Core
00030 } // namespace Impala
00031 
00032 #endif

Generated on Fri Mar 19 09:31:27 2010 for ImpalaSrc by  doxygen 1.5.1