Our ultimate refinement is to re-analyse the termination
conditions since they were derived for the algorithm using a for
loop. In this case as soon as symmetric turns false the two while
loops will terminate. Therefore we do not need to and it nor use
an if construct to get it. We can do a simple assignment.
Therefore our final solution is:
symmetrictrue
row1
while symmetric and row <= size-1 do
columnrow+1
while symmetric and column <=size do
symmetrica[row,column]=a[column,row]
columncolumn +1
endwhile
rowrow +1
endwhile
for(row=0;(row<size-1) && symmetric; row++)
: