Skip to content

Commit

Permalink
Merge pull request #36 from sbebo/pull-request/7ce1938c
Browse files Browse the repository at this point in the history
Check problem type after reading from file
  • Loading branch information
joehuchette committed May 17, 2015
2 parents f9f4ca4 + 7ce1938 commit daef548
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/CplexSolverInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ end
CplexSolver(;kwargs...) = CplexSolver(kwargs)
model(s::CplexSolver) = CplexMathProgModel(;s.options...)

loadproblem!(m::CplexMathProgModel, filename::String) = read_model(m.inner, filename)
function loadproblem!(m::CplexMathProgModel, filename::String)
read_model(m.inner, filename)
prob_type = get_prob_type(m.inner)
if prob_type in [:MILP,:MIQP, :MIQCP]
m.inner.has_int = true
end
if prob_type in [:QP, :MIQP, :QCP, :MIQCP]
m.inner.has_qc = true
end
end

function loadproblem!(m::CplexMathProgModel, A, collb, colub, obj, rowlb, rowub, sense)
add_vars!(m.inner, float(obj), float(collb), float(colub))
Expand Down

0 comments on commit daef548

Please sign in to comment.