<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://linear.subwiki.org/w/index.php?action=history&amp;feed=atom&amp;title=Naive_matrix_multiplication</id>
	<title>Naive matrix multiplication - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://linear.subwiki.org/w/index.php?action=history&amp;feed=atom&amp;title=Naive_matrix_multiplication"/>
	<link rel="alternate" type="text/html" href="https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;action=history"/>
	<updated>2026-06-15T18:57:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.2</generator>
	<entry>
		<id>https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=13&amp;oldid=prev</id>
		<title>Vipul: /* Variants given special structure to the matrices */</title>
		<link rel="alternate" type="text/html" href="https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=13&amp;oldid=prev"/>
		<updated>2014-04-29T02:41:32Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Variants given special structure to the matrices&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:41, 29 April 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l42&quot;&gt;Line 42:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 42:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| class=&amp;quot;sortable&amp;quot; border=&amp;quot;1&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| class=&amp;quot;sortable&amp;quot; border=&amp;quot;1&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Type of matrices !! Number of multiplications under naive matrix multiplication, not accounting for structure !! Number of additions under naive matrix multiplication, not accounting for structure !! Number of multiplications under naive matrix multiplication, accounting for structure !! Number of additions under naive matrix multiplication, accounting for structure&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Type of matrices !! Number of multiplications under naive matrix multiplication, not accounting for structure !! Number of additions under naive matrix multiplication, not accounting for structure !! Number of multiplications under naive matrix multiplication, accounting for structure !! Number of additions under naive matrix multiplication, accounting for structure &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;!! Big-Oh saving?&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[diagonal matrix|diagonal matrices]] || &amp;lt;math&amp;gt;n^3&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2(n - 1)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; || 0  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[diagonal matrix|diagonal matrices]] || &amp;lt;math&amp;gt;n^3&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2(n - 1)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; || 0 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|| Yes&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; diagonal, &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is arbitrary &amp;lt;math&amp;gt;n \times p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n(n - 1)p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;np&amp;lt;/math&amp;gt; || 0  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; diagonal, &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is arbitrary &amp;lt;math&amp;gt;n \times p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n(n - 1)p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;np&amp;lt;/math&amp;gt; || 0 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|| Yes&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[upper triangular matrix|upper triangular matrices]] || &amp;lt;math&amp;gt;n^3&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2(n - 1)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n+2}{3} = \frac{n(n+1)(n+2)}{6}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n+1}{3} =\frac{n(n+1)(n-1)}{6}&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[upper triangular matrix|upper triangular matrices]] || &amp;lt;math&amp;gt;n^3&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2(n - 1)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n+2}{3} = \frac{n(n+1)(n+2)}{6}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n+1}{3} =\frac{n(n+1)(n-1)}{6}&amp;lt;/math&amp;gt; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|| No&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Vipul</name></author>
	</entry>
	<entry>
		<id>https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=10&amp;oldid=prev</id>
		<title>Vipul: /* Variants given special structure to the matrices */</title>
		<link rel="alternate" type="text/html" href="https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=10&amp;oldid=prev"/>
		<updated>2014-04-29T02:35:20Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Variants given special structure to the matrices&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:35, 29 April 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l48&quot;&gt;Line 48:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 48:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; diagonal, &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is arbitrary &amp;lt;math&amp;gt;n \times p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n(n - 1)p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;np&amp;lt;/math&amp;gt; || 0  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; diagonal, &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is arbitrary &amp;lt;math&amp;gt;n \times p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n(n - 1)p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;np&amp;lt;/math&amp;gt; || 0  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[upper triangular matrix|upper triangular matrices]] || &amp;lt;math&amp;gt;n^3&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2(n - 1)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n}{3} = \frac{n(n&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-&lt;/del&gt;1)(n&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-&lt;/del&gt;2)}{6}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n}{3&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;} - \binom{n}{2&lt;/del&gt;} = \frac{n(n&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-&lt;/del&gt;1)(n-&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;5&lt;/del&gt;)}{6}&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[upper triangular matrix|upper triangular matrices]] || &amp;lt;math&amp;gt;n^3&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2(n - 1)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;+2&lt;/ins&gt;}{3} = \frac{n(n&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;+&lt;/ins&gt;1)(n&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;+&lt;/ins&gt;2)}{6}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;+1&lt;/ins&gt;}{3} =\frac{n(n&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;+&lt;/ins&gt;1)(n-&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1&lt;/ins&gt;)}{6}&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Vipul</name></author>
	</entry>
	<entry>
		<id>https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=9&amp;oldid=prev</id>
		<title>Vipul: /* Variants given special structure to the matrices */</title>
		<link rel="alternate" type="text/html" href="https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=9&amp;oldid=prev"/>
		<updated>2014-04-29T02:32:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Variants given special structure to the matrices&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:32, 29 April 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l46&quot;&gt;Line 46:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 46:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[diagonal matrix|diagonal matrices]] || &amp;lt;math&amp;gt;n^3&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2(n - 1)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; || 0  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[diagonal matrix|diagonal matrices]] || &amp;lt;math&amp;gt;n^3&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2(n - 1)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; || 0  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;n \times n&amp;lt;math&amp;gt; diagonal, &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is arbitrary &amp;lt;math&amp;gt;n \times p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n(n - 1)p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;np&amp;lt;/math&amp;gt; || 0  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;n \times n&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/&lt;/ins&gt;math&amp;gt; diagonal, &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is arbitrary &amp;lt;math&amp;gt;n \times p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n(n - 1)p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;np&amp;lt;/math&amp;gt; || 0  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[upper triangular matrix|upper triangular matrices]] || &amp;lt;math&amp;gt;n^3&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2(n - 1)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n}{3} = \frac{n(n-1)(n-2)}{6}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n}{3} - \binom{n}{2} = \frac{n(n-1)(n-5)}{6}&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[upper triangular matrix|upper triangular matrices]] || &amp;lt;math&amp;gt;n^3&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2(n - 1)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n}{3} = \frac{n(n-1)(n-2)}{6}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n}{3} - \binom{n}{2} = \frac{n(n-1)(n-5)}{6}&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Vipul</name></author>
	</entry>
	<entry>
		<id>https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=8&amp;oldid=prev</id>
		<title>Vipul: /* Variants given special structure to the matrices */</title>
		<link rel="alternate" type="text/html" href="https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=8&amp;oldid=prev"/>
		<updated>2014-04-29T02:32:00Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Variants given special structure to the matrices&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:32, 29 April 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l42&quot;&gt;Line 42:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 42:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| class=&amp;quot;sortable&amp;quot; border=&amp;quot;1&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| class=&amp;quot;sortable&amp;quot; border=&amp;quot;1&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Type of matrices !! &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;What &lt;/del&gt;naive matrix multiplication &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;would give &lt;/del&gt;for &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;number of additions if we do not take matrix &lt;/del&gt;structure &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;into account&lt;/del&gt;!! &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;What &lt;/del&gt;naive matrix multiplication &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;would give &lt;/del&gt;for &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;number of multiplications if we do not take matrix &lt;/del&gt;structure &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;into account&lt;/del&gt;!! &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;What &lt;/del&gt;naive matrix multiplication &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;would give &lt;/del&gt;for &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;number of additions if we take matrix &lt;/del&gt;structure &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;into account &lt;/del&gt;!! &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; What &lt;/del&gt;naive matrix multiplication &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;would give &lt;/del&gt;for &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;number of multiplications if we take matrix &lt;/del&gt;structure &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;into account&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Type of matrices !! &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Number of multiplications under &lt;/ins&gt;naive matrix multiplication&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, not accounting &lt;/ins&gt;for structure !! &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Number of additions under &lt;/ins&gt;naive matrix multiplication&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, not accounting &lt;/ins&gt;for structure !! &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Number of multiplications under &lt;/ins&gt;naive matrix multiplication&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, accounting &lt;/ins&gt;for structure !! &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Number of additions under &lt;/ins&gt;naive matrix multiplication&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, accounting &lt;/ins&gt;for structure&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[diagonal matrix|diagonal matrices]] || &amp;lt;math&amp;gt;n^&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;2(n - 1)&lt;/del&gt;&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;3&lt;/del&gt;&amp;lt;/math&amp;gt; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|| 0 &lt;/del&gt;|| &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[diagonal matrix|diagonal matrices]] || &amp;lt;math&amp;gt;n^&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;3&lt;/ins&gt;&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;2(n - 1)&lt;/ins&gt;&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|| 0 &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;n \times n&amp;lt;math&amp;gt; diagonal, &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is arbitrary &amp;lt;math&amp;gt;n \times p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(n - 1)p&lt;/del&gt;&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;^2p&lt;/del&gt;&amp;lt;/math&amp;gt; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|| 0 &lt;/del&gt;|| &amp;lt;math&amp;gt;np&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;n \times n&amp;lt;math&amp;gt; diagonal, &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is arbitrary &amp;lt;math&amp;gt;n \times p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;^2p&lt;/ins&gt;&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(n - 1)p&lt;/ins&gt;&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;np&amp;lt;/math&amp;gt; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|| 0 &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[upper triangular matrix|upper triangular matrices]] || &amp;lt;math&amp;gt;n^&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;2(n - 1)&lt;/del&gt;&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;3&lt;/del&gt;&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n}{3&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;} - \binom{n}{2&lt;/del&gt;} = \frac{n(n-1)(n-&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;5&lt;/del&gt;)}{6}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n}{3} = \frac{n(n-1)(n-&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;2&lt;/del&gt;)}{6}&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[upper triangular matrix|upper triangular matrices]] || &amp;lt;math&amp;gt;n^&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;3&lt;/ins&gt;&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;2(n - 1)&lt;/ins&gt;&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n}{3} = \frac{n(n-1)(n-&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;2&lt;/ins&gt;)}{6}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n}{3&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;} - \binom{n}{2&lt;/ins&gt;} = \frac{n(n-1)(n-&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;5&lt;/ins&gt;)}{6}&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Vipul</name></author>
	</entry>
	<entry>
		<id>https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=7&amp;oldid=prev</id>
		<title>Vipul: /* Arithmetic complexity */</title>
		<link rel="alternate" type="text/html" href="https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=7&amp;oldid=prev"/>
		<updated>2014-04-29T02:29:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Arithmetic complexity&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:29, 29 April 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l17&quot;&gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| class=&amp;quot;sortable&amp;quot; border=&amp;quot;1&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| class=&amp;quot;sortable&amp;quot; border=&amp;quot;1&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Case !! Arithmetic description !! Number of &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;additions &lt;/del&gt;needed !! Number of &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;multiplications &lt;/del&gt;needed&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Case !! Arithmetic description !! Number of &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;multiplications &lt;/ins&gt;needed !! Number of &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;additions &lt;/ins&gt;needed  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both matrices are square matrices of the same size || &amp;lt;math&amp;gt;m = n = p&amp;lt;/math&amp;gt;; we will use &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; for these equal numbers || &amp;lt;math&amp;gt;n^2(n - 1) = n^3 - n^2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^3&lt;/del&gt;&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Both matrices are square matrices of the same size || &amp;lt;math&amp;gt;m = n = p&amp;lt;/math&amp;gt;; we will use &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; for these equal numbers &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|| &amp;lt;math&amp;gt;n^3&amp;lt;/math&amp;gt; &lt;/ins&gt;|| &amp;lt;math&amp;gt;n^2(n - 1) = n^3 - n^2&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| The first matrix is a row matrix and the second matrix is a column matrix, so the product is a &amp;lt;math&amp;gt;1 \times 1&amp;lt;/math&amp;gt; matrix and the product is a [[dot product]] || &amp;lt;math&amp;gt;m = p = 1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; can be arbitrary || &amp;lt;math&amp;gt;n &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;- 1&lt;/del&gt;&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| The first matrix is a row matrix and the second matrix is a column matrix, so the product is a &amp;lt;math&amp;gt;1 \times 1&amp;lt;/math&amp;gt; matrix and the product is a [[dot product]] || &amp;lt;math&amp;gt;m = p = 1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; can be arbitrary || &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;- 1&lt;/ins&gt;&amp;lt;/math&amp;gt;  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| The first matrix is a column matrix, the second matrix is a row matrix, so the product is a [[Hadamard product]] (outer product) || &amp;lt;math&amp;gt;n = 1&amp;lt;/math&amp;gt;; the values &amp;lt;math&amp;gt;m,p&amp;lt;/math&amp;gt; can be arbitrary &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|| 0 &lt;/del&gt;|| &amp;lt;math&amp;gt;mp&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| The first matrix is a column matrix, the second matrix is a row matrix, so the product is a [[Hadamard product]] (outer product) || &amp;lt;math&amp;gt;n = 1&amp;lt;/math&amp;gt;; the values &amp;lt;math&amp;gt;m,p&amp;lt;/math&amp;gt; can be arbitrary || &amp;lt;math&amp;gt;mp&amp;lt;/math&amp;gt; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|| 0&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| The product matrix is a square matrix || &amp;lt;math&amp;gt;m = p&amp;lt;/math&amp;gt; (we will denote this equal value as &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;); &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; can be arbitrary || &amp;lt;math&amp;gt;m^&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;2(n - 1)&lt;/del&gt;&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;m^&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;2n&lt;/del&gt;&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| The product matrix is a square matrix || &amp;lt;math&amp;gt;m = p&amp;lt;/math&amp;gt; (we will denote this equal value as &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;); &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; can be arbitrary || &amp;lt;math&amp;gt;m^&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;2n&lt;/ins&gt;&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;m^&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;2(n - 1)&lt;/ins&gt;&amp;lt;/math&amp;gt;  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Complexity allowing for parallelization===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Complexity allowing for parallelization===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Vipul</name></author>
	</entry>
	<entry>
		<id>https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=6&amp;oldid=prev</id>
		<title>Vipul: /* Variants given special structure to the matrices */</title>
		<link rel="alternate" type="text/html" href="https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=6&amp;oldid=prev"/>
		<updated>2014-04-29T02:28:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Variants given special structure to the matrices&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:28, 29 April 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l40&quot;&gt;Line 40:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 40:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If we are given prior guarantees that the matrix has a particular structure, and preferably an encoding of the matrix that exploits the structure, then even the &amp;quot;naive&amp;quot; matrix multiplication algorithm may be improvable. In particular, if we know a specific subset of the entries is guaranteed to be zero, we can save on the effort of computing the summands that are products of those terms.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If we are given prior guarantees that the matrix has a particular structure, and preferably an encoding of the matrix that exploits the structure, then even the &amp;quot;naive&amp;quot; matrix multiplication algorithm may be improvable. In particular, if we know a specific subset of the entries is guaranteed to be zero, we can save on the effort of computing the summands that are products of those terms.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{| class=&quot;sortable&quot; border=&quot;1&quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;! Type of matrices !! What naive matrix multiplication would give for number of additions if we do not take matrix structure into account!! What naive matrix multiplication would give for number of multiplications if we do not take matrix structure into account!! What naive matrix multiplication would give for number of additions if we take matrix structure into account !!  What naive matrix multiplication would give for number of multiplications if we take matrix structure into account&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|-&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[diagonal matrix|diagonal matrices]] || &amp;lt;math&amp;gt;n^2(n - 1)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^3&amp;lt;/math&amp;gt; || 0 || &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|-&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;n \times n&amp;lt;math&amp;gt; diagonal, &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is arbitrary &amp;lt;math&amp;gt;n \times p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n(n - 1)p&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^2p&amp;lt;/math&amp;gt; || 0 || &amp;lt;math&amp;gt;np&amp;lt;/math&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|-&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| Both are &amp;lt;math&amp;gt;n \times n&amp;lt;/math&amp;gt; [[upper triangular matrix|upper triangular matrices]] || &amp;lt;math&amp;gt;n^2(n - 1)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^3&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n}{3} - \binom{n}{2} = \frac{n(n-1)(n-5)}{6}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\binom{n}{3} = \frac{n(n-1)(n-2)}{6}&amp;lt;/math&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Vipul</name></author>
	</entry>
	<entry>
		<id>https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=5&amp;oldid=prev</id>
		<title>Vipul at 02:18, 29 April 2014</title>
		<link rel="alternate" type="text/html" href="https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=5&amp;oldid=prev"/>
		<updated>2014-04-29T02:18:13Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:18, 29 April 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l16&quot;&gt;Line 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Under the assumption that our algorithm allows only for the addition of numbers two at a time, the total number of additions required is &amp;lt;math&amp;gt;m(n - 1)p&amp;lt;/math&amp;gt;: To compute each entry, we need to add &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; products. This requires &amp;lt;math&amp;gt;n - 1&amp;lt;/math&amp;gt; additions (we add the first two, then the third to the sum, and so on). There are &amp;lt;math&amp;gt;mp&amp;lt;/math&amp;gt; entries in total, so we get a total addition count of &amp;lt;math&amp;gt;m(n - 1)p&amp;lt;/math&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Under the assumption that our algorithm allows only for the addition of numbers two at a time, the total number of additions required is &amp;lt;math&amp;gt;m(n - 1)p&amp;lt;/math&amp;gt;: To compute each entry, we need to add &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; products. This requires &amp;lt;math&amp;gt;n - 1&amp;lt;/math&amp;gt; additions (we add the first two, then the third to the sum, and so on). There are &amp;lt;math&amp;gt;mp&amp;lt;/math&amp;gt; entries in total, so we get a total addition count of &amp;lt;math&amp;gt;m(n - 1)p&amp;lt;/math&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{| class=&quot;sortable&quot; border=&quot;1&quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;! Case !! Arithmetic description !! Number of additions needed !! Number of multiplications needed&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|-&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| Both matrices are square matrices of the same size || &amp;lt;math&amp;gt;m = n = p&amp;lt;/math&amp;gt;; we will use &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; for these equal numbers || &amp;lt;math&amp;gt;n^2(n - 1) = n^3 - n^2&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n^3&amp;lt;/math&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|-&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| The first matrix is a row matrix and the second matrix is a column matrix, so the product is a &amp;lt;math&amp;gt;1 \times 1&amp;lt;/math&amp;gt; matrix and the product is a [[dot product]] || &amp;lt;math&amp;gt;m = p = 1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; can be arbitrary || &amp;lt;math&amp;gt;n - 1&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|-&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| The first matrix is a column matrix, the second matrix is a row matrix, so the product is a [[Hadamard product]] (outer product) || &amp;lt;math&amp;gt;n = 1&amp;lt;/math&amp;gt;; the values &amp;lt;math&amp;gt;m,p&amp;lt;/math&amp;gt; can be arbitrary || 0 || &amp;lt;math&amp;gt;mp&amp;lt;/math&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|-&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| The product matrix is a square matrix || &amp;lt;math&amp;gt;m = p&amp;lt;/math&amp;gt; (we will denote this equal value as &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;); &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; can be arbitrary || &amp;lt;math&amp;gt;m^2(n - 1)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;m^2n&amp;lt;/math&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Complexity allowing for parallelization===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Complexity allowing for parallelization===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l25&quot;&gt;Line 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 36:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In practice, no matrix multiplication algorithm would be that fast, because of communication complexity issues: it is unrealistic to expect that all the parallel processors will be able to read and write the main data at zero cost.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In practice, no matrix multiplication algorithm would be that fast, because of communication complexity issues: it is unrealistic to expect that all the parallel processors will be able to read and write the main data at zero cost.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==Variants given special structure to the matrices==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If we are given prior guarantees that the matrix has a particular structure, and preferably an encoding of the matrix that exploits the structure, then even the &quot;naive&quot; matrix multiplication algorithm may be improvable. In particular, if we know a specific subset of the entries is guaranteed to be zero, we can save on the effort of computing the summands that are products of those terms.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Vipul</name></author>
	</entry>
	<entry>
		<id>https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=4&amp;oldid=prev</id>
		<title>Vipul: Created page with &quot;==Definition==  &#039;&#039;&#039;Naive matrix multiplication&#039;&#039;&#039; refers to the naive algorithm for executing matrix multiplication: we calculate each entry as the sum of products.  Expli...&quot;</title>
		<link rel="alternate" type="text/html" href="https://linear.subwiki.org/w/index.php?title=Naive_matrix_multiplication&amp;diff=4&amp;oldid=prev"/>
		<updated>2014-04-29T02:09:49Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Definition==  &amp;#039;&amp;#039;&amp;#039;Naive matrix multiplication&amp;#039;&amp;#039;&amp;#039; refers to the naive algorithm for executing &lt;a href=&quot;/w/index.php?title=Matrix_multiplication&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Matrix multiplication (page does not exist)&quot;&gt;matrix multiplication&lt;/a&gt;: we calculate each entry as the sum of products.  Expli...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Definition==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Naive matrix multiplication&amp;#039;&amp;#039;&amp;#039; refers to the naive algorithm for executing [[matrix multiplication]]: we calculate each entry as the sum of products.&lt;br /&gt;
&lt;br /&gt;
Explicitly, suppose &amp;lt;math&amp;gt;A = (a_{ij})_{1 \le i \le m, 1 \le j \le n}&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;m \times n&amp;lt;/math&amp;gt; matrix and &amp;lt;math&amp;gt;B = (b_{jk})_{1 \le j \le n, 1 \le k \le p}&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;n \times p&amp;lt;/math&amp;gt; matrix, and denote by &amp;lt;math&amp;gt;C = (c_{ik})_{1 \le i \le m, 1 \le k \le p}&amp;lt;/math&amp;gt; the product of the matrices. We then have the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;c_{ik} = \sum_{j=1}^n a_{ij}b_{jk}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In other words, each entry of the product is computed as a sum of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; pairwise products.&lt;br /&gt;
&lt;br /&gt;
==Arithmetic complexity==&lt;br /&gt;
&lt;br /&gt;
===Complexity for the serial algorithm without parallelization===&lt;br /&gt;
&lt;br /&gt;
* The total number of multiplications is &amp;lt;math&amp;gt;mnp&amp;lt;/math&amp;gt;: there are &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; multiplications required to calculate each entry, and there are &amp;lt;math&amp;gt;mp&amp;lt;/math&amp;gt; entries to be calculated.&lt;br /&gt;
* Under the assumption that our algorithm allows only for the addition of numbers two at a time, the total number of additions required is &amp;lt;math&amp;gt;m(n - 1)p&amp;lt;/math&amp;gt;: To compute each entry, we need to add &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; products. This requires &amp;lt;math&amp;gt;n - 1&amp;lt;/math&amp;gt; additions (we add the first two, then the third to the sum, and so on). There are &amp;lt;math&amp;gt;mp&amp;lt;/math&amp;gt; entries in total, so we get a total addition count of &amp;lt;math&amp;gt;m(n - 1)p&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Complexity allowing for parallelization===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;arithmetic&amp;#039;&amp;#039; complexity allowing parallelization (ignoring communication complexity issues entirely) is &amp;lt;math&amp;gt;\lceil \log_2n \rceil&amp;lt;/math&amp;gt;. The reasoning is as follows:&lt;br /&gt;
&lt;br /&gt;
* The computations of all the matrix entries can be done in parallel, because the computations for the entries do not depend on each other.&lt;br /&gt;
* For computing a given entry, all the computations of the products being added can be done in parallel. Combined with the preceding observation, we obtain that all the &amp;lt;math&amp;gt;mnp&amp;lt;/math&amp;gt; multiplications can be performed in parallel.&lt;br /&gt;
* The only thing that cannot be completely parallelized is the addition step. However, this too can be partly parallelized. We can divide the list of terms to be added into two halves, sum them up, and combine. By iterating this process of dividing in halves and adding, we can encode the parallelized addition using a binary tree. The arithmetic time complexity is then given by the depth of the tree, which is &amp;lt;math&amp;gt;\lceil \log_2n \rceil&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In practice, no matrix multiplication algorithm would be that fast, because of communication complexity issues: it is unrealistic to expect that all the parallel processors will be able to read and write the main data at zero cost.&lt;/div&gt;</summary>
		<author><name>Vipul</name></author>
	</entry>
</feed>