锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美黑人激情性久久,77777亚洲午夜久久多喷,久久国产乱子伦精品免费强http://www.shnenglu.com/feng/category/6764.htmlzh-cnSat, 07 Aug 2010 12:50:22 GMTSat, 07 Aug 2010 12:50:22 GMT60浣嶅浘绱㈠紩鎺掑簭http://www.shnenglu.com/feng/archive/2009/12/05/102593.htmlWang FengWang FengSat, 05 Dec 2009 04:56:00 GMThttp://www.shnenglu.com/feng/archive/2009/12/05/102593.htmlhttp://www.shnenglu.com/feng/comments/102593.htmlhttp://www.shnenglu.com/feng/archive/2009/12/05/102593.html#Feedback1http://www.shnenglu.com/feng/comments/commentRss/102593.htmlhttp://www.shnenglu.com/feng/services/trackbacks/102593.html鏃犲績鍦ㄨ繖閲宑opy/paste浣嶅浘鎺掑簭鐨勫叿浣撹В閲婏紝濡傛灉鏈夌煡閬撳緱涓嶈緇嗙殑錛岃璁塊棶Wikipedia銆?br />
聽聽1#ifndef聽_BITMAP_HPP_INCLUDED
聽聽2#define聽_BITMAP_HPP_INCLUDED
聽聽3
聽聽4#include聽<cstring>//for聽memset
聽聽5
聽聽6
聽聽7namespace聽feng
聽聽8{
聽聽9
聽10template<typename聽Type>
聽11class聽Bitmap_Sort
聽12{
聽13聽聽聽聽聽聽聽聽typedef聽Type聽template_type;
聽14聽聽聽聽private:
聽15聽聽聽聽聽聽聽聽struct聽_Bitmap_Impl;
聽16聽聽聽聽聽聽聽聽_Bitmap_Impl*聽bi_;
聽17聽聽聽聽public:
聽18聽聽聽聽聽聽聽聽Bitmap_Sort(聽const聽template_type&聽lower聽=1,聽const聽template_type&聽upper聽=100聽)
聽19聽聽聽聽聽聽聽聽{
聽20聽聽聽聽聽聽聽聽bi_聽=聽lower聽<聽upper聽?
聽21聽聽聽聽聽聽聽聽聽聽聽聽new聽_Bitmap_Impl(lower,upper)聽:聽
聽22聽聽聽聽聽聽聽聽聽聽聽聽new聽_Bitmap_Impl(upper,lower);
聽23
聽24聽聽聽聽聽聽聽聽}
聽25聽聽聽聽聽聽聽聽~Bitmap_Sort()
聽26聽聽聽聽聽聽聽聽{
聽27聽聽聽聽聽聽聽聽delete聽bi_;
聽28聽聽聽聽聽聽聽聽}
聽29
聽30聽聽聽聽聽聽聽聽void聽process(聽const聽template_type&聽v聽)聽const
聽31聽聽聽聽聽聽聽聽{
聽32聽聽聽聽聽聽聽聽聽聽聽聽(*bi_).register_number(聽v聽);
聽33聽聽聽聽聽聽聽聽}
聽34
聽35聽聽聽聽聽聽聽聽template<typename聽Input_Itor>
聽36聽聽聽聽聽聽聽聽void聽process(聽Input_Itor聽begin,聽Input_Itor聽end聽)聽const
聽37聽聽聽聽聽聽聽聽{
聽38聽聽聽聽聽聽聽聽while聽(聽begin聽!=聽end聽)
聽39聽聽聽聽聽聽聽聽聽聽聽聽(*bi_).register_number(聽*begin++聽);
聽40聽聽聽聽聽聽聽聽//including聽<algorithm>聽is聽not聽of聽necessity
聽41聽聽聽聽聽聽聽聽//for_each(聽begin,聽end,聽&((*bi_).register_number)聽);聽
聽42聽聽聽聽聽聽聽聽}
聽43
聽44聽聽聽聽聽聽聽聽template<typename聽Output_Itor>
聽45聽聽聽聽聽聽聽聽Output_Itor聽produce(聽Output_Itor聽begin聽)聽const
聽46聽聽聽聽聽聽聽聽{
聽47聽聽聽聽聽聽聽聽for聽(聽Type聽i聽=聽(*bi_).lower_;聽i聽<=聽(*bi_).upper_;聽++i聽)
聽48聽聽聽聽聽聽聽聽聽聽聽聽if聽(聽(*bi_).query_number(i)聽)
聽49聽聽聽聽聽聽聽聽聽聽聽聽*begin++=聽i;
聽50聽聽聽聽聽聽聽聽return聽begin;
聽51聽聽聽聽聽聽聽聽}
聽52};
聽53
聽54
聽55template<typename聽Type>
聽56struct聽Bitmap_Sort<Type>聽::聽_Bitmap_Impl聽
聽57{
聽58聽聽聽聽聽聽聽聽typedef聽unsigned聽long聽word_type;
聽59聽聽聽聽typedef聽Type聽template_type;
聽60
聽61聽聽聽聽_Bitmap_Impl(聽const聽template_type&聽lower=1,聽const聽template_type&聽upper=100聽)
聽62聽聽聽聽聽聽聽聽:聽lower_(lower),upper_(upper)
聽63聽聽聽聽{
聽64聽聽聽聽聽聽聽聽聽聽聽聽const聽template_type聽length聽=聽upper聽-聽lower聽+1;
聽65聽聽聽聽聽聽聽聽const聽word_type聽size聽=聽(length >> bit_shift())聽+1;聽
聽66聽聽聽聽聽聽聽聽
聽67聽聽聽聽聽聽聽聽buffer_聽=聽聽new聽word_type[size];
聽68聽聽聽聽聽聽聽聽
聽69聽聽聽聽聽聽聽聽memset(buffer_,size,0);
聽70聽聽聽聽}
聽71聽聽聽聽~_Bitmap_Impl()
聽72聽聽聽聽{聽
聽73聽聽聽聽聽聽聽聽delete聽[]聽buffer_;聽
聽74聽聽聽聽}
聽75
聽76聽聽聽聽bool聽register_number(聽const聽template_type&聽v聽)聽const
聽77聽聽聽聽{
聽78聽聽聽聽聽聽聽聽bool聽ans聽=false;
聽79聽聽聽聽聽聽聽聽if聽(聽v聽<=聽upper_聽&&聽v聽>=聽lower_聽)
聽80聽聽聽聽聽聽聽聽{
聽81聽聽聽聽聽聽聽聽聽聽聽聽const聽template_type聽shift聽=聽v聽-聽lower_;
聽82聽聽聽聽聽聽聽聽聽聽聽聽const聽word_type聽arr_position聽=聽shift聽>>聽bit_shift();
聽83聽聽聽聽聽聽聽聽聽聽聽聽const聽word_type聽relative_position聽=聽shift聽&聽(聽(1<<聽bit_shift())聽-1聽);
聽84聽聽聽聽聽聽聽聽聽聽聽聽const聽word_type聽patch聽=1<<聽(聽relative_position聽+1聽);
聽85聽聽聽聽聽聽聽聽聽聽聽聽buffer_[arr_position]聽|=聽patch;
聽86聽聽聽聽聽聽聽聽聽聽聽聽ans聽=true;
聽87聽聽聽聽聽聽聽聽}
聽88聽聽聽聽聽聽聽聽return聽ans;
聽89聽聽聽聽}
聽90聽聽聽聽bool聽query_number(聽const聽template_type&聽v聽)聽const
聽91聽聽聽聽{
聽92聽聽聽聽聽聽聽聽bool聽ans聽=false;
聽93聽聽聽聽聽聽聽聽//not聽necessory,聽commented
聽94聽聽聽聽聽聽聽聽//if聽(聽v聽<=聽upper_聽&&聽v聽>=聽lower_聽)
聽95聽聽聽聽聽聽聽聽//{
聽96聽聽聽聽聽聽聽聽const聽template_type聽shift聽=聽v聽-聽lower_;
聽97聽聽聽聽聽聽聽聽const聽word_type聽arr_position聽=聽shift聽>>聽bit_shift();
聽98聽聽聽聽聽聽聽聽const聽word_type聽relative_position聽=聽shift聽&聽(聽(1<<聽bit_shift())聽-1聽);
聽99聽聽聽聽聽聽聽聽const聽word_type聽patch聽=1<<聽(聽relative_position聽+1聽);
100聽聽聽聽聽聽聽聽if(聽buffer_[arr_position]聽&聽patch聽)
101聽聽聽聽聽聽聽聽聽聽聽聽ans聽=true;
102聽聽聽聽聽聽聽聽//}
103聽聽聽聽聽聽聽聽return聽ans;
104聽聽聽聽}
105
106聽聽聽聽const聽word_type聽bit_shift()聽const
107聽聽聽聽{
108聽聽聽聽聽聽聽聽return 8 == sizeof(unsiged long) ? 6 : 5;
110聽聽聽聽}
111聽聽聽聽
112聽聽聽聽template_type聽lower_;
113聽聽聽聽template_type聽upper_;
114聽聽聽聽mutable聽word_type*聽buffer_;
115};
116
117
118}//namespace聽feng
119
120#endif//_BITMAP_HPP_INCLUDED
121
122
123


涓涓祴璇曠敤渚嬶細(xì)
#include聽<bitmap.hpp>

#include聽
<iostream>
#include聽
<iterator>

usingnamespace聽std;

int聽main()
{
聽聽聽聽feng::Bitmap_Sort
<unsigned聽long>聽bs(1,聽10000000);
聽聽聽聽
//feng::Bitmap_Sort<unsigned聽long>聽bs(10000000,聽1);

聽聽聽聽bs.process((istream_iterator
<unsigned聽long>(cin)),聽(istream_iterator<unsigned聽long>()));


聽聽聽聽bs.produce(ostream_iterator
<unsigned聽long>(cout,聽"\n"));


聽聽聽聽
return0;
}







Wang Feng 2009-12-05 12:56 鍙戣〃璇勮
]]>
闈炲潎鍖鍙栨牱鏁版嵁鐨勫姛鐜囪氨浼拌鏂規(guī)硶http://www.shnenglu.com/feng/archive/2009/01/02/71028.htmlWang FengWang FengFri, 02 Jan 2009 13:20:00 GMThttp://www.shnenglu.com/feng/archive/2009/01/02/71028.html闃呰鍏ㄦ枃

Wang Feng 2009-01-02 21:20 鍙戣〃璇勮
]]>
nth_element ---- 姣旇緝浼樼編鐨勪唬鐮?/title><link>http://www.shnenglu.com/feng/archive/2008/11/06/66141.html</link><dc:creator>Wang Feng</dc:creator><author>Wang Feng</author><pubDate>Thu, 06 Nov 2008 08:47:00 GMT</pubDate><guid>http://www.shnenglu.com/feng/archive/2008/11/06/66141.html</guid><wfw:comment>http://www.shnenglu.com/feng/comments/66141.html</wfw:comment><comments>http://www.shnenglu.com/feng/archive/2008/11/06/66141.html#Feedback</comments><slash:comments>29</slash:comments><wfw:commentRss>http://www.shnenglu.com/feng/comments/commentRss/66141.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/feng/services/trackbacks/66141.html</trackback:ping><description><![CDATA[     鎽樿: 涓孌佃寰楁瘮杈冩紓浜殑浠g爜 nth_element  <a href='http://www.shnenglu.com/feng/archive/2008/11/06/66141.html'>闃呰鍏ㄦ枃</a><img src ="http://www.shnenglu.com/feng/aggbug/66141.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/feng/" target="_blank">Wang Feng</a> 2008-11-06 16:47 <a href="http://www.shnenglu.com/feng/archive/2008/11/06/66141.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>灝嗛仐浼犵畻娉曠殑搴撴斁鍒皊f鍘諱簡http://www.shnenglu.com/feng/archive/2008/10/28/65280.htmlWang FengWang FengTue, 28 Oct 2008 02:20:00 GMThttp://www.shnenglu.com/feng/archive/2008/10/28/65280.htmlhttp://www.shnenglu.com/feng/comments/65280.htmlhttp://www.shnenglu.com/feng/archive/2008/10/28/65280.html#Feedback1http://www.shnenglu.com/feng/comments/commentRss/65280.htmlhttp://www.shnenglu.com/feng/services/trackbacks/65280.html榪欓噷(http://sourceforge.net/projects/gaplusplus/)涓嬭澆婧愪唬鐮併俢ppblog涓嶆敮鎸乼ar.bz2鏍煎紡鐨勬枃妗d笂浼犮?br>
鏂規(guī)墠鍦╟sdn鐏屾按鏃訛紝鍙戠幇鏈変漢緇欏嚭榪欎釜blog涓婃枃绔犵殑閾炬帴錛屽疄鍦ㄦ睏棰溿?br>榪欒竟鐨刡log鑽掑簾浜嗗ソ涔咃紝涓鐩存病鏈夊姩鎵嬪啓涓嬪幓錛?br>鍓嶄笉涔呮妸浠g爜閲嶆瀯浜嗕竴涓嬶紝鏀懼埌sf鍘諱簡錛?br>
濡傛湁寤鴻鎴栬呯枒闂紝嬈㈣繋鏉ヤ俊(wanng.fenng[at]gmail.com)璁ㄨ銆?br>


Wang Feng 2008-10-28 10:20 鍙戣〃璇勮
]]>
閬椾紶綆楁硶緋誨垪 錛?錛?鍙樺紓綆楁硶http://www.shnenglu.com/feng/archive/2008/06/22/54291.htmlWang FengWang FengSun, 22 Jun 2008 08:20:00 GMThttp://www.shnenglu.com/feng/archive/2008/06/22/54291.htmlhttp://www.shnenglu.com/feng/comments/54291.htmlhttp://www.shnenglu.com/feng/archive/2008/06/22/54291.html#Feedback0http://www.shnenglu.com/feng/comments/commentRss/54291.htmlhttp://www.shnenglu.com/feng/services/trackbacks/54291.html闃呰鍏ㄦ枃

Wang Feng 2008-06-22 16:20 鍙戣〃璇勮
]]>
閬椾紶綆楁硶緋誨垪 錛?錛?浜ゅ弶綆楁硶http://www.shnenglu.com/feng/archive/2008/06/18/53870.htmlWang FengWang FengWed, 18 Jun 2008 07:56:00 GMThttp://www.shnenglu.com/feng/archive/2008/06/18/53870.htmlhttp://www.shnenglu.com/feng/comments/53870.htmlhttp://www.shnenglu.com/feng/archive/2008/06/18/53870.html#Feedback1http://www.shnenglu.com/feng/comments/commentRss/53870.htmlhttp://www.shnenglu.com/feng/services/trackbacks/53870.html闃呰鍏ㄦ枃

Wang Feng 2008-06-18 15:56 鍙戣〃璇勮
]]>
閬椾紶綆楁硶緋誨垪 錛?錛? 閬椾紶綆楁硶涓殑鏁版嵁緇撴瀯鍜屼笌涔嬬浉鍏崇殑涓浜涙暟鍊肩畻娉?/title><link>http://www.shnenglu.com/feng/archive/2008/06/16/53372.html</link><dc:creator>Wang Feng</dc:creator><author>Wang Feng</author><pubDate>Mon, 16 Jun 2008 08:53:00 GMT</pubDate><guid>http://www.shnenglu.com/feng/archive/2008/06/16/53372.html</guid><wfw:comment>http://www.shnenglu.com/feng/comments/53372.html</wfw:comment><comments>http://www.shnenglu.com/feng/archive/2008/06/16/53372.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/feng/comments/commentRss/53372.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/feng/services/trackbacks/53372.html</trackback:ping><description><![CDATA[     鎽樿: 閬椾紶綆楁硶鐨勬暟鎹粨鏋勫畾涔夛紝浠ュ強(qiáng)鐩稿叧鐨勫嚑涓熀鏈畻娉曪紝c++瀹炵幇浠g爜銆?nbsp; <a href='http://www.shnenglu.com/feng/archive/2008/06/16/53372.html'>闃呰鍏ㄦ枃</a><img src ="http://www.shnenglu.com/feng/aggbug/53372.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/feng/" target="_blank">Wang Feng</a> 2008-06-16 16:53 <a href="http://www.shnenglu.com/feng/archive/2008/06/16/53372.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>閬椾紶綆楁硶緋誨垪 錛?錛夐仐浼犵畻娉曠殑鍩烘湰姒傚康http://www.shnenglu.com/feng/archive/2008/06/15/53363.htmlWang FengWang FengSun, 15 Jun 2008 12:19:00 GMThttp://www.shnenglu.com/feng/archive/2008/06/15/53363.htmlhttp://www.shnenglu.com/feng/comments/53363.htmlhttp://www.shnenglu.com/feng/archive/2008/06/15/53363.html#Feedback1http://www.shnenglu.com/feng/comments/commentRss/53363.htmlhttp://www.shnenglu.com/feng/services/trackbacks/53363.html絎竴閮ㄥ垎鏄仐浼犵畻娉曠殑綆浠嬶紝鍋鋒噿浠庡埆鐨勫湴鏂硅漿杞借繃鏉ョ殑錛堟湁鍒犳敼錛夈傚鏋滃閬椾紶綆楁硶鏈夋墍浜嗚В浜嗭紝灝變笉瑕佺湅浜嗭紝絎竴嬈″惉璇撮仐浼犵畻娉曠殑錛屼笉濡ㄨ繘鏉ヨ漿杞?

鎺ヤ笅鏉ュ皢鍦ㄧ浜岄儴鍒嗚涓嬮仐浼犵畻娉曠殑鏁版嵁緇撴瀯瀹氫箟錛岀涓夐儴鍒嗗啓閬椾紶綆楁硶鐨勪竴緋誨垪綆楀瓙鐨勫叿浣撶畻娉曪紝絎洓閮ㄥ垎鍐欐牴鎹闄╂ā鍨嬪仛鐨勬敼榪涘伐浣溿?
褰撶劧錛屽悓鏃剁粰鍑篶++瀹炵幇銆?nbsp; 闃呰鍏ㄦ枃

Wang Feng 2008-06-15 20:19 鍙戣〃璇勮
]]>
涓鑸嚎鎬фā鍨嬬殑鏈灝忎簩嬈℃柟鎷熷悎鏂規(guī)硶http://www.shnenglu.com/feng/archive/2008/04/15/47157.htmlWang FengWang FengTue, 15 Apr 2008 14:38:00 GMThttp://www.shnenglu.com/feng/archive/2008/04/15/47157.htmlhttp://www.shnenglu.com/feng/comments/47157.htmlhttp://www.shnenglu.com/feng/archive/2008/04/15/47157.html#Feedback2http://www.shnenglu.com/feng/comments/commentRss/47157.htmlhttp://www.shnenglu.com/feng/services/trackbacks/47157.html闃呰鍏ㄦ枃

Wang Feng 2008-04-15 22:38 鍙戣〃璇勮
]]>
久久久亚洲AV波多野结衣| 9191精品国产免费久久| 久久AV无码精品人妻糸列| 午夜久久久久久禁播电影| 久久精品无码午夜福利理论片| 久久精品九九亚洲精品天堂| 久久久久婷婷| 日日躁夜夜躁狠狠久久AV| 国产成人AV综合久久| 国产成人久久精品一区二区三区| 69久久精品无码一区二区| 婷婷久久综合| 亚洲午夜久久久精品影院| 性欧美丰满熟妇XXXX性久久久 | 久久婷婷国产剧情内射白浆 | 国产精品九九久久精品女同亚洲欧美日韩综合区| 99久久精品无码一区二区毛片 | 精品人妻伦九区久久AAA片69| 2021国内久久精品| 成人精品一区二区久久| 久久综合噜噜激激的五月天| 一本色综合久久| 久久99精品国产麻豆不卡| 久久成人影院精品777| 亚洲精品无码久久久久去q| 久久国产热这里只有精品| 韩国无遮挡三级久久| 色诱久久久久综合网ywww| 国产精品一区二区久久精品涩爱| 精品无码久久久久久久久久| 成人久久综合网| 久久精品国产第一区二区三区 | 91精品国产91热久久久久福利| 无码人妻久久一区二区三区免费| 亚洲精品久久久www| 久久久久国产一级毛片高清板| a级毛片无码兔费真人久久| 婷婷久久综合九色综合98| 久久精品国产影库免费看 | 国产亚洲精久久久久久无码77777| 亚洲天堂久久久|