<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Spot The Bug!</title>
	<atom:link href="http://www.donniepinkston.net/2008-11-15/spot-the-bug.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.donniepinkston.net/2008-11-15/spot-the-bug.html</link>
	<description>(there are many more like it, but this one is mine)</description>
	<pubDate>Sun, 01 Aug 2010 08:26:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Abhishek</title>
		<link>http://www.donniepinkston.net/2008-11-15/spot-the-bug.html#comment-23548</link>
		<dc:creator>Abhishek</dc:creator>
		<pubDate>Tue, 02 Dec 2008 07:21:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.donniepinkston.net/?p=198#comment-23548</guid>
		<description>Hi Donnie, 

The above code chunk transposes each element twice and hence u getting the same matrix finally. The approach should be go for either upper trianular elements or lower ones for transposing. 

Also, this will give you better preformance numbers from square(n) to n*(n-1)/2 :))

Hope u remember me .. 

+Abhishek</description>
		<content:encoded><![CDATA[<p>Hi Donnie, </p>
<p>The above code chunk transposes each element twice and hence u getting the same matrix finally. The approach should be go for either upper trianular elements or lower ones for transposing. </p>
<p>Also, this will give you better preformance numbers from square(n) to n*(n-1)/2 :))</p>
<p>Hope u remember me .. </p>
<p>+Abhishek</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: donnie</title>
		<link>http://www.donniepinkston.net/2008-11-15/spot-the-bug.html#comment-23340</link>
		<dc:creator>donnie</dc:creator>
		<pubDate>Sun, 16 Nov 2008 20:11:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.donniepinkston.net/?p=198#comment-23340</guid>
		<description>Very good Chris, I'm impressed!

You can imagine my embarrassment when I discovered the problem...

Here is the updated version:

&lt;pre&gt;
    /** Transpose the matrix. **/
    void transpose() {
      for (int r = 0; r &#60; dim; r++) {
        for (int c = r + 1; c &#60; dim; c++) {
          T tmp = getElem(r, c);
          setElem(r, c, getElem(c, r));
          setElem(c, r, tmp);
        }
      }
    }
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Very good Chris, I&#8217;m impressed!</p>
<p>You can imagine my embarrassment when I discovered the problem&#8230;</p>
<p>Here is the updated version:</p>
<pre>
    /** Transpose the matrix. **/
    void transpose() {
      for (int r = 0; r &lt; dim; r++) {
        for (int c = r + 1; c &lt; dim; c++) {
          T tmp = getElem(r, c);
          setElem(r, c, getElem(c, r));
          setElem(c, r, tmp);
        }
      }
    }
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris B</title>
		<link>http://www.donniepinkston.net/2008-11-15/spot-the-bug.html#comment-23337</link>
		<dc:creator>Chris B</dc:creator>
		<pubDate>Sun, 16 Nov 2008 19:54:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.donniepinkston.net/?p=198#comment-23337</guid>
		<description>Just rename the function "transposetranspose" and keep it around for when you want to transpose something twice. :)</description>
		<content:encoded><![CDATA[<p>Just rename the function &#8220;transposetranspose&#8221; and keep it around for when you want to transpose something twice. <img src='http://www.donniepinkston.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
