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

template<class ElemT>
ElemT Impala::Core::Vector::KullbackDivergence ( const VectorTem< ElemT > &  v1,
const VectorTem< ElemT > &  v2 
) [inline]

KL(v1||v2).

Definition at line 16 of file KullbackDivergence.h.

References Impala::Core::Vector::VectorTem< ElemT >::Size().

00017 {
00018     ElemT score = 0;
00019     for (int i=0 ; i<v1.Size() ; i++)
00020         if((v2[i]!=0)&&(v1[i]!=0))
00021             score += v1[i]*log(v1[i]/v2[i]);
00022     return score;
00023 }

Here is the call graph for this function:


Generated on Thu Jan 13 09:21:36 2011 for ImpalaSrc by  doxygen 1.5.1