solve.QP(Dmat, dvec, Amat, bvec, meq=0, factorized=F)
Dmat
| matrix appearing in the quadratic function to be minimized. |
dvec
| vector appearing in the quadratic function to be minimized. |
Amat
| matrix defining the constraints under which we want to minimize the quadratic function. |
bvec
| vector holding the values of b0 (defaults to zero). |
meq
|
the first meq constraints are treated as equality constraints,
all further as inequality constraints (defaults to 0).
|
factorized
|
logical flag: if TRUE , then we are passing
R^-1 (where D = R^T R) instead of the matrix D in the argument Dmat .
|
solution
| vector containing the solution of the quadratic programming problem. |
value
| scalar, the value of the quadratic function at the solution |
unconstrained.solution
| vector containing the unconstrained minimizer of the quadratic function. |
iterations
| vector of length 2, the first component contains the number of iterations the algorithm needed, the second indicates how often constraints became inactive after becoming active first. vector with the indices of the active constraints at the solution. |
Goldfarb, D. and Idnani, A. (1983). A numerically stable dual method for solving strictly convex quadratic programs. Mathematical Programming 27, 1-33.
solve.QP.compact
# # Assume we want to minimize: -(0 5 0) %*% b + 1/2 b^T b # under the constraints: A^T b >= b0 # with b0 = (-8,2,0)^T # and (-4 2 0) # A = (-3 1 -2) # ( 0 0 1) # we can use solve.QP as follows: # Dmat <- matrix(0,3,3) diag(Dmat) <- 1 dvec <- c(0,5,0) Amat <- matrix(c(-4,-3,0,2,1,0,0,-2,1),3,3) bvec <- c(-8,2,0) solve.QP(Dmat,dvec,Amat,bvec=bvec)