﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-feng</title><link>http://www.cppblog.com/feng/</link><description /><language>zh-cn</language><lastBuildDate>Thu, 09 Apr 2026 05:36:25 GMT</lastBuildDate><pubDate>Thu, 09 Apr 2026 05:36:25 GMT</pubDate><ttl>60</ttl><item><title>位图索引排序</title><link>http://www.cppblog.com/feng/archive/2009/12/05/102593.html</link><dc:creator>Wang Feng</dc:creator><author>Wang Feng</author><pubDate>Sat, 05 Dec 2009 04:56:00 GMT</pubDate><guid>http://www.cppblog.com/feng/archive/2009/12/05/102593.html</guid><wfw:comment>http://www.cppblog.com/feng/comments/102593.html</wfw:comment><comments>http://www.cppblog.com/feng/archive/2009/12/05/102593.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/feng/comments/commentRss/102593.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/feng/services/trackbacks/102593.html</trackback:ping><description><![CDATA[昨晚网上搜了一下，没有找到C++实现的代码，于是自己写了一个；<br />无心在这里copy/paste位图排序的具体解释，如果有知道得不详细的，请访问<a target="_blank" title="Wikipedia: 位图排序算法" href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;ved=0CAkQFjAA&amp;url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FBitmap_index&amp;ei=XOYZS5_bOcmekQWX6OjeAw&amp;usg=AFQjCNH9rvdIaLaUMHIZqQG9JkxWdZBZzw&amp;sig2=uLxwZeygCbHwCJhXdna9ug">Wikipedia</a>。<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 128, 128);">  1</span> <span style="color: rgb(0, 0, 0);">#ifndef _BITMAP_HPP_INCLUDED<br /></span><span style="color: rgb(0, 128, 128);">  2</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">#define</span><span style="color: rgb(0, 0, 0);"> _BITMAP_HPP_INCLUDED</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">  3</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">  4</span> <span style="color: rgb(0, 0, 0);">#include </span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">cstring</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">for memset</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 128, 128);">  5</span> <span style="color: rgb(0, 128, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">  6</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">  7</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);"> feng<br /></span><span style="color: rgb(0, 128, 128);">  8</span> <span style="color: rgb(0, 0, 0);">{<br /></span><span style="color: rgb(0, 128, 128);">  9</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 10</span> <span style="color: rgb(0, 0, 0);">template</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">typename Type</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 11</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> Bitmap_Sort<br /></span><span style="color: rgb(0, 128, 128);"> 12</span> <span style="color: rgb(0, 0, 0);">{<br /></span><span style="color: rgb(0, 128, 128);"> 13</span> <span style="color: rgb(0, 0, 0);">        typedef Type template_type;<br /></span><span style="color: rgb(0, 128, 128);"> 14</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">:<br /></span><span style="color: rgb(0, 128, 128);"> 15</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">struct</span><span style="color: rgb(0, 0, 0);"> _Bitmap_Impl;<br /></span><span style="color: rgb(0, 128, 128);"> 16</span> <span style="color: rgb(0, 0, 0);">        _Bitmap_Impl</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);"> bi_;<br /></span><span style="color: rgb(0, 128, 128);"> 17</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">:<br /></span><span style="color: rgb(0, 128, 128);"> 18</span> <span style="color: rgb(0, 0, 0);">        Bitmap_Sort( </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> template_type</span><span style="color: rgb(0, 0, 0);">&amp;</span><span style="color: rgb(0, 0, 0);"> lower </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> template_type</span><span style="color: rgb(0, 0, 0);">&amp;</span><span style="color: rgb(0, 0, 0);"> upper </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">100</span><span style="color: rgb(0, 0, 0);"> )<br /></span><span style="color: rgb(0, 128, 128);"> 19</span> <span style="color: rgb(0, 0, 0);">        {<br /></span><span style="color: rgb(0, 128, 128);"> 20</span> <span style="color: rgb(0, 0, 0);">        bi_ </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> lower </span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);"> upper </span><span style="color: rgb(0, 0, 0);">?</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 21</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> _Bitmap_Impl(lower,upper) : <br /></span><span style="color: rgb(0, 128, 128);"> 22</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> _Bitmap_Impl(upper,lower);<br /></span><span style="color: rgb(0, 128, 128);"> 23</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 24</span> <span style="color: rgb(0, 0, 0);">        }<br /></span><span style="color: rgb(0, 128, 128);"> 25</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 0);">~</span><span style="color: rgb(0, 0, 0);">Bitmap_Sort()<br /></span><span style="color: rgb(0, 128, 128);"> 26</span> <span style="color: rgb(0, 0, 0);">        {<br /></span><span style="color: rgb(0, 128, 128);"> 27</span> <span style="color: rgb(0, 0, 0);">        delete bi_;<br /></span><span style="color: rgb(0, 128, 128);"> 28</span> <span style="color: rgb(0, 0, 0);">        }<br /></span><span style="color: rgb(0, 128, 128);"> 29</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 30</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> process( </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> template_type</span><span style="color: rgb(0, 0, 0);">&amp;</span><span style="color: rgb(0, 0, 0);"> v ) </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 31</span> <span style="color: rgb(0, 0, 0);">        {<br /></span><span style="color: rgb(0, 128, 128);"> 32</span> <span style="color: rgb(0, 0, 0);">            (</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">bi_).register_number( v );<br /></span><span style="color: rgb(0, 128, 128);"> 33</span> <span style="color: rgb(0, 0, 0);">        }<br /></span><span style="color: rgb(0, 128, 128);"> 34</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 35</span> <span style="color: rgb(0, 0, 0);">        template</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">typename Input_Itor</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 36</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> process( Input_Itor begin, Input_Itor end ) </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 37</span> <span style="color: rgb(0, 0, 0);">        {<br /></span><span style="color: rgb(0, 128, 128);"> 38</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">while</span><span style="color: rgb(0, 0, 0);"> ( begin </span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);"> end )<br /></span><span style="color: rgb(0, 128, 128);"> 39</span> <span style="color: rgb(0, 0, 0);">            (</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">bi_).register_number( </span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">begin</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);"> );<br /></span><span style="color: rgb(0, 128, 128);"> 40</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">including &lt;algorithm&gt; is not of necessity<br /></span><span style="color: rgb(0, 128, 128);"> 41</span> <span style="color: rgb(0, 128, 0);">        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">for_each( begin, end, &amp;((*bi_).register_number) ); </span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 42</span> <span style="color: rgb(0, 128, 0);"></span><span style="color: rgb(0, 0, 0);">        }<br /></span><span style="color: rgb(0, 128, 128);"> 43</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 44</span> <span style="color: rgb(0, 0, 0);">        template</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">typename Output_Itor</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 45</span> <span style="color: rgb(0, 0, 0);">        Output_Itor produce( Output_Itor begin ) </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 46</span> <span style="color: rgb(0, 0, 0);">        {<br /></span><span style="color: rgb(0, 128, 128);"> 47</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);"> ( Type i </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">bi_).lower_; i </span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">bi_).upper_; </span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i )<br /></span><span style="color: rgb(0, 128, 128);"> 48</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> ( (</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">bi_).query_number(i) )<br /></span><span style="color: rgb(0, 128, 128);"> 49</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">begin</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> i;<br /></span><span style="color: rgb(0, 128, 128);"> 50</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> begin;<br /></span><span style="color: rgb(0, 128, 128);"> 51</span> <span style="color: rgb(0, 0, 0);">        }<br /></span><span style="color: rgb(0, 128, 128);"> 52</span> <span style="color: rgb(0, 0, 0);">};<br /></span><span style="color: rgb(0, 128, 128);"> 53</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 54</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 55</span> <span style="color: rgb(0, 0, 0);">template</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">typename Type</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 56</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">struct</span><span style="color: rgb(0, 0, 0);"> Bitmap_Sort</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">Type</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"> :: _Bitmap_Impl <br /></span><span style="color: rgb(0, 128, 128);"> 57</span> <span style="color: rgb(0, 0, 0);">{<br /></span><span style="color: rgb(0, 128, 128);"> 58</span> <span style="color: rgb(0, 0, 0);">        typedef unsigned </span><span style="color: rgb(0, 0, 255);">long</span><span style="color: rgb(0, 0, 0);"> word_type;<br /></span><span style="color: rgb(0, 128, 128);"> 59</span> <span style="color: rgb(0, 0, 0);">    typedef Type template_type;<br /></span><span style="color: rgb(0, 128, 128);"> 60</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 61</span> <span style="color: rgb(0, 0, 0);">    _Bitmap_Impl( </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> template_type</span><span style="color: rgb(0, 0, 0);">&amp;</span><span style="color: rgb(0, 0, 0);"> lower</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> template_type</span><span style="color: rgb(0, 0, 0);">&amp;</span><span style="color: rgb(0, 0, 0);"> upper</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">100</span><span style="color: rgb(0, 0, 0);"> )<br /></span><span style="color: rgb(0, 128, 128);"> 62</span> <span style="color: rgb(0, 0, 0);">        : lower_(lower),upper_(upper)<br /></span><span style="color: rgb(0, 128, 128);"> 63</span> <span style="color: rgb(0, 0, 0);">    {<br /></span><span style="color: rgb(0, 128, 128);"> 64</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> template_type length </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> upper </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);"> lower </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 128, 128);"> 65</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> word_type size </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> (length </span><span style="color: rgb(0, 0, 0);">&gt;&gt;</span><span style="color: rgb(0, 0, 0);"> bit_shift()) </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">; <br /></span><span style="color: rgb(0, 128, 128);"> 66</span> <span style="color: rgb(0, 0, 0);">        <br /></span><span style="color: rgb(0, 128, 128);"> 67</span> <span style="color: rgb(0, 0, 0);">        buffer_ </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">  </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> word_type[size];<br /></span><span style="color: rgb(0, 128, 128);"> 68</span> <span style="color: rgb(0, 0, 0);">        <br /></span><span style="color: rgb(0, 128, 128);"> 69</span> <span style="color: rgb(0, 0, 0);">        memset(buffer_,size,</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);"> 70</span> <span style="color: rgb(0, 0, 0);">    }<br /></span><span style="color: rgb(0, 128, 128);"> 71</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 0);">~</span><span style="color: rgb(0, 0, 0);">_Bitmap_Impl()<br /></span><span style="color: rgb(0, 128, 128);"> 72</span> <span style="color: rgb(0, 0, 0);">    { <br /></span><span style="color: rgb(0, 128, 128);"> 73</span> <span style="color: rgb(0, 0, 0);">        delete [] buffer_; <br /></span><span style="color: rgb(0, 128, 128);"> 74</span> <span style="color: rgb(0, 0, 0);">    }<br /></span><span style="color: rgb(0, 128, 128);"> 75</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 76</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">bool</span><span style="color: rgb(0, 0, 0);"> register_number( </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> template_type</span><span style="color: rgb(0, 0, 0);">&amp;</span><span style="color: rgb(0, 0, 0);"> v ) </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 77</span> <span style="color: rgb(0, 0, 0);">    {<br /></span><span style="color: rgb(0, 128, 128);"> 78</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">bool</span><span style="color: rgb(0, 0, 0);"> ans </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 128, 128);"> 79</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> ( v </span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);"> upper_ </span><span style="color: rgb(0, 0, 0);">&amp;&amp;</span><span style="color: rgb(0, 0, 0);"> v </span><span style="color: rgb(0, 0, 0);">&gt;=</span><span style="color: rgb(0, 0, 0);"> lower_ )<br /></span><span style="color: rgb(0, 128, 128);"> 80</span> <span style="color: rgb(0, 0, 0);">        {<br /></span><span style="color: rgb(0, 128, 128);"> 81</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> template_type shift </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> v </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);"> lower_;<br /></span><span style="color: rgb(0, 128, 128);"> 82</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> word_type arr_position </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> shift </span><span style="color: rgb(0, 0, 0);">&gt;&gt;</span><span style="color: rgb(0, 0, 0);"> bit_shift();<br /></span><span style="color: rgb(0, 128, 128);"> 83</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> word_type relative_position </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> shift </span><span style="color: rgb(0, 0, 0);">&amp;</span><span style="color: rgb(0, 0, 0);"> ( (</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">&lt;&lt;</span><span style="color: rgb(0, 0, 0);"> bit_shift()) </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);"> );<br /></span><span style="color: rgb(0, 128, 128);"> 84</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> word_type patch </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">&lt;&lt;</span><span style="color: rgb(0, 0, 0);"> ( relative_position </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);"> );<br /></span><span style="color: rgb(0, 128, 128);"> 85</span> <span style="color: rgb(0, 0, 0);">            buffer_[arr_position] </span><span style="color: rgb(0, 0, 0);">|=</span><span style="color: rgb(0, 0, 0);"> patch;<br /></span><span style="color: rgb(0, 128, 128);"> 86</span> <span style="color: rgb(0, 0, 0);">            ans </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 128, 128);"> 87</span> <span style="color: rgb(0, 0, 0);">        }<br /></span><span style="color: rgb(0, 128, 128);"> 88</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> ans;<br /></span><span style="color: rgb(0, 128, 128);"> 89</span> <span style="color: rgb(0, 0, 0);">    }<br /></span><span style="color: rgb(0, 128, 128);"> 90</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">bool</span><span style="color: rgb(0, 0, 0);"> query_number( </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> template_type</span><span style="color: rgb(0, 0, 0);">&amp;</span><span style="color: rgb(0, 0, 0);"> v ) </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 91</span> <span style="color: rgb(0, 0, 0);">    {<br /></span><span style="color: rgb(0, 128, 128);"> 92</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">bool</span><span style="color: rgb(0, 0, 0);"> ans </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 128, 128);"> 93</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">not necessory, commented<br /></span><span style="color: rgb(0, 128, 128);"> 94</span> <span style="color: rgb(0, 128, 0);">        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">if ( v &lt;= upper_ &amp;&amp; v &gt;= lower_ )<br /></span><span style="color: rgb(0, 128, 128);"> 95</span> <span style="color: rgb(0, 128, 0);">        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">{</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 96</span> <span style="color: rgb(0, 128, 0);"></span><span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> template_type shift </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> v </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);"> lower_;<br /></span><span style="color: rgb(0, 128, 128);"> 97</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> word_type arr_position </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> shift </span><span style="color: rgb(0, 0, 0);">&gt;&gt;</span><span style="color: rgb(0, 0, 0);"> bit_shift();<br /></span><span style="color: rgb(0, 128, 128);"> 98</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> word_type relative_position </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> shift </span><span style="color: rgb(0, 0, 0);">&amp;</span><span style="color: rgb(0, 0, 0);"> ( (</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">&lt;&lt;</span><span style="color: rgb(0, 0, 0);"> bit_shift()) </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);"> );<br /></span><span style="color: rgb(0, 128, 128);"> 99</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> word_type patch </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">&lt;&lt;</span><span style="color: rgb(0, 0, 0);"> ( relative_position </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);"> );<br /></span><span style="color: rgb(0, 128, 128);">100</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">( buffer_[arr_position] </span><span style="color: rgb(0, 0, 0);">&amp;</span><span style="color: rgb(0, 0, 0);"> patch )<br /></span><span style="color: rgb(0, 128, 128);">101</span> <span style="color: rgb(0, 0, 0);">            ans </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 128, 128);">102</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">}</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 128, 128);">103</span> <span style="color: rgb(0, 128, 0);"></span><span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> ans;<br /></span><span style="color: rgb(0, 128, 128);">104</span> <span style="color: rgb(0, 0, 0);">    }<br /></span><span style="color: rgb(0, 128, 128);">105</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">106</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> word_type bit_shift() </span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">107</span> <span style="color: rgb(0, 0, 0);">    {<br /></span><span style="color: rgb(0, 128, 128);">108</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"> 8 == sizeof(unsiged long) ? 6 : 5</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 128, 128);">110</span> <span style="color: rgb(0, 0, 0);">    }<br /></span><span style="color: rgb(0, 128, 128);">111</span> <span style="color: rgb(0, 0, 0);">    <br /></span><span style="color: rgb(0, 128, 128);">112</span> <span style="color: rgb(0, 0, 0);">    template_type lower_;<br /></span><span style="color: rgb(0, 128, 128);">113</span> <span style="color: rgb(0, 0, 0);">    template_type upper_;<br /></span><span style="color: rgb(0, 128, 128);">114</span> <span style="color: rgb(0, 0, 0);">    mutable word_type</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);"> buffer_;<br /></span><span style="color: rgb(0, 128, 128);">115</span> <span style="color: rgb(0, 0, 0);">};<br /></span><span style="color: rgb(0, 128, 128);">116</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">117</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">118</span> <span style="color: rgb(0, 0, 0);">}</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">namespace feng</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 128, 128);">119</span> <span style="color: rgb(0, 128, 0);"></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">120</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">#endif</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">_BITMAP_HPP_INCLUDED</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">121</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">122</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">123</span> <span style="color: rgb(0, 0, 0);"></span></div><br /><br />一个测试用例：<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">#include </span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">bitmap.hpp</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br />#include </span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">iostream</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />#include </span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">iterator</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);"> std;<br /><br /></span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> main()<br />{<br />    feng::Bitmap_Sort</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">unsigned </span><span style="color: rgb(0, 0, 255);">long</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"> bs(</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">10000000</span><span style="color: rgb(0, 0, 0);">);<br />    </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">feng::Bitmap_Sort&lt;unsigned long&gt; bs(10000000, 1);</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);"><br />    bs.process((istream_iterator</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">unsigned </span><span style="color: rgb(0, 0, 255);">long</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">(cin)), (istream_iterator</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">unsigned </span><span style="color: rgb(0, 0, 255);">long</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">()));<br /><br /><br />    bs.produce(ostream_iterator</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">unsigned </span><span style="color: rgb(0, 0, 255);">long</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">(cout, </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">\n</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br /><br /><br />    </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br />}</span></div><br /><br /><br /><br /><br /><img src ="http://www.cppblog.com/feng/aggbug/102593.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/feng/" target="_blank">Wang Feng</a> 2009-12-05 12:56 <a href="http://www.cppblog.com/feng/archive/2009/12/05/102593.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Communix操作系统简史</title><link>http://www.cppblog.com/feng/archive/2009/01/11/71733.html</link><dc:creator>Wang Feng</dc:creator><author>Wang Feng</author><pubDate>Sun, 11 Jan 2009 07:33:00 GMT</pubDate><guid>http://www.cppblog.com/feng/archive/2009/01/11/71733.html</guid><wfw:comment>http://www.cppblog.com/feng/comments/71733.html</wfw:comment><comments>http://www.cppblog.com/feng/archive/2009/01/11/71733.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/feng/comments/commentRss/71733.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/feng/services/trackbacks/71733.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 影射而已，当笑话看看就行：）&nbsp;&nbsp;<a href='http://www.cppblog.com/feng/archive/2009/01/11/71733.html'>阅读全文</a><img src ="http://www.cppblog.com/feng/aggbug/71733.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/feng/" target="_blank">Wang Feng</a> 2009-01-11 15:33 <a href="http://www.cppblog.com/feng/archive/2009/01/11/71733.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>非均匀取样数据的功率谱估计方法</title><link>http://www.cppblog.com/feng/archive/2009/01/02/71028.html</link><dc:creator>Wang Feng</dc:creator><author>Wang Feng</author><pubDate>Fri, 02 Jan 2009 13:20:00 GMT</pubDate><guid>http://www.cppblog.com/feng/archive/2009/01/02/71028.html</guid><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 非均匀采样的数据的功率谱估计方法以及其C++实现&nbsp;&nbsp;<a href='http://www.cppblog.com/feng/archive/2009/01/02/71028.html'>阅读全文</a><img src ="http://www.cppblog.com/feng/aggbug/71028.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/feng/" target="_blank">Wang Feng</a> 2009-01-02 21:20 <a href="http://www.cppblog.com/feng/archive/2009/01/02/71028.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>kde4 svn 编译笔记</title><link>http://www.cppblog.com/feng/archive/2008/12/18/69746.html</link><dc:creator>Wang Feng</dc:creator><author>Wang Feng</author><pubDate>Thu, 18 Dec 2008 09:53:00 GMT</pubDate><guid>http://www.cppblog.com/feng/archive/2008/12/18/69746.html</guid><wfw:comment>http://www.cppblog.com/feng/comments/69746.html</wfw:comment><comments>http://www.cppblog.com/feng/archive/2008/12/18/69746.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/feng/comments/commentRss/69746.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/feng/services/trackbacks/69746.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要:  中午的时候翻到2007年12月24号的kde编译笔记，不知不觉一年过去了，忽有所感，于是重新编译一次kde4，记之&nbsp;&nbsp;<a href='http://www.cppblog.com/feng/archive/2008/12/18/69746.html'>阅读全文</a><img src ="http://www.cppblog.com/feng/aggbug/69746.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/feng/" target="_blank">Wang Feng</a> 2008-12-18 17:53 <a href="http://www.cppblog.com/feng/archive/2008/12/18/69746.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>对一类因偷换概念而引发的悖论的思考</title><link>http://www.cppblog.com/feng/archive/2008/11/24/67745.html</link><dc:creator>Wang Feng</dc:creator><author>Wang Feng</author><pubDate>Mon, 24 Nov 2008 12:15:00 GMT</pubDate><guid>http://www.cppblog.com/feng/archive/2008/11/24/67745.html</guid><wfw:comment>http://www.cppblog.com/feng/comments/67745.html</wfw:comment><comments>http://www.cppblog.com/feng/archive/2008/11/24/67745.html#Feedback</comments><slash:comments>10</slash:comments><wfw:commentRss>http://www.cppblog.com/feng/comments/commentRss/67745.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/feng/services/trackbacks/67745.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 探讨了一类因为偷换概念而产生的悖论。&nbsp;&nbsp;<a href='http://www.cppblog.com/feng/archive/2008/11/24/67745.html'>阅读全文</a><img src ="http://www.cppblog.com/feng/aggbug/67745.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/feng/" target="_blank">Wang Feng</a> 2008-11-24 20:15 <a href="http://www.cppblog.com/feng/archive/2008/11/24/67745.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>nth_element ---- 比较优美的代码</title><link>http://www.cppblog.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.cppblog.com/feng/archive/2008/11/06/66141.html</guid><wfw:comment>http://www.cppblog.com/feng/comments/66141.html</wfw:comment><comments>http://www.cppblog.com/feng/archive/2008/11/06/66141.html#Feedback</comments><slash:comments>32</slash:comments><wfw:commentRss>http://www.cppblog.com/feng/comments/commentRss/66141.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/feng/services/trackbacks/66141.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 一段觉得比较漂亮的代码 nth_element&nbsp;&nbsp;<a href='http://www.cppblog.com/feng/archive/2008/11/06/66141.html'>阅读全文</a><img src ="http://www.cppblog.com/feng/aggbug/66141.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/feng/" target="_blank">Wang Feng</a> 2008-11-06 16:47 <a href="http://www.cppblog.com/feng/archive/2008/11/06/66141.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>将遗传算法的库放到sf去了</title><link>http://www.cppblog.com/feng/archive/2008/10/28/65280.html</link><dc:creator>Wang Feng</dc:creator><author>Wang Feng</author><pubDate>Tue, 28 Oct 2008 02:20:00 GMT</pubDate><guid>http://www.cppblog.com/feng/archive/2008/10/28/65280.html</guid><wfw:comment>http://www.cppblog.com/feng/comments/65280.html</wfw:comment><comments>http://www.cppblog.com/feng/archive/2008/10/28/65280.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/feng/comments/commentRss/65280.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/feng/services/trackbacks/65280.html</trackback:ping><description><![CDATA[请在<a target="_blank"  href="http://sourceforge.net/projects/gaplusplus/">这里</a>(http://sourceforge.net/projects/gaplusplus/)下载源代码。cppblog不支持tar.bz2格式的文档上传。<br><br>方才在csdn灌水时，发现有人给出这个blog上文章的链接，实在汗颜。<br>这边的blog荒废了好久，一直没有动手写下去；<br>前不久把代码重构了一下，放到sf去了；<br><br>如有建议或者疑问，欢迎来信(wanng.fenng[at]gmail.com)讨论。<br><br><img src ="http://www.cppblog.com/feng/aggbug/65280.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/feng/" target="_blank">Wang Feng</a> 2008-10-28 10:20 <a href="http://www.cppblog.com/feng/archive/2008/10/28/65280.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>遗传算法系列 （4） 变异算法</title><link>http://www.cppblog.com/feng/archive/2008/06/22/54291.html</link><dc:creator>Wang Feng</dc:creator><author>Wang Feng</author><pubDate>Sun, 22 Jun 2008 08:20:00 GMT</pubDate><guid>http://www.cppblog.com/feng/archive/2008/06/22/54291.html</guid><wfw:comment>http://www.cppblog.com/feng/comments/54291.html</wfw:comment><comments>http://www.cppblog.com/feng/archive/2008/06/22/54291.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/feng/comments/commentRss/54291.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/feng/services/trackbacks/54291.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 遗传算法中，基因变异算法&nbsp;&nbsp;<a href='http://www.cppblog.com/feng/archive/2008/06/22/54291.html'>阅读全文</a><img src ="http://www.cppblog.com/feng/aggbug/54291.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/feng/" target="_blank">Wang Feng</a> 2008-06-22 16:20 <a href="http://www.cppblog.com/feng/archive/2008/06/22/54291.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>遗传算法系列 （3） 交叉算法</title><link>http://www.cppblog.com/feng/archive/2008/06/18/53870.html</link><dc:creator>Wang Feng</dc:creator><author>Wang Feng</author><pubDate>Wed, 18 Jun 2008 07:56:00 GMT</pubDate><guid>http://www.cppblog.com/feng/archive/2008/06/18/53870.html</guid><wfw:comment>http://www.cppblog.com/feng/comments/53870.html</wfw:comment><comments>http://www.cppblog.com/feng/archive/2008/06/18/53870.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/feng/comments/commentRss/53870.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/feng/services/trackbacks/53870.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 遗传算法中交叉算法的简单介绍。可以理解为人类社会的婚姻过程。&nbsp;&nbsp;<a href='http://www.cppblog.com/feng/archive/2008/06/18/53870.html'>阅读全文</a><img src ="http://www.cppblog.com/feng/aggbug/53870.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/feng/" target="_blank">Wang Feng</a> 2008-06-18 15:56 <a href="http://www.cppblog.com/feng/archive/2008/06/18/53870.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>遗传算法系列 （2）  遗传算法中的数据结构和与之相关的一些数值算法</title><link>http://www.cppblog.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.cppblog.com/feng/archive/2008/06/16/53372.html</guid><wfw:comment>http://www.cppblog.com/feng/comments/53372.html</wfw:comment><comments>http://www.cppblog.com/feng/archive/2008/06/16/53372.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/feng/comments/commentRss/53372.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/feng/services/trackbacks/53372.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 遗传算法的数据结构定义，以及相关的几个基本算法，c++实现代码。&nbsp;&nbsp;<a href='http://www.cppblog.com/feng/archive/2008/06/16/53372.html'>阅读全文</a><img src ="http://www.cppblog.com/feng/aggbug/53372.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/feng/" target="_blank">Wang Feng</a> 2008-06-16 16:53 <a href="http://www.cppblog.com/feng/archive/2008/06/16/53372.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>