CVXR icon indicating copy to clipboard operation
CVXR copied to clipboard

`ignore_dcp` option is not working as intended

Open flodel opened this issue 5 years ago • 0 comments

When calling solve with ignore_dcp = TRUE , the DCP check is still run. I can spot where this is happening in https://github.com/cvxgrp/CVXR/blob/master/R/problem.R, near line 473:

  if(!is_dcp(object)) {
    if(ignore_dcp)
      print("Problem does not follow DCP rules. Solving a convex relaxation.")
    else
      stop("Problem does not follow DCP rules.")
  }

I would suggest replacing with

  if (!ignore_dcp) {
    if(!is_dcp(object)) {
      stop("Problem does not follow DCP rules.")
    }
  }

flodel avatar Sep 25 '19 22:09 flodel