Skip to content

Commit

Permalink
fix quadratic objective support after renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
mlubin committed Jun 10, 2013
1 parent 76a2751 commit 478f6df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MathProg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ function solveMIP(m::Model)
# undocumented support for quadratic MIPs with gurobi:
if m.objIsQuad
gurobisolver = getrawsolver(m.internalModel)
MathProgBase.mipsolver.add_qpterms!(gurobisolver, [v.col for v in m.objective.qvars1], [v.col for v in m.objective.qvars2], m.objective.qcoeffs)
MathProgBase.mipsolver.add_qpterms!(gurobisolver, [v.col for v in m.quadobj.qvars1], [v.col for v in m.quadobj.qvars2], m.quadobj.qcoeffs)
end

optimize(m.internalModel)
Expand All @@ -775,7 +775,7 @@ function solveMIP(m::Model)
if m.objSense == "max"
m.objVal = -m.objVal
end
m.objVal += !m.objIsQuad ? m.objective.constant : m.objective.aff.constant
m.objVal += m.objective.constant
m.colVal = getsolution(m.internalModel)
end

Expand Down

0 comments on commit 478f6df

Please sign in to comment.