126 subroutine subsm ( n, m, nsub, ind, l, u, nbd, x, d, xp, ws, wy,
128 + col, head, iword, wv, wn, iprint )
130 integer n, m, nsub, col, head, iword, iprint,
132 double precision theta,
133 + l(n), u(n), x(n), d(n), xp(n), xx(n), gg(n),
134 + ws(n, m), wy(n, m),
135 + wv(2*m), wn(2*m, 2*m)
176 integer pointr,m2,col2,ibd,jy,js,i,j,k
177 double precision alpha, xk, dk, temp1, temp2
178 double precision one,zero
179 parameter(one=1.0d0,zero=0.0d0)
181 double precision dd_p
183 if (nsub .le. 0)
return
184 if (iprint .ge. 99)
write (6,1001)
194 temp1 = temp1 + wy(k,pointr)*d(j)
195 temp2 = temp2 + ws(k,pointr)*d(j)
198 wv(col + i) = theta*temp2
199 pointr = mod(pointr,m) + 1
207 call dtrsm(
'l',
'u',
't',
'n',col2,1,one,wn,m2,wv,col2)
213 call dtrsm(
'l',
'u',
'n',
'n',col2,1,one,wn,m2,wv,col2)
222 d(i) = d(i) + wy(k,pointr)*wv(jy)/theta
223 + + ws(k,pointr)*wv(js)
225 pointr = mod(pointr,m) + 1
228 call dscal( nsub, one/theta, d, 1 )
235 call dcopy ( n, x, 1, xp, 1 )
241 if ( nbd(k) .ne. 0 )
then
243 if ( nbd(k).eq.1 )
then
244 x(k) = max( l(k), xk + dk )
245 if ( x(k).eq.l(k) ) iword = 1
248 if ( nbd(k).eq.2 )
then
249 xk = max( l(k), xk + dk )
250 x(k) = min( u(k), xk )
251 if ( x(k).eq.l(k) .or. x(k).eq.u(k) ) iword = 1
254 if ( nbd(k).eq.3 )
then
255 x(k) = min( u(k), xk + dk )
256 if ( x(k).eq.u(k) ) iword = 1
266 if ( iword.eq.0 )
then
274 dd_p = dd_p + (x(i) - xx(i))*gg(i)
276 if ( dd_p .gt.zero )
then
277 call dcopy( n, xp, 1, x, 1 )
278 write(6,*)
' Positive dir derivative in projection '
279 write(6,*)
' Using the backtracking step '
292 if (nbd(k) .ne. 0)
then
293 if (dk .lt. zero .and. nbd(k) .le. 2)
then
295 if (temp2 .ge. zero)
then
297 else if (dk*alpha .lt. temp2)
then
300 else if (dk .gt. zero .and. nbd(k) .ge. 2)
then
302 if (temp2 .le. zero)
then
304 else if (dk*alpha .gt. temp2)
then
308 if (temp1 .lt. alpha)
then
315 if (alpha .lt. one)
then
318 if (dk .gt. zero)
then
321 else if (dk .lt. zero)
then
328 x(k) = x(k) + alpha*d(i)
333 if (iprint .ge. 99)
write (6,1004)
335 1001
format (/,
'----------------SUBSM entered-----------------',/)
336 1004
format (/,
'----------------exit SUBSM --------------------',/)
subroutine subsm(n, m, nsub, ind, l, u, nbd, x, d, xp, ws, wy, theta, xx, gg, col, head, iword, wv, wn, iprint)
Performs the subspace minimization.