a=,il=-i{- end for nd if end if (iii)currentcurrent+I end f d fo (2)for counter=l to 2p-2 do *进行2p2次处理器间的数据交换,并对交换后处理器中所有行两两配对 进行旋转变换* (2.1) Data exchange()/处理器间的数据交换* (2.2)for i=0 to m/2-1 do for j=m/2 to m-I do (i)if(a[i,b]≠0)then/*对四个主元素的旋转变换* ①Com f-a[i, bll, g=(al, bll-ali, b[aD)/2 sgn(g)*sgp(升+g*g), sin2=h, sinl=h/sqrt(2*(1+sgr(1-h*h))) bpp=a[i, b[i*cosl*cosl+ a[, bll*sinl*sinl+a[i, b00*sin2 bgg=a[i, b[il* sinl*sinl+al, b l]*cosl *cosl-a[i, b0)*sin2 bpo, bgp=0 ②fory=0ton-1do/*对两个主行其余元素的旋转变换 if((v≠band(v≠bU])then brlv]=a[i, v*cosl +al, v]*sinl al, v]=-a[i, v]* sin1 +al, v]*cosl end if end for ③for= if(v≠b[)and(v≠b))then ali, vI=brlvl end if end for ④for1=0tom-1 /*对本处理器内两个主列的其余元素旋转变换 if(v≠)and(v≠))then biv]=av, b[i*cosl +av, blJ*sin a{v,b]]=-a[v,b[小*sin1+av,b]°cosl end for ⑤for=0tom-ldo if((v≠D)and(V≠)then Iv, ba=bilva[z,i1]= zi[z] end for end if end if (iii)current=current+1 end for end for end for (2)for counter=1 to 2p-2 do /*进行 2p-2 次处理器间的数据交换, 并对交换后处理器中所有行两两配对 进行旋转变换*/ (2.1)Data_exchange( ) /*处理器间的数据交换*/ (2.2)for i=0 to m/2-1 do for j=m/2 to m-1 do (i) if (a[i,b[j]] ≠ 0) then /*对四个主元素的旋转变换*/ ①Compute: f= -a[i,b[j]],g=(a[j,b[j]]- a[i,b[i]])/2, h=sgn(g)*f/sqrt(f*f+g*g), sin2=h, sin1=h/sqrt(2*(1+sqrt(1-h*h))), cos1=sqrt(1-sin1*sin1), bpp= a[i,b[i]]*cos1*cos1+ a[j,b[j]]*sin1*sin1+a[i,b[j]]*sin2, bqq= a[i,b[i]]* sin1*sin1+a[j,b[j]]* cos1*cos1-a[i,b[j]]*sin2, bpq=0, bqp=0 ②for v=0 to n-1 do /*对两个主行其余元素的旋转变换*/ if ((v ≠ b[i]) and ( v ≠ b[j])) then br[v] = a[i,v]*cos1 + a[j,v]*sin1 a[j,v] = -a[i,v]* sin1 + a[j,v]* cos1 end if end for ③for v=0 to n-1 do if ((v ≠ b[i]) and ( v ≠ b[j])) then a[i,v]=br[v] end if end for ④for v=0 to m-1 do /*对本处理器内两个主列的其余元素旋转变换*/ if ((v ≠ i) and ( v ≠ j)) then bi[v] = a[v, b[i]]*cos1 + a[v, b[j]]*sin1 a[v, b[j]] = - a[v, b[i]]* sin1 + a[v, b[j]]* cos1 end if end for ⑤for v=0 to m-1 do if ((v ≠ i) and ( v ≠ j)) then a[v, b[i]]=bi[v]