#include namespace NICE { template<> Ipp32f EuclidianDistance::doCalculate(const VectorT& v1, const VectorT& v2) const { if(v1.size()!=v2.size()) fthrow(Exception, "Input vectors must have the same size."); Ipp32f dist = 0; #ifdef NICE_USELIB_IPP VectorT res(v1.size()); ippsSub_32f(v1.getDataPointer(), v2.getDataPointer(), res.getDataPointer(), v1.size()); ippsSqr_32f(res.getDataPointer(), res.getDataPointer(), res.size()); dist = res.Sum(); #else // NICE_USELIB_IPP const Ipp32f* pSrc1 = v1.getDataPointer(); const Ipp32f* pSrc2 = v2.getDataPointer(); for(Ipp32u i=0; i Ipp32f BhattacharyyaDistance::doCalculate(const VectorT& v1, const VectorT& v2) const { if(v1.size()!=v2.size()) fthrow(Exception, "Input vectors must have the same size."); Ipp32f B; #ifdef NICE_USELIB_IPP VectorT v1f(v1); v1f *= v2; ippsSqrt(v1f.getDataPointer(), v1f.getDataPointer(), v1f.size()); ippsSum(v1f.getDataPointer(), v1f.size(), &B); #else // NICE_USELIB_IPP B = 0.0; for(uint i=0; i