src/search_engine/relja_retrival/external/KMCode_relja/descriptor/SiftDescriptor.cpp
/* L2 Normalize length of vec to 1.0.
*/
L2 Normalize length of vec to 1.0.
L2 Normalize length of vec to 1 . 0 .
void NormalizeVect(float *vec, int len)
{
   int i;
   float val, fac, sqlen = 0.0;
   for (i = 0; i < len; i++) {
     val = vec[i];
     sqlen += val * val;
   }
   fac = 1.0 / sqrt(sqlen);
   for (i = 0; i < len; i++)
     vec[i] *= fac;
}
void NormalizeVect ( float * vec , int len ) { int i ; float val , fac , sqlen = 0.0 ; for ( i = 0 ; i < len ; i ++ ) { val = vec [ i ] ; sqlen += val * val ; } fac = 1.0 / sqrt ( sqlen ) ; for ( i = 0 ; i < len ; i ++ ) vec [ i ] *= fac ; }
L2 Normalize length of vec to 1.0.
L2 Normalize length of vec to 1 . 0 .