锘??xml version="1.0" encoding="utf-8" standalone="yes"?>99久久国产精品免费一区二区,国产精品狼人久久久久影院,久久国语露脸国产精品电影http://m.shnenglu.com/xocoder/zh-cnSat, 28 Jun 2025 16:12:09 GMTSat, 28 Jun 2025 16:12:09 GMT60stdext::hash_map浣跨敤瀛楃涓瞜eyhttp://m.shnenglu.com/xocoder/archive/2012/08/14/187200.html瀵板瓙瀵板瓙Tue, 14 Aug 2012 12:40:00 GMThttp://m.shnenglu.com/xocoder/archive/2012/08/14/187200.htmlhttp://m.shnenglu.com/xocoder/comments/187200.htmlhttp://m.shnenglu.com/xocoder/archive/2012/08/14/187200.html#Feedback0http://m.shnenglu.com/xocoder/comments/commentRss/187200.htmlhttp://m.shnenglu.com/xocoder/services/trackbacks/187200.htmlstdext::hash_map浣跨敤瀛楃涓詫紙const char*錛夊仛key鐨勮瘽錛屼笉鏄彧鎸囧畾涓涓猚ompare鍑芥暟闅句箞綆鍗曪紝瑕佺粰瀹氫竴涓粨鏋勪綋錛屽叾鍖呮嫭hash鍑芥暟錛宑ompare鍑芥暟錛屼互鍙?#8220;妗惰瀹?#8221;

struct StringCompare 
{
//define hash function for strings 
    enum 
    { 
        //parameters for hash table 
        bucket_size = 4,  // 涓涓《4byte闀垮害錛堝洜涓簊izeof(char*)=4錛?/span>
        min_buckets = 8 // 鏈灝戝瓨鍦?涓《
    };
    size_t operator()(const char* str) const 
    { 
        unsigned int seed = 131; // 31 131 1313 13131 131313 etc..
unsigned int hash = 0;
while (*str)
{
hash = hash * seed + (*str++);
}
return (hash & 0x7FFFFFFF);
    }
    bool operator()(const char *s1, const char* s2) const 
    {    
        if (strcmp(s1, s2) == 0)
        {
            return false;
        }
        else
        {
            return true;
        }
    } 
}; 

鐒跺悗

stdext::hash_map<const char*, Your Data Type, StringCompare>



瀵板瓙 2012-08-14 20:40 鍙戣〃璇勮
]]>
鍚勭瀛楃涓睭ash鍑芥暟姣旇緝http://m.shnenglu.com/xocoder/archive/2012/08/14/187199.html瀵板瓙瀵板瓙Tue, 14 Aug 2012 12:32:00 GMThttp://m.shnenglu.com/xocoder/archive/2012/08/14/187199.htmlhttp://m.shnenglu.com/xocoder/comments/187199.htmlhttp://m.shnenglu.com/xocoder/archive/2012/08/14/187199.html#Feedback1http://m.shnenglu.com/xocoder/comments/commentRss/187199.htmlhttp://m.shnenglu.com/xocoder/services/trackbacks/187199.html

寰楀垎絎竴錛?/p>

// BKDR Hash Function
unsigned int BKDRHash(char *str)
{
    unsigned 
int seed = 131// 31 131 1313 13131 131313 etc..
    unsigned int hash = 0;
 
    
while (*str)
    
{
        hash 
= hash * seed + (*str++);
    }

 
    
return (hash & 0x7FFFFFFF);
}


寰楀垎絎簩錛?/p>

// AP Hash Function
unsigned int APHash(char *str)
{
    unsigned 
int hash = 0;
    
int i;
 
    
for (i=0*str; i++)
    
{
        
if ((i & 1== 0)
        
{
            hash 
^= ((hash << 7^ (*str++^ (hash >> 3));
        }

        
else
        
{
            hash 
^= (~((hash << 11^ (*str++^ (hash >> 5)));
        }

    }

 
    
return (hash & 0x7FFFFFFF);
}


寰楀垎絎笁錛?/p>

// DJB Hash Function
unsigned int DJBHash(char *str)
{
    unsigned 
int hash = 5381;
 
    
while (*str)
    
{
        hash 
+= (hash << 5+ (*str++);
    }

 
    
return (hash & 0x7FFFFFFF);
}


寰楀垎絎洓錛?/p>

// JS Hash Function
unsigned int JSHash(char *str)
{
    unsigned 
int hash = 1315423911;
 
    
while (*str)
    
{
        hash 
^= ((hash << 5+ (*str+++ (hash >> 2));
    }

 
    
return (hash & 0x7FFFFFFF);
}


 

鍙﹀錛屾澶勪篃鏈変竴綃囨枃绔狅紝鍏朵腑鎻愬強浜嗗彟澶栧嚑縐嶆晥鐜囦篃棰囬珮鐨刪ash綆楁硶

http://programmers.stackexchange.com/questions/49550/which-hashing-algorithm-is-best-for-uniqueness-and-speed/145633#145633 


 



瀵板瓙 2012-08-14 20:32 鍙戣〃璇勮
]]>
鍚屼竴鍧愭爣緋諱腑錛岀敱浠繪剰涓ょ偣璁$畻鏃嬭漿瑙掑害.http://m.shnenglu.com/xocoder/archive/2012/08/14/187197.html瀵板瓙瀵板瓙Tue, 14 Aug 2012 12:28:00 GMThttp://m.shnenglu.com/xocoder/archive/2012/08/14/187197.htmlhttp://m.shnenglu.com/xocoder/comments/187197.htmlhttp://m.shnenglu.com/xocoder/archive/2012/08/14/187197.html#Feedback1http://m.shnenglu.com/xocoder/comments/commentRss/187197.htmlhttp://m.shnenglu.com/xocoder/services/trackbacks/187197.html 

double CCarNaviView::CalculateRotateAngle(CPoint pntBegin,CPoint pntNext)
{
    CPoint pntFirst(pntBegin);
    CPoint pntSecond(pntNext);

    
double dRotateAngle = atan2(fabs(pntBegin.x-pntNext.x),fabs(pntBegin.y-pntNext.y));
 
    
//濡傛灉涓嬩竴鐐圭殑妯潗鏍囧ぇ浜庡墠涓鐐?鍦ㄧ涓鍜岀鍥涜薄闄?
    if (pntNext.x>=pntFirst.x)
    
{
        
//鍦ㄧ涓璞¢檺(0<=dRotateAngle<=90)
        if (pntNext.y>=pntFirst.y)
        
{
            
//涓嶅仛浠諱綍澶勭悊
            dRotateAngle=dRotateAngle;
        }

        
else
        
{
            dRotateAngle
=PI-dRotateAngle;
        }

    }

    
else//(鍦ㄧ浜屽拰絎笁璞¢檺)
    {
        
//絎簩璞¢檺
        if (pntNext.y>=pntFirst.y)
        
{
            dRotateAngle
=2*PI-dRotateAngle;
        }

        
else//絎笁璞¢檺
        {
            dRotateAngle
=PI+dRotateAngle;
        }

    }

    dRotateAngle 
= dRotateAngle * 180 / PI;
    
return dRotateAngle;
}

銆?/p>

瀵板瓙 2012-08-14 20:28 鍙戣〃璇勮
]]>
91久久国产视频| 久久久黄片| 久久被窝电影亚洲爽爽爽| 精品久久久久久久| 久久精品一区二区影院| 久久久精品久久久久影院| 久久午夜羞羞影院免费观看| 热久久这里只有精品| 久久久WWW成人免费毛片| 色欲av伊人久久大香线蕉影院| A狠狠久久蜜臀婷色中文网| 久久久久久国产精品美女| 久久婷婷五月综合97色一本一本 | 久久精品国产一区| 久久亚洲AV无码西西人体| 久久国产色AV免费观看| 久久久中文字幕日本| 99久久99久久久精品齐齐| 亚洲精品无码久久毛片| 成人精品一区二区久久久| 国产一区二区久久久| 久久久久99精品成人片三人毛片| 国内精品久久久久影院薰衣草| 久久国产精品一区| 99久久99这里只有免费费精品| 久久成人小视频| 久久久综合香蕉尹人综合网| 国内精品久久久久久久久| 国产一级做a爰片久久毛片| 人妻久久久一区二区三区| 久久久久国产精品嫩草影院| 日韩亚洲国产综合久久久| 91亚洲国产成人久久精品网址| jizzjizz国产精品久久| 久久久精品人妻一区二区三区四| 囯产极品美女高潮无套久久久| 亚洲午夜无码久久久久小说| 久久久久久国产精品无码下载| 久久精品国产亚洲av瑜伽| 99久久精品费精品国产| 久久精品亚洲男人的天堂|