Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOI wrapper does not validate problem is DCP #713

Closed
odow opened this issue Dec 4, 2024 · 1 comment · Fixed by #714
Closed

MOI wrapper does not validate problem is DCP #713

odow opened this issue Dec 4, 2024 · 1 comment · Fixed by #714

Comments

@odow
Copy link
Member

odow commented Dec 4, 2024

This line:

MOI.optimize!(model::Optimizer) = MOI.optimize!(model.context.model)

skips checks like:

Convex.jl/src/solution.jl

Lines 101 to 103 in 55931d7

if problem_vexity(p) in (ConcaveVexity(), NotDcp())
throw(DCPViolationError())
end

@odow odow changed the title MOI wrapper does not valid problem is DCP MOI wrapper does not validate problem is DCP Dec 4, 2024
@odow
Copy link
Member Author

odow commented Dec 4, 2024

julia> using JuMP, Convex, SCS

julia> model = Model(() -> Convex.Optimizer(SCS.Optimizer))
A JuMP Model
├ solver: Convex with SCS
├ objective_sense: FEASIBILITY_SENSE
├ num_variables: 0
├ num_constraints: 0
└ Names registered in the model: none

julia> @variable(model, x)
x

julia> @constraint(model, @force_nonlinear(x^2) >= 1)
(x ^ 2.0) - 1.0  0

julia> optimize!(model)
------------------------------------------------------------------
	       SCS v3.2.7 - Splitting Conic Solver
	(c) Brendan O'Donoghue, Stanford University, 2012
------------------------------------------------------------------
problem:  variables n: 2, constraints m: 4
cones: 	  l: linear vars: 1
	  q: soc vars: 3, qsize: 1
settings: eps_abs: 1.0e-04, eps_rel: 1.0e-04, eps_infeas: 1.0e-07
	  alpha: 1.50, scale: 1.00e-01, adaptive_scale: 1
	  max_iters: 100000, normalize: 1, rho_x: 1.00e-06
	  acceleration_lookback: 10, acceleration_interval: 10
	  compiled with openmp parallelization enabled
lin-sys:  sparse-direct-amd-qdldl
	  nnz(A): 4, nnz(P): 0
------------------------------------------------------------------
 iter | pri res | dua res |   gap   |   obj   |  scale  | time (s)
------------------------------------------------------------------
     0| 3.54e-01  1.11e-01  1.11e-01  5.54e-02  1.00e-01  1.65e-04 
    25| 1.16e-08  8.48e-18  1.27e-17  6.36e-18  1.00e-01  2.44e-04 
------------------------------------------------------------------
status:  solved
timings: total: 2.49e-04s = setup: 7.09e-05s + solve: 1.78e-04s
	 lin-sys: 4.95e-06s, cones: 2.99e-06s, accel: 1.55e-06s
------------------------------------------------------------------
objective = 0.000000
------------------------------------------------------------------

julia> solution_summary(model; verbose = true)
* Solver : Convex with SCS

* Status
  Result count       : 1
  Termination status : OPTIMAL
  Message from the solver:
  "solved"

* Candidate solution (result #1)
  Primal status      : FEASIBLE_POINT
  Dual status        : FEASIBLE_POINT
  Objective value    : 0.00000e+00
  Dual objective value : 1.27215e-17
  Primal solution :
    x : 0.00000e+00
  Dual solution :

* Work counters
  Solve time (sec)   : 2.49338e-04


julia> primal_feasibility_report(model)
Dict{Any, Float64} with 1 entry:
  (x ^ 2.0) - 1.0  0 => 1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant