comp.lang.ada
 help / color / mirror / Atom feed
* In place matrix multiplication?
@ 2003-06-01  0:35 chris.danx
  2003-06-01  9:18 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 4+ messages in thread
From: chris.danx @ 2003-06-01  0:35 UTC (permalink / raw)


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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-06-01 14:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-01  0:35 In place matrix multiplication? chris.danx
2003-06-01  9:18 ` Dmitry A. Kazakov
2003-06-01 12:54   ` chris.danx
2003-06-01 14:26     ` Bill Findlay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox