L-BFGS-B  3.0
Large-scale Bound-constrained Optimization
bmv.f
Go to the documentation of this file.
1 c> \file bmv.f
2 
3 c> \brief This subroutine computes the product of the 2m x 2m middle matrix
4 c> in the compact L-BFGS formula of B and a 2m vector v.
5 c>
6 c> This subroutine computes the product of the 2m x 2m middle matrix
7 c> in the compact L-BFGS formula of B and a 2m vector v;
8 c> it returns the product in p.
9 c>
10 c> @param m On entry m is the maximum number of variable metric corrections
11 c> used to define the limited memory matrix.<br/>
12 c> On exit m is unchanged.
13 c>
14 c> @param sy On entry sy specifies the matrix S'Y.<br/>
15 c> On exit sy is unchanged.
16 c>
17 c> @param wt On entry wt specifies the upper triangular matrix J' which is
18 c> the Cholesky factor of (thetaS'S+LD^(-1)L').<br/>
19 c> On exit wt is unchanged.
20 c>
21 c> @param col On entry col specifies the number of s-vectors (or y-vectors)
22 c> stored in the compact L-BFGS formula.<br/>
23 c> On exit col is unchanged.
24 c>
25 c> @param v On entry v specifies vector v.<br/>
26 c> On exit v is unchanged.
27 c>
28 c> @param p On entry p is unspecified.<br/>
29 c> On exit p is the product Mv.
30 c>
31 c> Historical note: this routine used to take an `info` output parameter
32 c> for the LINPACK `dtrsl` triangular-solve return status. Since LAPACK's
33 c> `dtrsm` replacement cannot fail on a non-singular triangular factor
34 c> (and `formt` ensures `wt` is non-singular), the parameter was always
35 c> 0 on exit and has been removed.
36  subroutine bmv(m, sy, wt, col, v, p)
37 
38  integer m, col
39  double precision sy(m, m), wt(m, m), v(2*col), p(2*col)
40 
41 c
42 c * * *
43 c
44 c NEOS, November 1994. (Latest revision June 1996.)
45 c Optimization Technology Center.
46 c Argonne National Laboratory and Northwestern University.
47 c Written by
48 c Ciyou Zhu
49 c in collaboration with R.H. Byrd, P. Lu-Chen and J. Nocedal.
50 c
51 c
52 c ************
53 
54  integer i,k,i2
55  double precision sum,one
56  parameter(one=1.0d0)
57 
58  if (col .eq. 0) return
59 
60 c PART I: solve [ D^(1/2) O ] [ p1 ] = [ v1 ]
61 c [ -L*D^(-1/2) J ] [ p2 ] [ v2 ].
62 
63 c solve Jp2=v2+LD^(-1)v1.
64  p(col + 1) = v(col + 1)
65  do 20 i = 2, col
66  i2 = col + i
67  sum = 0.0d0
68  do 10 k = 1, i - 1
69  sum = sum + sy(i,k)*v(k)/sy(k,k)
70  10 continue
71  p(i2) = v(i2) + sum
72  20 continue
73 c Solve the triangular system
74  call dtrsm('l','u','t','n',col,1,one,wt,m,p(col+1),col)
75 
76 c solve D^(1/2)p1=v1.
77  do 30 i = 1, col
78  p(i) = v(i)/sqrt(sy(i,i))
79  30 continue
80 
81 c PART II: solve [ -D^(1/2) D^(-1/2)*L' ] [ p1 ] = [ p1 ]
82 c [ 0 J' ] [ p2 ] [ p2 ].
83 
84 c solve J^Tp2=p2.
85  call dtrsm('l','u','n','n',col,1,one,wt,m,p(col+1),col)
86 
87 c compute p1=-D^(-1/2)(p1-D^(-1/2)L'p2)
88 c =-D^(-1/2)p1+D^(-1)L'p2.
89  do 40 i = 1, col
90  p(i) = -p(i)/sqrt(sy(i,i))
91  40 continue
92  do 60 i = 1, col
93  sum = 0.d0
94  do 50 k = i + 1, col
95  sum = sum + sy(k,i)*p(col+k)/sy(i,i)
96  50 continue
97  p(i) = p(i) + sum
98  60 continue
99 
100  return
101 
102  end
subroutine bmv(m, sy, wt, col, v, p)
This subroutine computes the product of the 2m x 2m middle matrix in the compact L-BFGS formula of B ...
Definition: bmv.f:37