From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,701270dccdaf7b2,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-31 18:32:46 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.stueberl.de!newspeer1-gui.server.ntli.net!ntli.net!newsfep4-glfd.server.ntli.net.POSTED!53ab2750!not-for-mail From: "chris.danx" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030507 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: In place matrix multiplication? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <1JcCa.16479$Mu3.361103@newsfep4-glfd.server.ntli.net> Date: Sun, 01 Jun 2003 02:35:18 +0200 NNTP-Posting-Host: 81.107.63.23 X-Complaints-To: abuse@ntlworld.com X-Trace: newsfep4-glfd.server.ntli.net 1054431165 81.107.63.23 (Sun, 01 Jun 2003 02:32:45 BST) NNTP-Posting-Date: Sun, 01 Jun 2003 02:32:45 BST Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:38258 Date: 2003-06-01T02:35:18+02:00 List-Id: Hi, Does anyone know how to do this? At first I thought it'd be something along the lines of... procedure Multiply (A : in out Matrix; B : in Matrix) is T : Scalar; Z : Scalar := Create(0); begin for rCount in Matrix_Size'range loop for cCount in Matrix_Size'range loop T := Z; for iCount in Matrix'range loop T := T + A.Mx(rCount, iCount) * B.Mx(iCount, cCount); end loop; A.Mx(rCount, iCount) := T; end loop; end loop; end Multiply; But this is obviously wrong. Is there an algorithm to do this? I googled for it, but haven't found anything yet. I gather it's possible because some libraries do it. They just don't say how they do so. Cheers, Chris