L-BFGS-B  3.0
Large-scale Bound-constrained Optimization
cmprlb.f
Go to the documentation of this file.
1 c> \file cmprlb.f
2 
3 c> \brief This subroutine computes r=-Z'B(xcp-xk)-Z'g by using
4 c> wa(2m+1)=W'(xcp-x) from subroutine cauchy.
5 c>
6 c> This subroutine computes r=-Z'B(xcp-xk)-Z'g by using
7 c> wa(2m+1)=W'(xcp-x) from subroutine cauchy.
8 c>
9 c> @param n number of parameters
10 c> @param m history size of Hessian approximation
11 c> @param x position
12 c> @param g gradient
13 c> @param ws part of L-BFGS matrix
14 c> @param wy part of L-BFGS matrix
15 c> @param sy part of L-BFGS matrix
16 c> @param wt part of L-BFGS matrix
17 c> @param z TODO
18 c> @param r TODO
19 c> @param wa TODO
20 c> @param index TODO
21 c> @param theta TODO
22 c> @param col TODO
23 c> @param head TODO
24 c> @param nfree TODO
25 c> @param cnstnd TODO
26 c> @param info TODO
27  subroutine cmprlb(n, m, x, g, ws, wy, sy, wt, z, r, wa, index,
28  + theta, col, head, nfree, cnstnd, info)
29 
30  logical cnstnd
31  integer n, m, col, head, nfree, info, index(n)
32  double precision theta,
33  + x(n), g(n), z(n), r(n), wa(4*m),
34  + ws(n, m), wy(n, m), sy(m, m), wt(m, m)
35 c
36 c * * *
37 c
38 c NEOS, November 1994. (Latest revision June 1996.)
39 c Optimization Technology Center.
40 c Argonne National Laboratory and Northwestern University.
41 c Written by
42 c Ciyou Zhu
43 c in collaboration with R.H. Byrd, P. Lu-Chen and J. Nocedal.
44 c
45 c
46 c ************
47 
48  integer i,j,k,pointr
49  double precision a1,a2
50 
51  if (.not. cnstnd .and. col .gt. 0) then
52  do 26 i = 1, n
53  r(i) = -g(i)
54  26 continue
55  else
56  do 30 i = 1, nfree
57  k = index(i)
58  r(i) = -theta*(z(k) - x(k)) - g(k)
59  30 continue
60  call bmv(m,sy,wt,col,wa(2*m+1),wa(1),info)
61  if (info .ne. 0) then
62  info = -8
63  return
64  endif
65  pointr = head
66  do 34 j = 1, col
67  a1 = wa(j)
68  a2 = theta*wa(col + j)
69  do 32 i = 1, nfree
70  k = index(i)
71  r(i) = r(i) + wy(k,pointr)*a1 + ws(k,pointr)*a2
72  32 continue
73  pointr = mod(pointr,m) + 1
74  34 continue
75  endif
76 
77  return
78 
79  end
subroutine bmv(m, sy, wt, col, v, p, info)
This subroutine computes the product of the 2m x 2m middle matrix in the compact L-BFGS formula of B ...
Definition: bmv.f:36
subroutine cmprlb(n, m, x, g, ws, wy, sy, wt, z, r, wa, index, theta, col, head, nfree, cnstnd, info)
This subroutine computes r=-Z'B(xcp-xk)-Z'g by using wa(2m+1)=W'(xcp-x) from subroutine cauchy.
Definition: cmprlb.f:29