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

more delicate setvartype condition #160

Merged
merged 2 commits into from
Mar 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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