A = rbind(c(10,3),c(3,10))
B = rbind(c(6,-4),c(-4,10))
C = rbind(c(8,1),c(1,6))
D = rbind(c(16,-13),c(-13,60))
library(CVXR)
x <- Variable(3)
obj <- Minimize(x[1]+x[2]-x[3])
con <- list( x[1]*A + x[2]*B + x[3]*C <= D,
x>=0)
pro9 <- Problem(obj,con)
sol <- solve(pro9)
sol
sol$value
sol$getValue(x)
I got value=Inf, x=NA
reference answer
sol$value: -1.486487e+00
sol$getValue(x): ## [1] -4.726329e-06 -1.245669e-06 1.486481e+00
I do not have a idea what problem is.
Please let me know the problem.
Thank you in advance.
New contributor
user25475077 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.