SOCP 1

Description

maximize \ \ x + y

subject \ to \ \ x^2 + y^2 ≤q 1

x ≥q 0, y ≥q 0

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(ROI)
obj <- L_objective(c(1, 1))
## NOTE: chol(diag(2)) == diag(2)
con <- L_constraint(rbind(0, -diag(2)), dir=rep("==", 3), rhs=c(1, 0, 0))
op <- OP(obj, con, bounds=as.C_bound(list(soc=list(1:3))), maximum=TRUE)
x <- ROI_solve(op, solver="scs")
x
## Optimal solution found.
## The objective value is: 1.414214e+00
solution(x)
## [1] 0.7071068 0.7071068

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.