<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Large Computation of 4x4 Matrices</title>
    <link>http://www.mapleprimes.com/questions/97092-Large-Computation-Of-4x4-Matrices</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Sat, 13 Jun 2026 20:01:16 GMT</lastBuildDate>
    <pubDate>Sat, 13 Jun 2026 20:01:16 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Large Computation of 4x4 Matrices</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Large Computation of 4x4 Matrices</title>
      <link>http://www.mapleprimes.com/questions/97092-Large-Computation-Of-4x4-Matrices</link>
    </image>
    <item>
      <title>Try dynamic programming</title>
      <link>http://www.mapleprimes.com/questions/97092-Large-Computation-Of-4x4-Matrices?ref=Feed:MaplePrimes:Large Computation of 4x4 Matrices:Comments#answer97094</link>
      <itunes:summary>&lt;p&gt;Sounds like a problem with lots of repeated calculations.&amp;nbsp; Can you figure out a way to structure the mulitplications so you can reuse intermediate results?&lt;/p&gt;
&lt;p&gt;See https://secure.wikimedia.org/wikipedia/en/wiki/Dynamic_programming&lt;/p&gt;
&lt;p&gt;Darin&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;-- Kernel Developer Maplesoft&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Sounds like a problem with lots of repeated calculations.&amp;nbsp; Can you figure out a way to structure the mulitplications so you can reuse intermediate results?&lt;/p&gt;
&lt;p&gt;See https://secure.wikimedia.org/wikipedia/en/wiki/Dynamic_programming&lt;/p&gt;
&lt;p&gt;Darin&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;-- Kernel Developer Maplesoft&lt;/p&gt;</description>
      <guid>97094</guid>
      <pubDate>Tue, 21 Sep 2010 19:50:25 Z</pubDate>
      <itunes:author>dohashi</itunes:author>
      <author>dohashi</author>
    </item>
    <item>
      <title>product of matrices</title>
      <link>http://www.mapleprimes.com/questions/97092-Large-Computation-Of-4x4-Matrices?ref=Feed:MaplePrimes:Large Computation of 4x4 Matrices:Comments#answer97095</link>
      <itunes:summary>&lt;p&gt;You didn't attach any code. But here's a simple way to do it.&lt;/p&gt;
&lt;pre&gt;&amp;gt; with(LinearAlgebra):&lt;br&gt;&amp;nbsp;&amp;nbsp; M:= [seq(RandomMatrix(4,4), i=1..8)];&lt;br&gt;&amp;nbsp;&amp;nbsp; for p in combinat[permute](8) do&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; M[p[1]] . M[p[2]] . M[p[3]] . M[p[4]] . M[p[5]] . M[p[6]] . M[p[7]] . M[p[8]]&lt;br&gt;&amp;nbsp;&amp;nbsp; end do:&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;This took over 555 seconds of CPU time on my computer.&lt;br&gt;&lt;br&gt;A slightly more sophisticated way would be to build up a tree of products.&amp;nbsp; This would reduce the number of matrix &lt;br&gt;multiplications needed from 7*8! = 282240 to 8!/6! + ... + 8!/1! = 69272&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre&gt;&amp;gt; for i from 1 to 8 do P[[i]]:= M[i] end do:&lt;br&gt;for r from 2 to 8 do&lt;br&gt;&amp;nbsp; for p in combinat[permute](8, r) do&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; P[p]:= P[p[1..r-1]] . M[p[r]]&lt;br&gt;&amp;nbsp; end do&lt;br&gt;end do:&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;This took just under 40 seconds.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;You didn't attach any code. But here's a simple way to do it.&lt;/p&gt;
&lt;pre&gt;&amp;gt; with(LinearAlgebra):&lt;br&gt;&amp;nbsp;&amp;nbsp; M:= [seq(RandomMatrix(4,4), i=1..8)];&lt;br&gt;&amp;nbsp;&amp;nbsp; for p in combinat[permute](8) do&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; M[p[1]] . M[p[2]] . M[p[3]] . M[p[4]] . M[p[5]] . M[p[6]] . M[p[7]] . M[p[8]]&lt;br&gt;&amp;nbsp;&amp;nbsp; end do:&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;This took over 555 seconds of CPU time on my computer.&lt;br&gt;&lt;br&gt;A slightly more sophisticated way would be to build up a tree of products.&amp;nbsp; This would reduce the number of matrix &lt;br&gt;multiplications needed from 7*8! = 282240 to 8!/6! + ... + 8!/1! = 69272&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre&gt;&amp;gt; for i from 1 to 8 do P[[i]]:= M[i] end do:&lt;br&gt;for r from 2 to 8 do&lt;br&gt;&amp;nbsp; for p in combinat[permute](8, r) do&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; P[p]:= P[p[1..r-1]] . M[p[r]]&lt;br&gt;&amp;nbsp; end do&lt;br&gt;end do:&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;This took just under 40 seconds.&lt;/p&gt;</description>
      <guid>97095</guid>
      <pubDate>Tue, 21 Sep 2010 19:57:00 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
  </channel>
</rss>