From caeac16e929518797cf5db9116167367ea66b223 Mon Sep 17 00:00:00 2001 From: Miles Lubin Date: Wed, 29 Mar 2017 08:17:45 -0400 Subject: [PATCH 1/2] more delicate setvartype condition --- src/SolverInterface/conic_to_lpqp.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SolverInterface/conic_to_lpqp.jl b/src/SolverInterface/conic_to_lpqp.jl index 29d9c69..801c42c 100644 --- a/src/SolverInterface/conic_to_lpqp.jl +++ b/src/SolverInterface/conic_to_lpqp.jl @@ -229,7 +229,7 @@ function optimize!(wrap::ConicToLPQPBridge) #@show obj, full(A), b, constr_cones, var_cones loadproblem!(wrap.m, obj, A, b, constr_cones, var_cones) - if !isempty(wrap.vartypes) + if !all(t -> t == :Cont, wrap.vartypes) setvartype!(wrap.m, wrap.vartypes) end optimize!(wrap.m) From 0f4a0dacb5efacb98fc42fed759651d5d44a10b7 Mon Sep 17 00:00:00 2001 From: Miles Lubin Date: Wed, 29 Mar 2017 10:36:48 -0400 Subject: [PATCH 2/2] implement getobjbound for conic_to_lpqp --- src/SolverInterface/conic_to_lpqp.jl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/SolverInterface/conic_to_lpqp.jl b/src/SolverInterface/conic_to_lpqp.jl index 801c42c..a64f591 100644 --- a/src/SolverInterface/conic_to_lpqp.jl +++ b/src/SolverInterface/conic_to_lpqp.jl @@ -241,11 +241,13 @@ function getconstrsolution(wrap::ConicToLPQPBridge) wrap.A * getsolution(wrap.m) end status(wrap::ConicToLPQPBridge) = status(wrap.m) -function getobjval(wrap::ConicToLPQPBridge) - if wrap.sense == :Max - return -getobjval(wrap.m) - else - return getobjval(wrap.m) +for f in [:getobjval, :getobjbound] + @eval function ($f)(wrap::ConicToLPQPBridge) + if wrap.sense == :Max + return -$f(wrap.m) + else + return $f(wrap.m) + end end end