| 1 |
|
| 2 |
L-BFGS-B is released under the “New BSD License” (aka “Modified BSD License” or |
| 3 |
“3-clause license”) |
| 4 |
Please read attached file License.txt |
| 5 |
|
| 6 |
L-BFGS-B (version 3.0) march, 2011 |
| 7 |
|
| 8 |
This directory contains the modified/corrected limited memory |
| 9 |
code for solving bound constrained optimization problems. |
| 10 |
|
| 11 |
_______________________________________________________________________ |
| 12 |
|
| 13 |
o f77 routines |
| 14 |
|
| 15 |
blas.f subset of blas |
| 16 |
linpack.f subset of linpack |
| 17 |
lbfgsb.f main routine |
| 18 |
timer.f routine to compute CPU time |
| 19 |
|
| 20 |
o f77 and f90 drivers |
| 21 |
|
| 22 |
driver1.f driver1.f90 |
| 23 |
driver2.f driver2.f90 |
| 24 |
driver3.f driver3.f90 |
| 25 |
|
| 26 |
We recommend that the user read driver1.f/driver1.f90, which |
| 27 |
give a good idea of how the code works |
| 28 |
|
| 29 |
o Makefile Linux/Unix users. |
| 30 |
|
| 31 |
To run the code on a Linux/Unix machine simply type |
| 32 |
|
| 33 |
make |
| 34 |
|
| 35 |
This will create the files |
| 36 |
|
| 37 |
x.lbfgsb_77_1 x.lbfgsb_90_1 |
| 38 |
x.lbfgsb_77_2 x.lbfgsb_90_2 |
| 39 |
x.lbfgsb_77_3 x.lbfgsb_90_3 |
| 40 |
|
| 41 |
which are the executable files for the drivers in the package. |
| 42 |
One can execute the program by typing the name of the executable |
| 43 |
file. |
| 44 |
|
| 45 |
o Output files are provided for each executable file in directory |
| 46 |
OUPUTS |
| 47 |
|
| 48 |
output_77_1 output_90_1 |
| 49 |
output_77_2 output_90_2 |
| 50 |
output_77_3 output_90_3 |
| 51 |
|
| 52 |
o The following four articles are also included |
| 53 |
|
| 54 |
[1] algorithm.pdf - describes the algorithm |
| 55 |
[2] compact.pdf - presents the compact form of matrices |
| 56 |
[3] code.pdf - describes the code |
| 57 |
[4] acm-remark.pdf - describes the modification/correction |
| 58 |
|
| 59 |
The most useful articles for those who only wish to use the code |
| 60 |
are [3,4]. Users interested in understanding the algorithm should |
| 61 |
read [1] and possibly also [2]. |
| 62 |
|
| 63 |
________________________________________________________________________ |
| 64 |
|
| 65 |
For questions and help contact |
| 66 |
|
| 67 |
Jorge Nocedal <[email protected]> |
| 68 |
Jose Luis Morales <[email protected]> |
| 69 |
________________________________________________________________________ |
| 70 |
|
| 71 |
|
| 72 |
How to use L-BFGS-B |
| 73 |
|
| 74 |
************************************************************************ |
| 75 |
|
| 76 |
The simplest way to use the code is to modify one of the |
| 77 |
drivers provided in the package. Most users will only need to make |
| 78 |
a few changes to the drivers to run their applications. |
| 79 |
|
| 80 |
L-BFGS-B is written in FORTRAN 77, in double precision. The |
| 81 |
user is required to calculate the function value f and its gradient g. |
| 82 |
In order to allow the user complete control over these computations, |
| 83 |
reverse communication is used. The routine setulb.f must be called |
| 84 |
repeatedly under the control of the variable task. The calling |
| 85 |
statement of L-BFGS-B is |
| 86 |
|
| 87 |
call setulb(n,m,x,l,u,nbd,f,g,factr,pgtol,wa,iwa,task,iprint, |
| 88 |
+ csave,lsave,isave,dsave) |
| 89 |
|
| 90 |
|
| 91 |
Following is a description of all the parameters used in this call. |
| 92 |
|
| 93 |
c n is an INTEGER variable that must be set by the user to the |
| 94 |
c number of variables. It is not altered by the routine. |
| 95 |
c |
| 96 |
c m is an INTEGER variable that must be set by the user to the |
| 97 |
c number of corrections used in the limited memory matrix. |
| 98 |
c It is not altered by the routine. Values of m < 3 are |
| 99 |
c not recommended, and large values of m can result in excessive |
| 100 |
c computing time. The range 3 <= m <= 20 is recommended. |
| 101 |
c |
| 102 |
c x is a DOUBLE PRECISION array of length n. On initial entry |
| 103 |
c it must be set by the user to the values of the initial |
| 104 |
c estimate of the solution vector. Upon successful exit, it |
| 105 |
c contains the values of the variables at the best point |
| 106 |
c found (usually an approximate solution). |
| 107 |
c |
| 108 |
c l is a DOUBLE PRECISION array of length n that must be set by |
| 109 |
c the user to the values of the lower bounds on the variables. If |
| 110 |
c the i-th variable has no lower bound, l(i) need not be defined. |
| 111 |
c |
| 112 |
c u is a DOUBLE PRECISION array of length n that must be set by |
| 113 |
c the user to the values of the upper bounds on the variables. If |
| 114 |
c the i-th variable has no upper bound, u(i) need not be defined. |
| 115 |
c |
| 116 |
c nbd is an INTEGER array of dimension n that must be set by the |
| 117 |
c user to the type of bounds imposed on the variables: |
| 118 |
c nbd(i)=0 if x(i) is unbounded, |
| 119 |
c 1 if x(i) has only a lower bound, |
| 120 |
c 2 if x(i) has both lower and upper bounds, |
| 121 |
c 3 if x(i) has only an upper bound. |
| 122 |
c |
| 123 |
c f is a DOUBLE PRECISION variable. If the routine setulb returns |
| 124 |
c with task(1:2)= 'FG', then f must be set by the user to |
| 125 |
c contain the value of the function at the point x. |
| 126 |
c |
| 127 |
c g is a DOUBLE PRECISION array of length n. If the routine setulb |
| 128 |
c returns with taskb(1:2)= 'FG', then g must be set by the user to |
| 129 |
c contain the components of the gradient at the point x. |
| 130 |
c |
| 131 |
c factr is a DOUBLE PRECISION variable that must be set by the user. |
| 132 |
c It is a tolerance in the termination test for the algorithm. |
| 133 |
c The iteration will stop when |
| 134 |
c |
| 135 |
c (f^k - f^{k+1})/max{|f^k|,|f^{k+1}|,1} <= factr*epsmch |
| 136 |
c |
| 137 |
c where epsmch is the machine precision which is automatically |
| 138 |
c generated by the code. Typical values for factr on a computer |
| 139 |
c with 15 digits of accuracy in double precision are: |
| 140 |
c factr=1.d+12 for low accuracy; |
| 141 |
c 1.d+7 for moderate accuracy; |
| 142 |
c 1.d+1 for extremely high accuracy. |
| 143 |
c The user can suppress this termination test by setting factr=0. |
| 144 |
c |
| 145 |
c pgtol is a double precision variable. |
| 146 |
c On entry pgtol >= 0 is specified by the user. The iteration |
| 147 |
c will stop when |
| 148 |
c |
| 149 |
c max{|proj g_i | i = 1, ..., n} <= pgtol |
| 150 |
c |
| 151 |
c where pg_i is the ith component of the projected gradient. |
| 152 |
c The user can suppress this termination test by setting pgtol=0. |
| 153 |
c |
| 154 |
c wa is a DOUBLE PRECISION array of length |
| 155 |
c (2mmax + 5)nmax + 11mmax^2 + 8mmax used as workspace. |
| 156 |
c This array must not be altered by the user. |
| 157 |
c |
| 158 |
c iwa is an INTEGER array of length 3nmax used as |
| 159 |
c workspace. This array must not be altered by the user. |
| 160 |
c |
| 161 |
c task is a CHARACTER string of length 60. |
| 162 |
c On first entry, it must be set to 'START'. |
| 163 |
c On a return with task(1:2)='FG', the user must evaluate the |
| 164 |
c function f and gradient g at the returned value of x. |
| 165 |
c On a return with task(1:5)='NEW_X', an iteration of the |
| 166 |
c algorithm has concluded, and f and g contain f(x) and g(x) |
| 167 |
c respectively. The user can decide whether to continue or stop |
| 168 |
c the iteration. |
| 169 |
c When |
| 170 |
c task(1:4)='CONV', the termination test in L-BFGS-B has been |
| 171 |
c satisfied; |
| 172 |
c task(1:4)='ABNO', the routine has terminated abnormally |
| 173 |
c without being able to satisfy the termination conditions, |
| 174 |
c x contains the best approximation found, |
| 175 |
c f and g contain f(x) and g(x) respectively; |
| 176 |
c task(1:5)='ERROR', the routine has detected an error in the |
| 177 |
c input parameters; |
| 178 |
c On exit with task = 'CONV', 'ABNO' or 'ERROR', the variable task |
| 179 |
c contains additional information that the user can print. |
| 180 |
c This array should not be altered unless the user wants to |
| 181 |
c stop the run for some reason. See driver2 or driver3 |
| 182 |
c for a detailed explanation on how to stop the run |
| 183 |
c by assigning task(1:4)='STOP' in the driver. |
| 184 |
c |
| 185 |
c iprint is an INTEGER variable that must be set by the user. |
| 186 |
c It controls the frequency and type of output generated: |
| 187 |
c iprint<0 no output is generated; |
| 188 |
c iprint=0 print only one line at the last iteration; |
| 189 |
c 0<iprint<99 print also f and |proj g| every iprint iterations; |
| 190 |
c iprint=99 print details of every iteration except n-vectors; |
| 191 |
c iprint=100 print also the changes of active set and final x; |
| 192 |
c iprint>100 print details of every iteration including x and g; |
| 193 |
c When iprint > 0, the file iterate.dat will be created to |
| 194 |
c summarize the iteration. |
| 195 |
c |
| 196 |
c csave is a CHARACTER working array of length 60. |
| 197 |
c |
| 198 |
c lsave is a LOGICAL working array of dimension 4. |
| 199 |
c On exit with task = 'NEW_X', the following information is |
| 200 |
c available: |
| 201 |
c lsave(1) = .true. the initial x did not satisfy the bounds; |
| 202 |
c lsave(2) = .true. the problem contains bounds; |
| 203 |
c lsave(3) = .true. each variable has upper and lower bounds. |
| 204 |
c |
| 205 |
c isave is an INTEGER working array of dimension 44. |
| 206 |
c On exit with task = 'NEW_X', it contains information that |
| 207 |
c the user may want to access: |
| 208 |
c isave(30) = the current iteration number; |
| 209 |
c isave(34) = the total number of function and gradient |
| 210 |
c evaluations; |
| 211 |
c isave(36) = the number of function value or gradient |
| 212 |
c evaluations in the current iteration; |
| 213 |
c isave(38) = the number of free variables in the current |
| 214 |
c iteration; |
| 215 |
c isave(39) = the number of active constraints at the current |
| 216 |
c iteration; |
| 217 |
c |
| 218 |
c see the subroutine setulb.f for a description of other |
| 219 |
c information contained in isave |
| 220 |
c |
| 221 |
c dsave is a DOUBLE PRECISION working array of dimension 29. |
| 222 |
c On exit with task = 'NEW_X', it contains information that |
| 223 |
c the user may want to access: |
| 224 |
c dsave(2) = the value of f at the previous iteration; |
| 225 |
c dsave(5) = the machine precision epsmch generated by the code; |
| 226 |
c dsave(13) = the infinity norm of the projected gradient; |
| 227 |
c |
| 228 |
c see the subroutine setulb.f for a description of other |
| 229 |
c information contained in dsave |
| 230 |
c |
| 231 |
************************************************************************ |
| 232 |
|