锘??xml version="1.0" encoding="utf-8" standalone="yes"?>日韩精品久久久久久免费,免费无码国产欧美久久18,伊人久久大香线蕉亚洲http://m.shnenglu.com/xocoder/zh-cnWed, 07 May 2025 13:33:12 GMTWed, 07 May 2025 13:33:12 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 鍙戣〃璇勮
]]>
久久久久免费视频| 久久久免费观成人影院| 亚洲Av无码国产情品久久| 日本国产精品久久| 久久亚洲熟女cc98cm| 国产精品久久久久久久人人看| 人人妻久久人人澡人人爽人人精品| 亚洲国产成人久久综合碰| 久久免费大片| 狠狠色婷婷久久一区二区 | 久久久无码精品亚洲日韩蜜臀浪潮 | 欧美日韩精品久久久久| 亚洲AV无码久久精品狠狠爱浪潮| 潮喷大喷水系列无码久久精品| 91久久香蕉国产熟女线看| 久久久久国产一区二区三区| 亚洲精品久久久www| 久久精品蜜芽亚洲国产AV| 精品久久久久久无码人妻蜜桃| 亚洲人成精品久久久久| 精品久久一区二区三区| 久久久久久国产a免费观看黄色大片| 国产高潮国产高潮久久久| 亚洲伊人久久成综合人影院| 91久久婷婷国产综合精品青草| 久久久亚洲裙底偷窥综合| 99久久精品国产一区二区三区| 久久久久人妻精品一区| 无码国内精品久久综合88 | 久久婷婷五月综合成人D啪| 久久青草国产手机看片福利盒子| 久久这里的只有是精品23| 久久久久亚洲?V成人无码| 99久久99这里只有免费的精品| 亚洲精品无码久久一线| 三级韩国一区久久二区综合| 久久精品九九亚洲精品天堂| 久久99精品国产自在现线小黄鸭| 色婷婷综合久久久久中文 | 亚洲中文字幕无码久久精品1| 欧美激情精品久久久久久|