124 subroutine subsm ( n, m, nsub, ind, l, u, nbd, x, d, xp, ws, wy,
126 + col, head, iword, wv, wn, iprint, info )
128 integer n, m, nsub, col, head, iword, iprint, info,
130 double precision theta,
131 + l(n), u(n), x(n), d(n), xp(n), xx(n), gg(n),
132 + ws(n, m), wy(n, m),
133 + wv(2*m), wn(2*m, 2*m)
174 integer pointr,m2,col2,ibd,jy,js,i,j,k
175 double precision alpha, xk, dk, temp1, temp2
176 double precision one,zero
177 parameter(one=1.0d0,zero=0.0d0)
179 double precision dd_p
181 if (nsub .le. 0)
return
182 if (iprint .ge. 99)
write (6,1001)
192 temp1 = temp1 + wy(k,pointr)*d(j)
193 temp2 = temp2 + ws(k,pointr)*d(j)
196 wv(col + i) = theta*temp2
197 pointr = mod(pointr,m) + 1
207 call dtrsm(
'l',
'u',
't',
'n',col2,1,one,wn,m2,wv,col2)
216 call dtrsm(
'l',
'u',
'n',
'n',col2,1,one,wn,m2,wv,col2)
226 d(i) = d(i) + wy(k,pointr)*wv(jy)/theta
227 + + ws(k,pointr)*wv(js)
229 pointr = mod(pointr,m) + 1
232 call dscal( nsub, one/theta, d, 1 )
239 call dcopy ( n, x, 1, xp, 1 )
245 if ( nbd(k) .ne. 0 )
then
247 if ( nbd(k).eq.1 )
then
248 x(k) = max( l(k), xk + dk )
249 if ( x(k).eq.l(k) ) iword = 1
252 if ( nbd(k).eq.2 )
then
253 xk = max( l(k), xk + dk )
254 x(k) = min( u(k), xk )
255 if ( x(k).eq.l(k) .or. x(k).eq.u(k) ) iword = 1
258 if ( nbd(k).eq.3 )
then
259 x(k) = min( u(k), xk + dk )
260 if ( x(k).eq.u(k) ) iword = 1
270 if ( iword.eq.0 )
then
278 dd_p = dd_p + (x(i) - xx(i))*gg(i)
280 if ( dd_p .gt.zero )
then
281 call dcopy( n, xp, 1, x, 1 )
282 write(6,*)
' Positive dir derivative in projection '
283 write(6,*)
' Using the backtracking step '
296 if (nbd(k) .ne. 0)
then
297 if (dk .lt. zero .and. nbd(k) .le. 2)
then
299 if (temp2 .ge. zero)
then
301 else if (dk*alpha .lt. temp2)
then
304 else if (dk .gt. zero .and. nbd(k) .ge. 2)
then
306 if (temp2 .le. zero)
then
308 else if (dk*alpha .gt. temp2)
then
312 if (temp1 .lt. alpha)
then
319 if (alpha .lt. one)
then
322 if (dk .gt. zero)
then
325 else if (dk .lt. zero)
then
332 x(k) = x(k) + alpha*d(i)
337 if (iprint .ge. 99)
write (6,1004)
339 1001
format (/,
'----------------SUBSM entered-----------------',/)
340 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, info)
Performs the subspace minimization.