Skip to content

Commit

Permalink
Merge pull request #160 from JuliaOpt/ml/coniclpqp
Browse files Browse the repository at this point in the history
more delicate setvartype condition
  • Loading branch information
mlubin committed Mar 29, 2017
2 parents 7529596 + 0f4a0da commit 5f5e035
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/SolverInterface/conic_to_lpqp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down

0 comments on commit 5f5e035

Please sign in to comment.