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