Path: 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 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