﻿<?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++博客-C++研究-最新评论</title><link>http://www.cppblog.com/cxl82116/CommentsRSS.aspx</link><description>Ｃ++细节深度探索及软件工程</description><language>zh-cn</language><pubDate>Sun, 26 Oct 2008 15:44:21 GMT</pubDate><lastBuildDate>Sun, 26 Oct 2008 15:44:21 GMT</lastBuildDate><generator>cnblogs</generator><item><title>re: 有关 C++ 嵌套类 </title><link>http://www.cppblog.com/cxl82116/archive/2008/10/05/24665.html#63273</link><dc:creator>老穆</dc:creator><author>老穆</author><pubDate>Sun, 05 Oct 2008 06:57:00 GMT</pubDate><guid>http://www.cppblog.com/cxl82116/archive/2008/10/05/24665.html#63273</guid><description><![CDATA[好！！<img src ="http://www.cppblog.com/cxl82116/aggbug/63273.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cxl82116/" target="_blank">老穆</a> 2008-10-05 14:57 <a href="http://www.cppblog.com/cxl82116/archive/2008/10/05/24665.html#63273#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: Math For Programmers </title><link>http://www.cppblog.com/cxl82116/archive/2008/09/26/22790.html#62853</link><dc:creator>hui</dc:creator><author>hui</author><pubDate>Fri, 26 Sep 2008 15:57:00 GMT</pubDate><guid>http://www.cppblog.com/cxl82116/archive/2008/09/26/22790.html#62853</guid><description><![CDATA[good artical!!<br>thank you!<img src ="http://www.cppblog.com/cxl82116/aggbug/62853.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cxl82116/" target="_blank">hui</a> 2008-09-26 23:57 <a href="http://www.cppblog.com/cxl82116/archive/2008/09/26/22790.html#62853#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 精炼循环右移</title><link>http://www.cppblog.com/cxl82116/archive/2008/08/29/24132.html#60397</link><dc:creator>李锐</dc:creator><author>李锐</author><pubDate>Fri, 29 Aug 2008 12:08:00 GMT</pubDate><guid>http://www.cppblog.com/cxl82116/archive/2008/08/29/24132.html#60397</guid><description><![CDATA[我也要好好看看，谢谢了<img src ="http://www.cppblog.com/cxl82116/aggbug/60397.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cxl82116/" target="_blank">李锐</a> 2008-08-29 20:08 <a href="http://www.cppblog.com/cxl82116/archive/2008/08/29/24132.html#60397#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: Mysql＋＋使用手册及用法规范</title><link>http://www.cppblog.com/cxl82116/archive/2008/08/28/27450.html#60236</link><dc:creator>苏</dc:creator><author>苏</author><pubDate>Thu, 28 Aug 2008 02:55:00 GMT</pubDate><guid>http://www.cppblog.com/cxl82116/archive/2008/08/28/27450.html#60236</guid><description><![CDATA[真不错。<br>找这方面的资料难啊 <img src ="http://www.cppblog.com/cxl82116/aggbug/60236.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cxl82116/" target="_blank">苏</a> 2008-08-28 10:55 <a href="http://www.cppblog.com/cxl82116/archive/2008/08/28/27450.html#60236#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 对包含Struct的Vector就其中的一种属性排序</title><link>http://www.cppblog.com/cxl82116/archive/2008/08/14/41227.html#58807</link><dc:creator>xx</dc:creator><author>xx</author><pubDate>Thu, 14 Aug 2008 01:32:00 GMT</pubDate><guid>http://www.cppblog.com/cxl82116/archive/2008/08/14/41227.html#58807</guid><description><![CDATA[应该没什么特别简单的办法了吧。这样不挺好吗？我一般都是把Comparer<br>放到StructTerm里面，用的时候用StructTerm::Comparer<br><br><img src ="http://www.cppblog.com/cxl82116/aggbug/58807.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cxl82116/" target="_blank">xx</a> 2008-08-14 09:32 <a href="http://www.cppblog.com/cxl82116/archive/2008/08/14/41227.html#58807#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re:  C++ streams (How to use ostream &amp;amp; istream ?)</title><link>http://www.cppblog.com/cxl82116/archive/2008/07/22/26672.html#56847</link><dc:creator>踏雪赤兔</dc:creator><author>踏雪赤兔</author><pubDate>Tue, 22 Jul 2008 04:12:00 GMT</pubDate><guid>http://www.cppblog.com/cxl82116/archive/2008/07/22/26672.html#56847</guid><description><![CDATA[C++ streams is too slow in my opinion~ <img src ="http://www.cppblog.com/cxl82116/aggbug/56847.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cxl82116/" target="_blank">踏雪赤兔</a> 2008-07-22 12:12 <a href="http://www.cppblog.com/cxl82116/archive/2008/07/22/26672.html#56847#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: Some algorithms about judging a prime .</title><link>http://www.cppblog.com/cxl82116/archive/2008/07/05/22266.html#55407</link><dc:creator>我们一起来提高</dc:creator><author>我们一起来提高</author><pubDate>Sat, 05 Jul 2008 08:45:00 GMT</pubDate><guid>http://www.cppblog.com/cxl82116/archive/2008/07/05/22266.html#55407</guid><description><![CDATA[数论学家利用费马小定理研究出了多种素数测试方法，目前最快的算法是拉宾米<br>勒测试算法，其过程如下：<br>（1）计算奇数M，使得N=(2**r)*M+1<br>（2）选择随机数A&lt;N<br>（3）对于任意i&lt;r，若A**((2**i)*M) MOD N = N-1，则N通过随机数A的测试<br>（4）或者，若A**M MOD N = 1，则N通过随机数A的测试<br>（5）让A取不同的值对N进行5次测试，若全部通过则判定N为素数<br>    若N 通过一次测试，则N 不是素数的概率为 25%，若N 通过t 次测试，则N 不是<br>素数的概率为1/4**t。事实上取t 为5 时，N 不是素数的概率为 1/128，N 为素数的<br>概率已经大于99.99%。<br>    在实际应用中，可首先用300—500个小素数对N 进行测试，以提高拉宾米勒测试<br>通过的概率，从而提高测试速度。而在生成随机素数时，选取的随机数最好让 r=0，<br>则可省去步骤（3） 的测试，进一步提高测试速度<br><img src ="http://www.cppblog.com/cxl82116/aggbug/55407.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cxl82116/" target="_blank">我们一起来提高</a> 2008-07-05 16:45 <a href="http://www.cppblog.com/cxl82116/archive/2008/07/05/22266.html#55407#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: How can you efficeny judge whether the num is primer?</title><link>http://www.cppblog.com/cxl82116/archive/2008/07/05/22265.html#55405</link><dc:creator>我们一起来提高</dc:creator><author>我们一起来提高</author><pubDate>Sat, 05 Jul 2008 08:31:00 GMT</pubDate><guid>http://www.cppblog.com/cxl82116/archive/2008/07/05/22265.html#55405</guid><description><![CDATA[我的看法：<br>（1）0和1都不算素数。<br>（2）2和3都是素数，可以直接返回。<br>（3）判断一个比较小的数（可以认为在long范围内的吧，如果是1024二进制位的大数就得想别的办法了）是不是素数肯定得穷举，提高效率就得根据已知的条件缩小穷举的空间。我认为以上程序的穷举空间还不够小。<br>其实只要对大于3的数num穷举从2～sqrt(num)就够了，而不用扩展到num/2。假如判断1122是不是素数，只需要穷举1122对2~33这个范围的余数有没有为0的就可以，超过33的数，如果正好有另一个积数，那么这个积数一定小于sqrt(num)，乘法运算是对称的，这是数实际上已经穷举过了。这样以1122为例就少穷举了528次，效率提高了约17倍，而这个num越大，效率提高就越明显。<br><br>不知道我说的对不对，请大家指教啊。<br><img src ="http://www.cppblog.com/cxl82116/aggbug/55405.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cxl82116/" target="_blank">我们一起来提高</a> 2008-07-05 16:31 <a href="http://www.cppblog.com/cxl82116/archive/2008/07/05/22265.html#55405#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: Mysql＋＋使用手册及用法规范</title><link>http://www.cppblog.com/cxl82116/archive/2008/05/15/27450.html#49885</link><dc:creator>zy</dc:creator><author>zy</author><pubDate>Wed, 14 May 2008 18:10:00 GMT</pubDate><guid>http://www.cppblog.com/cxl82116/archive/2008/05/15/27450.html#49885</guid><description><![CDATA[真不错啊，感谢了！<img src ="http://www.cppblog.com/cxl82116/aggbug/49885.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cxl82116/" target="_blank">zy</a> 2008-05-15 02:10 <a href="http://www.cppblog.com/cxl82116/archive/2008/05/15/27450.html#49885#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 对包含Struct的Vector就其中的一种属性排序</title><link>http://www.cppblog.com/cxl82116/archive/2008/04/24/41227.html#48003</link><dc:creator>ruansun</dc:creator><author>ruansun</author><pubDate>Thu, 24 Apr 2008 06:49:00 GMT</pubDate><guid>http://www.cppblog.com/cxl82116/archive/2008/04/24/41227.html#48003</guid><description><![CDATA[这样写固然可以，但是如果要对TermID排序，还得写<br>class Comparer_termid<br>{<br>public:<br><br>    bool operator () (const StructTerm &amp; va1, const StructTerm &amp; va2)<br>    {<br>        return va1.TermID&gt; va2.TermID;<br>    }<br>};<br>如果参数列表有100个的话，是不是每一个都需要一个上面的class定义才能排序呢？<br>怎么写才能更简单呢？<img src ="http://www.cppblog.com/cxl82116/aggbug/48003.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cxl82116/" target="_blank">ruansun</a> 2008-04-24 14:49 <a href="http://www.cppblog.com/cxl82116/archive/2008/04/24/41227.html#48003#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>