e04mf {NAGFWrappers} | R Documentation |
e04mf solves general linear programming problems. It is not intended for large sparse problems.
e04mf(a, bl, bu, cvec, istate, x, optlist, n = nrow(x), nclin = nrow(a))
a |
double array The ith row of a must contain the coefficients of the ith general linear constraint for i=1 . . . m_L. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bl |
double array | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bu |
double array Must contain the lower bounds and bu the upper bounds, for all the constraints in the following order. The first n elements of each array must contain the bounds on the variables, and the next m_L elements the bounds for the general linear constraints (if any). To specify a nonexistent lower bound (i.e., l_j = - infinity), set bl[j] <= - bigbnd, and to specify a nonexistent upper bound (i.e., u_j = + infinity), set bu[j] >= bigbnd; the default value of bigbnd is 10^20, but this may be changed by the optional argument infiniteboundsize. To specify the jth constraint as an equality, set bl[j] = bu[j] = β, say, where abs(β) < bigbnd. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cvec |
double array The coefficients of the objective function when the problem is of type LP. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
istate |
integer array Need not be set if the (default) optional argument coldstart is used. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
x |
double array An initial estimate of the solution. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optlist |
options list Optional parameters may be listed, as shown in the following table:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
n |
integer: default = nrow(x) n, the number of variables. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
nclin |
integer: default = nrow(a) m_L, the number of general linear constraints. |
R interface to the NAG Fortran routine E04MFF.
ISTATE |
integer array The status of the constraints in the working set at the point returned in x. The significance of each possible value of istate[j] is as follows: |
X |
double array The point at which e04mf terminated. If ifail =0, ifail =1, ifail =4, x contains an estimate of the solution. |
ITER |
integer The total number of iterations performed. |
OBJ |
double The value of the objective function at x if x is feasible, or the sum of infeasibiliites at x otherwise. If the problem is of type FP and x is feasible, obj is set to zero. |
AX |
double array The final values of the linear constraints Ax. |
CLAMDA |
double array The values of the Lagrange multipliers for each constraint with respect to the current working set. The first n elements contain the multipliers for the bound constraints on the variables, and the next m_L elements contain the multipliers for the general linear constraints (if any). If istate[j] = 0 (i.e., constraint j is not in the working set), clamda[j] is zero. If x is optimal, clamda[j] should be non-negative if istate[j] = 1, non-positive if istate[j] = 2 and zero if istate[j] = 4. |
IFAIL |
integer ifail =0unless the function detects an error or a warning has been flagged (see the Errors section in Fortran library documentation). |
NAG
http://www.nag.co.uk/numeric/FL/nagdoc_fl23/pdf/E04/e04mff.pdf
optlist<-list() ifail<-0 a<-matrix(c(1,1,1,1,1,1,1,0.15,0.04,0.02,0.04,0.02,0.01,0.03,0.03,0.05,0.08,0.02,0.06,0.01,0,0.02,0.04,0.01,0.02,0.02,0,0,0.02,0.03,0,0,0.01,0,0,0.7,0.75,0.8,0.75,0.8,0.97,0,0.02,0.06,0.08,0.12,0.02,0.01,0.97),nrow=7,ncol=7,byrow=TRUE) bl<-matrix(c(-0.01,-0.1,-0.01,-0.04,-0.1,-0.01,-0.01,-0.13,-9.999999999999999e+24,-9.999999999999999e+24,-9.999999999999999e+24,-9.999999999999999e+24,-0.0992,-0.003),nrow=14,ncol=1,byrow=TRUE) bu<-matrix(c(0.01,0.15,0.03,0.02,0.05,9.999999999999999e+24,9.999999999999999e+24,-0.13,-0.004900000000000001,-0.0064,-0.0037,-0.0012,9.999999999999999e+24,0.002),nrow=14,ncol=1,byrow=TRUE) cvec<-matrix(c(-0.02,-0.2,-0.2,-0.2,-0.2,0.04,0.04),nrow=7,ncol=1,byrow=TRUE) istate<-as.matrix(mat.or.vec(14,1)) x<-matrix(c(-0.01,-0.03,0,-0.01,-0.1,0.02,0.01),nrow=7,ncol=1,byrow=TRUE) e04mf(a,bl,bu,cvec,istate,x,optlist)