On Sat, 16 Jun 2001, Miklos Cserzo wrote:
The maximal size of my array is 2000x2000.
X:array[1..N,1..M] of real; A:array[1..N] of real; B:array[1..M] of real;
for i:= 1 to N do for j:= 1 to M do begin A[i]:= A[i] + X[i,j]; B[j]:= B[j] + X[i,j]; end;
Taking evaluating a subscript out of the inner loop might be a tad faster:
for i:= 1 to N do begin temp := 0; { or temp := A[i] if A[i] preloaded with non zero} for j := 1 to M do begin temp := temp + X[i,j]; B[j] := B[j] + X[i,j]; end; A[i] := temp; end;
Russ