89 subroutine formk(n, nsub, ind, nenter, ileave, indx2, iupdat,
90 + updatd, wn, wn1, m, ws, wy, sy, theta, col,
93 integer n, nsub, m, col, head, nenter, ileave, iupdat,
94 + info, ind(n), indx2(n)
95 double precision theta, wn(2*m, 2*m), wn1(2*m, 2*m),
96 + ws(n, m), wy(n, m), sy(m, m)
124 integer m2,ipntr,jpntr,iy,is,jy,js,is1,js1,k1,i,k,
125 + col2,pbegin,pend,dbegin,dend,upcl
126 double precision ddot,temp1,temp2,temp3,temp4
127 double precision one,zero
128 parameter(one=1.0d0,zero=0.0d0)
137 if (iupdat .gt. m)
then
141 call dcopy(m-jy,wn1(jy+1,jy+1),1,wn1(jy,jy),1)
142 call dcopy(m-jy,wn1(js+1,js+1),1,wn1(js,js),1)
143 call dcopy(m-1,wn1(m+2,jy+1),1,wn1(m+1,jy),1)
154 ipntr = head + col - 1
155 if (ipntr .gt. m) ipntr = ipntr - m
163 do 15 k = pbegin, pend
165 temp1 = temp1 + wy(k1,ipntr)*wy(k1,jpntr)
168 do 16 k = dbegin, dend
170 temp2 = temp2 + ws(k1,ipntr)*ws(k1,jpntr)
171 temp3 = temp3 + ws(k1,ipntr)*wy(k1,jpntr)
176 jpntr = mod(jpntr,m) + 1
181 jpntr = head + col - 1
182 if (jpntr .gt. m) jpntr = jpntr - m
188 do 25 k = pbegin, pend
190 temp3 = temp3 + ws(k1,ipntr)*wy(k1,jpntr)
192 ipntr = mod(ipntr,m) + 1
214 temp1 = temp1 + wy(k1,ipntr)*wy(k1,jpntr)
215 temp2 = temp2 + ws(k1,ipntr)*ws(k1,jpntr)
219 temp3 = temp3 + wy(k1,ipntr)*wy(k1,jpntr)
220 temp4 = temp4 + ws(k1,ipntr)*ws(k1,jpntr)
222 wn1(iy,jy) = wn1(iy,jy) + temp1 - temp3
223 wn1(is,js) = wn1(is,js) - temp2 + temp4
224 jpntr = mod(jpntr,m) + 1
226 ipntr = mod(ipntr,m) + 1
231 do 60 is = m + 1, m + upcl
238 temp1 = temp1 + ws(k1,ipntr)*wy(k1,jpntr)
242 temp3 = temp3 + ws(k1,ipntr)*wy(k1,jpntr)
244 if (is .le. jy + m)
then
245 wn1(is,jy) = wn1(is,jy) + temp1 - temp3
247 wn1(is,jy) = wn1(is,jy) - temp1 + temp3
249 jpntr = mod(jpntr,m) + 1
251 ipntr = mod(ipntr,m) + 1
264 wn(jy,iy) = wn1(iy,jy)/theta
265 wn(js,is) = wn1(is1,js1)*theta
268 wn(jy,is) = -wn1(is1,jy)
271 wn(jy,is) = wn1(is1,jy)
273 wn(iy,iy) = wn(iy,iy) + sy(iy,iy)
282 call dpotrf(
'U',col,wn,m2,info)
284 if (info .ne. 0)
then
290 do 71 js = col+1 ,col2
294 call dtrsm(
'l',
'u',
't',
'n',col,1,one,wn,m2,wn(1,js),col)
301 do 72 is = col+1, col2
303 wn(is,js) = wn(is,js) + ddot(col,wn(1,is),1,wn(1,js),1)
310 call dpotrf(
'U',col,wn(col+1,col+1),m2,info)
312 if (info .ne. 0)
then