L-BFGS-B  3.0
Large-scale Bound-constrained Optimization
formt.f
Go to the documentation of this file.
1 c> \file formt.f
2 
3 c> \brief Forms the upper half of the pos. def. and symm. T.
4 c>
5 c> This subroutine forms the upper half of the pos. def. and symm.
6 c> T = theta*SS + L*D^(-1)*L', stores T in the upper triangle
7 c> of the array wt, and performs the Cholesky factorization of T
8 c> to produce J*J', with J' stored in the upper triangle of wt.
9 c>
10 c> @param m history size of approximated Hessian
11 c> @param wt part of L-BFGS matrix
12 c> @param sy part of L-BFGS matrix
13 c> @param ss part of L-BFGS matrix
14 c> @param col On entry col is the actual number of variable metric
15 c> corrections stored so far.<br/>
16 c> On exit col is unchanged.
17 c> @param theta On entry theta is the scaling factor specifying B_0 = theta I.<br/>
18 c> On exit theta is unchanged.
19 c>
20 c> @param info error/success indicator
21  subroutine formt(m, wt, sy, ss, col, theta, info)
22 
23  integer m, col, info
24  double precision theta, wt(m, m), sy(m, m), ss(m, m)
25 c
26 c * * *
27 c
28 c NEOS, November 1994. (Latest revision June 1996.)
29 c Optimization Technology Center.
30 c Argonne National Laboratory and Northwestern University.
31 c Written by
32 c Ciyou Zhu
33 c in collaboration with R.H. Byrd, P. Lu-Chen and J. Nocedal.
34 c
35 c
36 c ************
37 
38  integer i,j,k,k1
39  double precision ddum
40  double precision zero
41  parameter(zero=0.0d0)
42 
43 
44 c Form the upper half of T = theta*SS + L*D^(-1)*L',
45 c store T in the upper triangle of the array wt.
46 
47  do 52 j = 1, col
48  wt(1,j) = theta*ss(1,j)
49  52 continue
50  do 55 i = 2, col
51  do 54 j = i, col
52  k1 = min(i,j) - 1
53  ddum = zero
54  do 53 k = 1, k1
55  ddum = ddum + sy(i,k)*sy(j,k)/sy(k,k)
56  53 continue
57  wt(i,j) = ddum + theta*ss(i,j)
58  54 continue
59  55 continue
60 
61 c Cholesky factorize T to J*J' with
62 c J' stored in the upper triangle of wt.
63 
64  !call dpofa(wt,m,col,info)
65  call dpotrf('U',col,wt,m,info)
66  if (info .ne. 0) then
67  info = -3
68  endif
69 
70  return
71 
72  end
subroutine formt(m, wt, sy, ss, col, theta, info)
Forms the upper half of the pos. def. and symm. T.
Definition: formt.f:22