Namespace: DotNumerics.Optimization.LBFGSBAssembly: DWSIM.MathOps.DotNumerics (in DWSIM.MathOps.DotNumerics.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax public void Run(
int N,
int M,
int NSUB,
int[] IND,
int offset_ind,
double[] L,
int offset_l,
double[] U,
int offset_u,
int[] NBD,
int offset_nbd,
ref double[] X,
int offset_x,
ref double[] D,
int offset_d,
double[] WS,
int offset_ws,
double[] WY,
int offset_wy,
double THETA,
int COL,
int HEAD,
ref int IWORD,
ref double[] WV,
int offset_wv,
double[] WN,
int offset_wn,
int IPRINT,
ref int INFO
)
Public Sub Run (
N As Integer,
M As Integer,
NSUB As Integer,
IND As Integer(),
offset_ind As Integer,
L As Double(),
offset_l As Integer,
U As Double(),
offset_u As Integer,
NBD As Integer(),
offset_nbd As Integer,
ByRef X As Double(),
offset_x As Integer,
ByRef D As Double(),
offset_d As Integer,
WS As Double(),
offset_ws As Integer,
WY As Double(),
offset_wy As Integer,
THETA As Double,
COL As Integer,
HEAD As Integer,
ByRef IWORD As Integer,
ByRef WV As Double(),
offset_wv As Integer,
WN As Double(),
offset_wn As Integer,
IPRINT As Integer,
ByRef INFO As Integer
)
Request Example
View SourceParameters
- N Int32
-
is an integer variable.
On entry n is the dimension of the problem.
On exit n is unchanged.
- M Int32
-
is an integer variable.
On entry m is the maximum number of variable metric corrections
used to define the limited memory matrix.
On exit m is unchanged.
- NSUB Int32
-
is an integer variable.
On entry nsub is the number of free variables.
On exit nsub is unchanged.
- IND Int32
-
is an integer array of dimension nsub.
On entry ind specifies the coordinate indices of free variables.
On exit ind is unchanged.
- offset_ind Int32
-
- L Double
-
is a double precision array of dimension n.
On entry l is the lower bound of x.
On exit l is unchanged.
- offset_l Int32
-
- U Double
-
is a double precision array of dimension n.
On entry u is the upper bound of x.
On exit u is unchanged.
- offset_u Int32
-
- NBD Int32
-
is a integer array of dimension n.
On entry nbd represents the type of bounds imposed on the
variables, and must be specified as follows:
nbd(i)=0 if x(i) is unbounded,
1 if x(i) has only a lower bound,
2 if x(i) has both lower and upper bounds, and
3 if x(i) has only an upper bound.
On exit nbd is unchanged.
- offset_nbd Int32
-
- X Double
-
is a double precision array of dimension n.
On entry x specifies the Cauchy point xcp.
On exit x(i) is the minimizer of Q over the subspace of
free variables.
- offset_x Int32
-
- D Double
-
= -(Z'BZ)^(-1) r.
The formula for the Newton direction, given the L-BFGS matrix
and the Sherman-Morrison formula, is
d = (1/theta)r + (1/theta*2) Z'WK^(-1)W'Z r.
where
K = [-D -Y'ZZ'Y/theta L_a'-R_z' ]
[L_a -R_z theta*S'AA'S ]
Note that this procedure for computing d differs
from that described in [1]. One can show that the matrix K is
equal to the matrix M^[-1]N in that paper.
n is an integer variable.
On entry n is the dimension of the problem.
On exit n is unchanged.
m is an integer variable.
On entry m is the maximum number of variable metric corrections
used to define the limited memory matrix.
On exit m is unchanged.
nsub is an integer variable.
On entry nsub is the number of free variables.
On exit nsub is unchanged.
ind is an integer array of dimension nsub.
On entry ind specifies the coordinate indices of free variables.
On exit ind is unchanged.
l is a double precision array of dimension n.
On entry l is the lower bound of x.
On exit l is unchanged.
u is a double precision array of dimension n.
On entry u is the upper bound of x.
On exit u is unchanged.
nbd is a integer array of dimension n.
On entry nbd represents the type of bounds imposed on the
variables, and must be specified as follows:
nbd(i)=0 if x(i) is unbounded,
1 if x(i) has only a lower bound,
2 if x(i) has both lower and upper bounds, and
3 if x(i) has only an upper bound.
On exit nbd is unchanged.
x is a double precision array of dimension n.
On entry x specifies the Cauchy point xcp.
On exit x(i) is the minimizer of Q over the subspace of
free variables.
d is a double precision array of dimension n.
On entry d is the reduced gradient of Q at xcp.
On exit d is the Newton direction of Q.
ws and wy are double precision arrays;
theta is a double precision variable;
col is an integer variable;
head is an integer variable.
On entry they store the information defining the
limited memory BFGS matrix:
ws(n,m) stores S, a set of s-vectors;
wy(n,m) stores Y, a set of y-vectors;
theta is the scaling factor specifying B_0 = theta I;
col is the number of variable metric corrections stored;
head is the location of the 1st s- (or y-) vector in S (or Y).
On exit they are unchanged.
iword is an integer variable.
On entry iword is unspecified.
On exit iword specifies the status of the subspace solution.
iword = 0 if the solution is in the box,
1 if some bound is encountered.
wv is a double precision working array of dimension 2m.
wn is a double precision array of dimension 2m x 2m.
On entry the upper triangle of wn stores the LEL^T factorization
of the indefinite matrix
K = [-D -Y'ZZ'Y/theta L_a'-R_z' ]
[L_a -R_z theta*S'AA'S ]
where E = [-I 0]
[ 0 I]
On exit wn is unchanged.
iprint is an INTEGER variable that must be set by the user.
It controls the frequency and type of output generated:
iprint.LT.0 no output is generated;
iprint=0 print only one line at the last iteration;
0.LT.iprint.LT.99 print also f and |proj g| every iprint iterations;
iprint=99 print details of every iteration except n-vectors;
iprint=100 print also the changes of active set and final x;
iprint.GT.100 print details of every iteration including x and g;
When iprint .GT. 0, the file iterate.dat will be created to
summarize the iteration.
info is an integer variable.
On entry info is unspecified.
On exit info = 0 for normal return,
= nonzero for abnormal return
when the matrix K is ill-conditioned.
Subprograms called:
Linpack dtrsl.
References:
[1] R. H. Byrd, P. Lu, J. Nocedal and C. Zhu, ``A limited
memory algorithm for bound constrained optimization'',
SIAM J. Scientific Computing 16 (1995), no. 5, pp. 1190--1208.
* * *
NEOS, November 1994. (Latest revision June 1996.)
Optimization Technology Center.
Argonne National Laboratory and Northwestern University.
Written by
Ciyou Zhu
in collaboration with R.H. Byrd, P. Lu-Chen and J. Nocedal.
************
- offset_d Int32
-
- WS Double
-
and wy are double precision arrays;
- offset_ws Int32
-
- WY Double
-
- offset_wy Int32
-
- THETA Double
-
is a double precision variable;
- COL Int32
-
is an integer variable;
- HEAD Int32
-
is an integer variable.
On entry they store the information defining the
limited memory BFGS matrix:
ws(n,m) stores S, a set of s-vectors;
wy(n,m) stores Y, a set of y-vectors;
theta is the scaling factor specifying B_0 = theta I;
col is the number of variable metric corrections stored;
head is the location of the 1st s- (or y-) vector in S (or Y).
On exit they are unchanged.
- IWORD Int32
-
is an integer variable.
On entry iword is unspecified.
On exit iword specifies the status of the subspace solution.
iword = 0 if the solution is in the box,
1 if some bound is encountered.
- WV Double
-
is a double precision working array of dimension 2m.
- offset_wv Int32
-
- WN Double
-
is a double precision array of dimension 2m x 2m.
On entry the upper triangle of wn stores the LEL^T factorization
of the indefinite matrix
K = [-D -Y'ZZ'Y/theta L_a'-R_z' ]
[L_a -R_z theta*S'AA'S ]
where E = [-I 0]
[ 0 I]
On exit wn is unchanged.
- offset_wn Int32
-
- IPRINT Int32
-
is an INTEGER variable that must be set by the user.
It controls the frequency and type of output generated:
iprint.LT.0 no output is generated;
iprint=0 print only one line at the last iteration;
0.LT.iprint.LT.99 print also f and |proj g| every iprint iterations;
iprint=99 print details of every iteration except n-vectors;
iprint=100 print also the changes of active set and final x;
iprint.GT.100 print details of every iteration including x and g;
When iprint .GT. 0, the file iterate.dat will be created to
summarize the iteration.
- INFO Int32
-
is an integer variable.
On entry info is unspecified.
On exit info = 0 for normal return,
= nonzero for abnormal return
when the matrix K is ill-conditioned.
See Also