Click or drag to resize

MAINLBRun Method


Namespace: DotNumerics.Optimization.LBFGSB
Assembly: 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,
	ref double[] X,
	int offset_x,
	double[] L,
	int offset_l,
	double[] U,
	int offset_u,
	int[] NBD,
	int offset_nbd,
	ref double F,
	ref double[] G,
	int offset_g,
	double FACTR,
	double PGTOL,
	ref double[] WS,
	int offset_ws,
	ref double[] WY,
	int offset_wy,
	ref double[] SY,
	int offset_sy,
	ref double[] SS,
	int offset_ss,
	double[] YY,
	int offset_yy,
	ref double[] WT,
	int offset_wt,
	ref double[] WN,
	int offset_wn,
	ref double[] SND,
	int offset_snd,
	ref double[] Z,
	int offset_z,
	ref double[] R,
	int offset_r,
	ref double[] D,
	int offset_d,
	ref double[] T,
	int offset_t,
	ref double[] WA,
	int offset_wa,
	double[] SG,
	int offset_sg,
	double[] SGO,
	int offset_sgo,
	double[] YG,
	int offset_yg,
	double[] YGO,
	int offset_ygo,
	ref int[] INDEX,
	int offset_index,
	ref int[] IWHERE,
	int offset_iwhere,
	ref int[] INDX2,
	int offset_indx2,
	ref BFGSTask TASK,
	int IPRINT,
	ref BFGSTask CSAVE,
	ref bool[] LSAVE,
	int offset_lsave,
	ref int[] ISAVE,
	int offset_isave,
	ref double[] DSAVE,
	int offset_dsave
)
Request Example View Source

Parameters

N  Int32
is an integer variable. On entry n is the number of variables. On exit n is unchanged.
M  Int32
is an integer variable. On entry m is the maximum number of variable metric corrections allowed in the limited memory matrix. On exit m is unchanged.
X  Double
is a double precision array of dimension n. On entry x is an approximation to the solution. On exit x is the current approximation.
offset_x  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 an 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, 3 if x(i) has only an upper bound. On exit nbd is unchanged.
offset_nbd  Int32
 
F  Double
is a double precision variable. On first entry f is unspecified. On final exit f is the value of the function at x.
G  Double
is a double precision array of dimension n. On first entry g is unspecified. On final exit g is the value of the gradient at x.
offset_g  Int32
 
FACTR  Double
is a double precision variable. On entry factr .GE. 0 is specified by the user. The iteration will stop when (f^k - f^{k+1})/max{|f^k|,|f^{k+1}|,1} .LE. factr*epsmch where epsmch is the machine precision, which is automatically generated by the code. On exit factr is unchanged.
PGTOL  Double
is a double precision variable. On entry pgtol .GE. 0 is specified by the user. The iteration will stop when max{|proj g_i | i = 1, ..., n} .LE. pgtol where pg_i is the ith component of the projected gradient. On exit pgtol is unchanged.
WS  Double
 
offset_ws  Int32
 
WY  Double
 
offset_wy  Int32
 
SY  Double
 
offset_sy  Int32
 
SS  Double
 
offset_ss  Int32
 
YY  Double
 
offset_yy  Int32
 
WT  Double
 
offset_wt  Int32
 
WN  Double
is a double precision working array of dimension 2m x 2m used to store 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]
offset_wn  Int32
 
SND  Double
is a double precision working array of dimension 2m x 2m used to store the lower triangular part of N = [Y' ZZ'Y L_a'+R_z'] [L_a +R_z S'AA'S ]
offset_snd  Int32
 
Z  Double
is used at different times to store the Cauchy point and
offset_z  Int32
 
R  Double
 
offset_r  Int32
 
D  Double
 
offset_d  Int32
 
T  Double
 
offset_t  Int32
 
WA  Double
 
offset_wa  Int32
 
SG  Double
 
offset_sg  Int32
 
SGO  Double
 
offset_sgo  Int32
 
YG  Double
 
offset_yg  Int32
 
YGO  Double
 
offset_ygo  Int32
 
INDEX  Int32
is an integer working array of dimension n. In subroutine freev, index is used to store the free and fixed variables at the Generalized Cauchy Point (GCP).
offset_index  Int32
 
IWHERE  Int32
is an integer working array of dimension n used to record the status of the vector x for GCP computation. iwhere(i)=0 or -3 if x(i) is free and has bounds, 1 if x(i) is fixed at l(i), and l(i) .ne. u(i) 2 if x(i) is fixed at u(i), and u(i) .ne. l(i) 3 if x(i) is always fixed, i.e., u(i)=x(i)=l(i) -1 if x(i) is always free, i.e., no bounds on it.
offset_iwhere  Int32
 
INDX2  Int32
is an integer working array of dimension n. Within subroutine cauchy, indx2 corresponds to the array iorder. In subroutine freev, a list of variables entering and leaving the free set is stored in indx2, and it is passed on to subroutine formk with this information.
offset_indx2  Int32
 
TASK  BFGSTask
is a working string of characters of length 60 indicating the current job when entering and leaving this subroutine.
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.
CSAVE  BFGSTask
is a working string of characters of length 60.
LSAVE  Boolean
is a logical working array of dimension 4.
offset_lsave  Int32
 
ISAVE  Int32
is an integer working array of dimension 23.
offset_isave  Int32
 
DSAVE  Double
is a double precision working array of dimension 29.
offset_dsave  Int32
 
See Also