# NOT RUN {
# Define a linear program
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_lptoprob(f, A, b, Aeq, beq, lb, ub);
r <- mosek(prob);
# Objective value is
print(prob$c %*% r$sol$bas$xx);
# }
Run the code above in your browser using DataLab