I am using CVXR to solve an optimization problem in R using the MOSEK solver. CVXR has found the MOSEK SOLVER through ANACONDA and is working fine. However, I do not manage to generate the MOSEK feasibility report when the model is infeasible. This is normally switched on with MSK_IPAR_INFEAS_REPORT_AUTO = "ON" (at least in GAMS, where I have used MOSEK before) and very useful to identify problems in model design, data, etc. The standard command gives me an error. Then I tried the Python interface, which tells me to use: task.putintparam(iparam.infeas_report_auto, onoffkey.on). This seems to be accepted by my solve command but still does not spit out the feasibility report. Below a reproducible example. What am I doing wrong?
# Check solvers
installed_solvers()
# Main variable
x <- Variable(1)
# Objective function
objective <- x
# Constraint
constraint <- list(x >0, x-1>0)
# Solve
problem <- CVXR::Problem(Maximize(objective), c(constraint))
sol <- psolve(problem, solver = "MOSEK", verbose = TRUE, task.putintparam(iparam.infeas_report_auto, onoffkey.on))
Gives only the standard output:
Problem
Name :
Objective sense : min
Type : LO (linear optimization problem)
Constraints : 2
Cones : 0
Scalar variables : 1
Matrix variables : 0
Integer variables : 0
Optimizer started.
Presolve started.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries : 2 time : 0.00
Lin. dep. - tries : 0 time : 0.00
Lin. dep. - number : 0
Presolve terminated. Time: 0.00
Optimizer terminated. Time: 0.01
Interior-point solution summary Problem status : DUAL_INFEASIBLE Solution status : DUAL_INFEASIBLE_CER Primal. obj: -1.0000000000e+00 nrm: 1e+00 Viol. con: 0e+00 var: 0e+00
Basic solution summary Problem status : DUAL_INFEASIBLE Solution status : DUAL_INFEASIBLE_CER Primal. obj: -1.0000000000e+00 nrm: 1e+00 Viol. con: 0e+00 var: 0e+00