Sys.setenv("ROI_LOAD_PLUGINS" = FALSE)
library(ROI)
library(ROI.plugin.clarabel)
obj <- L_objective(c(1, -1))
L <- chol(rbind(c(3, -1), c(-1, 1)))
con <- C_constraint(L = rbind(0, -L), cones = K_soc(3), rhs = c(1, 0, 0))
op <- OP(objective = obj, constraints = con,
bounds = V_bound(li = 1:2, lb = rep(-Inf, 2)))
x <- ROI_solve(op, solver="clarabel")
x
## Optimal solution found.
## The objective value is: -1.000000e+00
solution(x)
## [1] -4.622464e-16 1.000000e+00
Run the code above in your browser using DataLab