Article View: comp.lang.fortran
Article #6461Re: Implied do-loop statement, for the next FORTRAN?
From: Jim Giles
Date: Mon, 05 Mar 1990 07:00
Date: Mon, 05 Mar 1990 07:00
18 lines
927 bytes
927 bytes
From article <2044.25efa542@admdev.cut.oz>, by Clifton_RL@admdev.cut.oz:
> IMPLIED DO-LOOP STATEMENT
> [...]
> (((C(I,J)=A(I,K)*B(K,J) ,K=1,M) ,I=1,M) ,J=1,M)
You probably intended this to be:
((C(I,J)=0, I=1,M), J=1,M)
(((C(I,J)=C(I,J)+A(I,K)*B(K,J), I=1,M), J=1,M), K=1,M)
Your code just redefines each element of C M times. Further, the loop
vectorizes better with the sum on the OUTER loop. Why not just overload
the multiply operator on MATRIX type variables and say:
C = A*B
and declare A, B, and C as type MATRIX?
J. Giles
Technical Details
Message-ID:
<14259@lambda.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!yale!cmcl2!lanl!lambda!jlgReferences:
<2044.25efa542@admdev.cut.oz>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!yale!cmcl2!lanl!lambda!jlg From: jlg@lambda.UUCP (Jim Giles) Newsgroups: comp.lang.fortran Subject: Re: Implied do-loop statement, for the next FORTRAN? Message-ID: <14259@lambda.UUCP> Date: 5 Mar 90 07:00:55 GMT References: <2044.25efa542@admdev.cut.oz> Lines: 18