锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲午夜久久久久妓女影院,四虎国产精品成人免费久久,亚洲人成电影网站久久http://m.shnenglu.com/xocoder/zh-cnSun, 13 Jul 2025 08:03:37 GMTSun, 13 Jul 2025 08:03:37 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 鍙戣〃璇勮
]]>
97久久天天综合色天天综合色hd| 久久久久亚洲精品天堂久久久久久 | 精品人妻伦一二三区久久| 色噜噜狠狠先锋影音久久| 久久久久人妻一区精品| 久久无码国产专区精品| 狠狠色丁香久久婷婷综合五月| 久久久久久久99精品免费观看| 理论片午午伦夜理片久久| 亚洲精品国产字幕久久不卡| 精品国产青草久久久久福利| 久久精品亚洲AV久久久无码| 国产精品99久久久久久董美香| 伊人久久综合精品无码AV专区| 99久久精品九九亚洲精品| 久久亚洲AV无码精品色午夜麻豆| 久久青青草原国产精品免费| 久久强奷乱码老熟女网站| 精品国产婷婷久久久| 99久久中文字幕| 亚洲国产精品一区二区久久hs| 精品熟女少妇aⅴ免费久久| 久久亚洲中文字幕精品有坂深雪 | 一本久久a久久精品综合香蕉| 久久久无码人妻精品无码| 老男人久久青草av高清| 国产精品久久久99| 久久国产精品久久| 97精品久久天干天天天按摩| 国内精品九九久久精品| 久久亚洲精品无码VA大香大香| 亚洲国产成人精品无码久久久久久综合 | 久久久久亚洲精品中文字幕| 青青草原综合久久| 色偷偷888欧美精品久久久| 久久久久亚洲AV无码网站| 色婷婷综合久久久久中文一区二区| 漂亮人妻被中出中文字幕久久| 亚洲精品国产自在久久| 久久久久亚洲精品日久生情 | 麻豆精品久久久一区二区|