Learn R Programming

Rmosek (version 1.2.5.1)

mosek_qptoprob: Construct problem from a quadratic program

Description

Construct a conic problem description from the following quadratic program:

minimize: f'x + 0.5x'(F'F)x
subject to:
A x <= b
Aeq x = beq with bounds:

Given that F is not known, but Q = F'F on the other hand is, we can estimate F from Q by the Cholesky Decomposition: F = Matrix::chol(Q). The result of the mosek_qptoprob function is compatible with the problem description of the mosek function.

Note that problems with a quadratic objective can also be formulated without cones, using the field 'qobj' in the problem description. This is documented in the userguide.

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
# NOT RUN {
 # 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