Learn R Programming

Rmosek (version 1.2.2)

mosek_qptoprob: Construct problem from a quadratic program

Description

Construct a problem description from the following quadratic program:

ll{ minimize: f'x + 0.5x'(F'F)x subject to: A x <= b="" aeq="" x="beq" with="" bounds:="" lb="" <="x" }<="" p="">

The result of this function is compatible with the problem description of the mosek function.

Usage

mosek_qptoprob(F,f,A,b,Aeq,beq,lb,ub)

Arguments

F
Objective quadratic coefficient matrix (size mF x n)
f
Objective linear coefficient vector (size n)
A
Constraint inequality matrix (size mA x n)
b
Constraint inequality upper bounds (size mA)
Aeq
Constraint equality matrix (size mEQ x n)
beq
Constraint equality fixed values (size mEQ)
lb
Variable lower bounds (size n)
ub
Variable upper bounds (size n)

See Also

mosek mosek_lptoprob

Examples

Run this code
# Define a quadratic program
 F <- Diagonal(3)
 f <- c(0,-5,0)
 A <- Matrix(c( 4, 3, 0,
               -2,-1, 0,
                0, 2,-1), nrow=3, byrow=TRUE, sparse=TRUE)
 b <- c(8,-2,0)
 Aeq <- NA; 
 beq <- NA;
 lb <- rep(-Inf, 3);
 ub <- rep(Inf, 3);

 # Construct and solve problem
 prob <- mosek_qptoprob(F, f, A, b, Aeq, beq, lb, ub);
 r <- mosek(prob);

 # Objective value is
 print(prob$c %*% r$sol$itr$xx);

Run the code above in your browser using DataLab