<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Matrix multiplication code</title>
	<atom:link href="http://polymathprogrammer.com/2008/08/20/matrix-multiplication-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://polymathprogrammer.com/2008/08/20/matrix-multiplication-code/</link>
	<description>Where entrepreneurship, mathematics and programming meet</description>
	<lastBuildDate>Wed, 28 Mar 2012 04:44:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Vincent</title>
		<link>http://polymathprogrammer.com/2008/08/20/matrix-multiplication-code/comment-page-1/#comment-22621</link>
		<dc:creator>Vincent</dc:creator>
		<pubDate>Thu, 01 Apr 2010 04:11:42 +0000</pubDate>
		<guid isPermaLink="false">http://polymathprogrammer.com/?p=406#comment-22621</guid>
		<description>apit, first you want to swap columns. Now you want to swap rows. I&#039;m confused.

Next, choose_row1 and choose_row2 are variables.

choose_row1 = 3;
choose_row2 = 4;

And you&#039;ll be swapping rows 3 and 4.

I also think I&#039;m the wrong person to ask. A programming forum might be more helpful for you, because I believe you&#039;re still struggling with the basics of programming logic. You&#039;ll get faster help, and more information on what you intend to achieve.</description>
		<content:encoded><![CDATA[<p>apit, first you want to swap columns. Now you want to swap rows. I&#8217;m confused.</p>
<p>Next, choose_row1 and choose_row2 are variables.</p>
<p>choose_row1 = 3;<br />
choose_row2 = 4;</p>
<p>And you&#8217;ll be swapping rows 3 and 4.</p>
<p>I also think I&#8217;m the wrong person to ask. A programming forum might be more helpful for you, because I believe you&#8217;re still struggling with the basics of programming logic. You&#8217;ll get faster help, and more information on what you intend to achieve.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: apit</title>
		<link>http://polymathprogrammer.com/2008/08/20/matrix-multiplication-code/comment-page-1/#comment-22378</link>
		<dc:creator>apit</dc:creator>
		<pubDate>Wed, 31 Mar 2010 18:03:06 +0000</pubDate>
		<guid isPermaLink="false">http://polymathprogrammer.com/?p=406#comment-22378</guid>
		<description>// swapping matrix.cpp : Defines the entry point for the console application.
	//
	

	#include 
	#include 
	#include 
	#include 
	using namespace std;
	
	void swapping(int **Matrix,int Choose_Rows1,int Choose_Rows2,int Number_columns)
	{
	        int temp=0;
	        for(int i=0; i&lt;Number_columns; i++)
	        {
	                temp=Matrix[Choose_Rows1][i];
	                Matrix[Choose_Rows1][i]=Matrix[Choose_Rows2][i];
                Matrix[Choose_Rows2][i]=temp;
	        }
	}
	
	int main(int argc, char* argv[])
	{
	        int Number_Rows;
	        int Number_columns;
	    int **Matrix;
	
	        cout&lt;&lt;&quot;Please enter Number of Rows : &quot;&lt;&gt;Number_Rows;
	        cout&lt;&lt;endl;
	
	        cout&lt;&lt;&quot;Please enter the Number of columns : &quot;&lt;&gt;Number_columns;
	        cout&lt;&lt;endl;
	   
	        Matrix=new int*[Number_Rows];
	        for(int i=0; i&lt;Number_columns; i++)
	        {
	                Matrix[i]=new int [Number_columns];
	        }
        cout&lt;&lt;endl&lt;&lt;&quot;enter Matrix :&quot;&lt;&lt;endl;
        for(int i=0; i&lt;Number_Rows; i++)
        {
	                for(int j=0; j&gt;Matrix[i][j];
	                }
	               
	        }
	    cout&lt;&lt;endl;

	        int Choose_Rows1;
	        int Choose_Rows2;
	 
	
	        cout&lt;&lt;&quot;Choose_Rows1 : &quot;&lt;&gt;Choose_Rows1;
	        cout&lt;&lt;endl;
	
	        cout&lt;&lt;&quot;Choose_Rows2 : &quot;&lt;&gt;Choose_Rows2;
	        cout&lt;&lt;endl;
	        while(Choose_Rows1=0&amp;&amp;Choose_Rows2=0)
	        {
	        swapping(Matrix,Choose_Rows1,Choose_Rows2,Number_columns);
	    cout&lt;&lt;endl;
	    for(int i=0; i&lt;Number_Rows; i++)
	        {
	                for(int j=0; j&lt;Number_columns; j++)
	                {
	                        cout&lt;&lt;Matrix[i][j];
	                        cout&lt;&lt;&quot; &quot;;
	                }
	                cout&lt;&lt;endl;
	        }
	        cout&lt;&lt;endl;
	        cout&lt;&lt;&quot;Choose_Rows1 : &quot;&lt;&gt;Choose_Rows1;
	        cout&lt;&lt;endl;
	
	        cout&lt;&lt;&quot;Choose_Rows2 : &quot;&lt;&gt;Choose_Rows2;
	        cout&lt;&lt;endl;
	        }
	        cout&lt;&lt;&quot;Press Any Key To End&quot;;
	        getch();
	        return 0;
	} 
	

this code are for choose_row1 and choose_row2 operation..can u upgrade this code to add the choose_row3 and choose_row4..</description>
		<content:encoded><![CDATA[<p>// swapping matrix.cpp : Defines the entry point for the console application.<br />
	//</p>
<p>	#include<br />
	#include<br />
	#include<br />
	#include<br />
	using namespace std;</p>
<p>	void swapping(int **Matrix,int Choose_Rows1,int Choose_Rows2,int Number_columns)<br />
	{<br />
	        int temp=0;<br />
	        for(int i=0; i&lt;Number_columns; i++)<br />
	        {<br />
	                temp=Matrix[Choose_Rows1][i];<br />
	                Matrix[Choose_Rows1][i]=Matrix[Choose_Rows2][i];<br />
                Matrix[Choose_Rows2][i]=temp;<br />
	        }<br />
	}</p>
<p>	int main(int argc, char* argv[])<br />
	{<br />
	        int Number_Rows;<br />
	        int Number_columns;<br />
	    int **Matrix;</p>
<p>	        cout&lt;&lt;&quot;Please enter Number of Rows : &quot;&lt;&gt;Number_Rows;<br />
	        cout&lt;&lt;endl;</p>
<p>	        cout&lt;&lt;&quot;Please enter the Number of columns : &quot;&lt;&gt;Number_columns;<br />
	        cout&lt;&lt;endl;</p>
<p>	        Matrix=new int*[Number_Rows];<br />
	        for(int i=0; i&lt;Number_columns; i++)<br />
	        {<br />
	                Matrix[i]=new int [Number_columns];<br />
	        }<br />
        cout&lt;&lt;endl&lt;&lt;&quot;enter Matrix :&quot;&lt;&lt;endl;<br />
        for(int i=0; i&lt;Number_Rows; i++)<br />
        {<br />
	                for(int j=0; j&gt;Matrix[i][j];<br />
	                }</p>
<p>	        }<br />
	    cout&lt;&lt;endl;</p>
<p>	        int Choose_Rows1;<br />
	        int Choose_Rows2;</p>
<p>	        cout&lt;&lt;&quot;Choose_Rows1 : &quot;&lt;&gt;Choose_Rows1;<br />
	        cout&lt;&lt;endl;</p>
<p>	        cout&lt;&lt;&quot;Choose_Rows2 : &quot;&lt;&gt;Choose_Rows2;<br />
	        cout&lt;&lt;endl;<br />
	        while(Choose_Rows1=0&amp;&amp;Choose_Rows2=0)<br />
	        {<br />
	        swapping(Matrix,Choose_Rows1,Choose_Rows2,Number_columns);<br />
	    cout&lt;&lt;endl;<br />
	    for(int i=0; i&lt;Number_Rows; i++)<br />
	        {<br />
	                for(int j=0; j&lt;Number_columns; j++)<br />
	                {<br />
	                        cout&lt;&lt;Matrix[i][j];<br />
	                        cout&lt;&lt;&quot; &quot;;<br />
	                }<br />
	                cout&lt;&lt;endl;<br />
	        }<br />
	        cout&lt;&lt;endl;<br />
	        cout&lt;&lt;&quot;Choose_Rows1 : &quot;&lt;&gt;Choose_Rows1;<br />
	        cout&lt;&lt;endl;</p>
<p>	        cout&lt;&lt;&quot;Choose_Rows2 : &quot;&lt;&gt;Choose_Rows2;<br />
	        cout&lt;&lt;endl;<br />
	        }<br />
	        cout&lt;&lt;&quot;Press Any Key To End&quot;;<br />
	        getch();<br />
	        return 0;<br />
	} </p>
<p>this code are for choose_row1 and choose_row2 operation..can u upgrade this code to add the choose_row3 and choose_row4..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: apit</title>
		<link>http://polymathprogrammer.com/2008/08/20/matrix-multiplication-code/comment-page-1/#comment-22306</link>
		<dc:creator>apit</dc:creator>
		<pubDate>Wed, 31 Mar 2010 13:24:22 +0000</pubDate>
		<guid isPermaLink="false">http://polymathprogrammer.com/?p=406#comment-22306</guid>
		<description>i got the example of swap operations for data a and b..

#include 
#include 

void swap(int *i, int *j)
{
    int t;
    t = *i;
    *i = *j;
    *j = t;
}

void main()
{
    int a,b;
    a=5;
    b=10;
    printf(&quot;%d %dn&quot;,a,b);
    swap(&amp;a,&amp;b);
    printf(&quot;%d %dn&quot;,a,b);
    
    getch();
    return 0;
}

what about the first column of matrix A swap with last column of matrix A?..</description>
		<content:encoded><![CDATA[<p>i got the example of swap operations for data a and b..</p>
<p>#include<br />
#include </p>
<p>void swap(int *i, int *j)<br />
{<br />
    int t;<br />
    t = *i;<br />
    *i = *j;<br />
    *j = t;<br />
}</p>
<p>void main()<br />
{<br />
    int a,b;<br />
    a=5;<br />
    b=10;<br />
    printf(&#8220;%d %dn&#8221;,a,b);<br />
    swap(&amp;a,&amp;b);<br />
    printf(&#8220;%d %dn&#8221;,a,b);</p>
<p>    getch();<br />
    return 0;<br />
}</p>
<p>what about the first column of matrix A swap with last column of matrix A?..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vincent</title>
		<link>http://polymathprogrammer.com/2008/08/20/matrix-multiplication-code/comment-page-1/#comment-21891</link>
		<dc:creator>Vincent</dc:creator>
		<pubDate>Tue, 30 Mar 2010 13:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://polymathprogrammer.com/?p=406#comment-21891</guid>
		<description>apit, it&#039;s a simple swapping of values. Iterate through each row of A, then swap A[i,0] with A[i,4], and A[i,1] with A[i,3].</description>
		<content:encoded><![CDATA[<p>apit, it&#8217;s a simple swapping of values. Iterate through each row of A, then swap A[i,0] with A[i,4], and A[i,1] with A[i,3].</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: apit</title>
		<link>http://polymathprogrammer.com/2008/08/20/matrix-multiplication-code/comment-page-1/#comment-21880</link>
		<dc:creator>apit</dc:creator>
		<pubDate>Tue, 30 Mar 2010 12:26:16 +0000</pubDate>
		<guid isPermaLink="false">http://polymathprogrammer.com/?p=406#comment-21880</guid>
		<description>tq..i have got all the general formula for each cell.

i have the question about the example of the coding to flip the matrix A = 1 2 3 4 5
                              1 2 4 5 6
                              3 4 5 6 7 
                              4 3 2 1 4
                              3 4 2 4 5

to be matrix A = 5 4 3 2 1
                 6 5 4 2 1
                 7 6 5 4 3
                 4 1 2 3 4
                 5 4 2 4 3</description>
		<content:encoded><![CDATA[<p>tq..i have got all the general formula for each cell.</p>
<p>i have the question about the example of the coding to flip the matrix A = 1 2 3 4 5<br />
                              1 2 4 5 6<br />
                              3 4 5 6 7<br />
                              4 3 2 1 4<br />
                              3 4 2 4 5</p>
<p>to be matrix A = 5 4 3 2 1<br />
                 6 5 4 2 1<br />
                 7 6 5 4 3<br />
                 4 1 2 3 4<br />
                 5 4 2 4 3</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: apit</title>
		<link>http://polymathprogrammer.com/2008/08/20/matrix-multiplication-code/comment-page-1/#comment-21377</link>
		<dc:creator>apit</dc:creator>
		<pubDate>Mon, 29 Mar 2010 08:36:45 +0000</pubDate>
		<guid isPermaLink="false">http://polymathprogrammer.com/?p=406#comment-21377</guid>
		<description>From the slide, what the code for flip the column of matrix A and flip the row of matrix B.

The slide shown the 3x3 size matrix. What about the 5x5 size matrix. How to flip the 2 column and the 2 row of matrix A and matrix B.</description>
		<content:encoded><![CDATA[<p>From the slide, what the code for flip the column of matrix A and flip the row of matrix B.</p>
<p>The slide shown the 3&#215;3 size matrix. What about the 5&#215;5 size matrix. How to flip the 2 column and the 2 row of matrix A and matrix B.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: apit</title>
		<link>http://polymathprogrammer.com/2008/08/20/matrix-multiplication-code/comment-page-1/#comment-20657</link>
		<dc:creator>apit</dc:creator>
		<pubDate>Thu, 25 Mar 2010 01:48:39 +0000</pubDate>
		<guid isPermaLink="false">http://polymathprogrammer.com/?p=406#comment-20657</guid>
		<description>what about their right side cell..what its formula..the example</description>
		<content:encoded><![CDATA[<p>what about their right side cell..what its formula..the example</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vincent</title>
		<link>http://polymathprogrammer.com/2008/08/20/matrix-multiplication-code/comment-page-1/#comment-8536</link>
		<dc:creator>Vincent</dc:creator>
		<pubDate>Thu, 11 Feb 2010 13:16:33 +0000</pubDate>
		<guid isPermaLink="false">http://polymathprogrammer.com/?p=406#comment-8536</guid>
		<description>I&#039;m sorry I can&#039;t explain it better. Perhaps this PowerPoint presentation can do it better:

http://www.cs.ucf.edu/courses/cot4810/fall04/presentations/Systolic_Arrays.ppt

The trick I believe, is in manipulating the array index, and that there is a separate variable belong to each array cell (or processor register) that stores the intermediate result.

I would imagine say the top-left cell to take in
A[0,0]*B[0,0] at T=1 (for example).

Then at T=2, it takes in A[0,1]*B[1,0] and adds it to its intermediate (register) value.

At T=3, it takes in A[0,2]*B[2,0].

So the general formula for the top-left cell is
A[0,T-1]*B[T-1,0] at time T

The thing is, the formula is different for each cell. So you&#039;ll have to figure it out. Just write down all the input index for each cell, and find a pattern regarding the indices from the input.

There will be edge conditions, such as what happens when T=0 for an index T-1? You don&#039;t do anything when that happens.</description>
		<content:encoded><![CDATA[<p>I&#8217;m sorry I can&#8217;t explain it better. Perhaps this PowerPoint presentation can do it better:</p>
<p><a href="http://www.cs.ucf.edu/courses/cot4810/fall04/presentations/Systolic_Arrays.ppt" rel="nofollow">http://www.cs.ucf.edu/courses/cot4810/fall04/presentations/Systolic_Arrays.ppt</a></p>
<p>The trick I believe, is in manipulating the array index, and that there is a separate variable belong to each array cell (or processor register) that stores the intermediate result.</p>
<p>I would imagine say the top-left cell to take in<br />
A[0,0]*B[0,0] at T=1 (for example).</p>
<p>Then at T=2, it takes in A[0,1]*B[1,0] and adds it to its intermediate (register) value.</p>
<p>At T=3, it takes in A[0,2]*B[2,0].</p>
<p>So the general formula for the top-left cell is<br />
A[0,T-1]*B[T-1,0] at time T</p>
<p>The thing is, the formula is different for each cell. So you&#8217;ll have to figure it out. Just write down all the input index for each cell, and find a pattern regarding the indices from the input.</p>
<p>There will be edge conditions, such as what happens when T=0 for an index T-1? You don&#8217;t do anything when that happens.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Help: Systolic arrays and matrix multiplication &#124; Polymath Programmer</title>
		<link>http://polymathprogrammer.com/2008/08/20/matrix-multiplication-code/comment-page-1/#comment-8534</link>
		<dc:creator>Help: Systolic arrays and matrix multiplication &#124; Polymath Programmer</dc:creator>
		<pubDate>Thu, 11 Feb 2010 13:00:11 +0000</pubDate>
		<guid isPermaLink="false">http://polymathprogrammer.com/?p=406#comment-8534</guid>
		<description>[...] apit had given me a problem which I am unable to help with: Matrix multiplication using systolic [...]</description>
		<content:encoded><![CDATA[<p>[...] apit had given me a problem which I am unable to help with: Matrix multiplication using systolic [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: apit</title>
		<link>http://polymathprogrammer.com/2008/08/20/matrix-multiplication-code/comment-page-1/#comment-8435</link>
		<dc:creator>apit</dc:creator>
		<pubDate>Thu, 11 Feb 2010 06:43:35 +0000</pubDate>
		<guid isPermaLink="false">http://polymathprogrammer.com/?p=406#comment-8435</guid>
		<description>I want to ask about systolic array matirx multiplication. for example, if we have three cells. A=2, B=3, C=4. I want to multiply them with 7,8,9. first I would times 2 with 7, next i pass the value of 7 to cell B to be multiply but at the same time the cell A received the value of 8 and it will be then multiplied by 2. then the process goes on. how would I do that?</description>
		<content:encoded><![CDATA[<p>I want to ask about systolic array matirx multiplication. for example, if we have three cells. A=2, B=3, C=4. I want to multiply them with 7,8,9. first I would times 2 with 7, next i pass the value of 7 to cell B to be multiply but at the same time the cell A received the value of 8 and it will be then multiplied by 2. then the process goes on. how would I do that?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

