cvxgrp / CVXR

An R modeling language for convex optimization problems.

Home Page:https://cvxr.rbind.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inconsistent error messages: DCP rules vs DGP rules

markbneal opened this issue · comments

I have a problem, that is probably not convex, and so I wouldn't expect it to be solved by CVXR. However, the solve() call gives conflicting error messages if you run this:

#eg modified from https://cvxr.rbind.io/cvxr_examples/cvxr_gentle-intro/
library(CVXR)

# Variables minimized over
x <- Variable(1)
y <- Variable(1)
p <- Variable(1)
q <- Variable(1)

# Problem definition
objective <- Minimize((x - y)^2*q + (p - q)^2*y)
constraints <- list(x >= 0, y >= 0, p >= 0, q >= 0, 
                    x <= 67.314, y <= 78, p <= 76.11, q <= 86)
prob2.1 <- Problem(objective, constraints)

# Problem solution
solution2.1 <- solve(prob2.1)
solution2.1 <- solve(prob2.1, gp = TRUE)
solution2.1 <- solve(prob2.1, gp = FALSE)

Error messages:

> solution2.1 <- solve(prob2.1)
Error in construct_intermediate_chain(object, candidate_solvers, gp = gp) : 
  Problem does not follow DCP rules. However, the problem does follow DGP rules. Consider calling this function with gp = TRUE
> solution2.1 <- solve(prob2.1, gp = TRUE)
Error in construct_intermediate_chain(object, candidate_solvers, gp = gp) : 
  Problem does not follow DGP rules. However, the problem does follow DCP rules. Consider calling this function with gp = FALSE
> solution2.1 <- solve(prob2.1, gp = FALSE)
Error in construct_intermediate_chain(object, candidate_solvers, gp = gp) : 
  Problem does not follow DCP rules. However, the problem does follow DGP rules. Consider calling this function with gp = TRUE

Thanks. Addressed in mosek_exp branch that will make it into 1.0-2.