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

WIP: Refactoring JuMP.solve #1033

Closed
wants to merge 6 commits into from
Closed

Conversation

yeesian
Copy link
Contributor

@yeesian yeesian commented May 25, 2017

Because it looks too forbidding, and I hope it might eventually be more like

solve(m::JuMP.AbstractModel, args...; kwargs...) =
    error("`solve()` not implemented for $(typeof(m))")

function solve(
        m::JuMP.Model;
        suppress_warnings=false,
        relaxation=false
    )
    traits = ProblemTraits(m, relaxation=relaxation) # to determine what solvers we can use
    build!(m, traits=traits, suppress_warnings=suppress_warnings, relaxation=relaxation)
    MathProgBase.optimize!(m.internalModel)
    stat = MathProgBase.status(m.internalModel)
    update!(m, stat, traits, relaxation)
    stat
end

The idea is to let ProblemTraits capture all information that needs to be known about the Model and Problem, for build! and update! to perform the necessary pre-solve and post-solve work.

for all the postprocessing that happens after
`MathProgBase.optimize!(m.internalModel)` before `JuMP.solve()` returns
the status code
so that it can be used in `postsolveupdate!()`
@yeesian yeesian changed the title WIP: Refactoring JuMP.solve Refactoring JuMP.solve May 25, 2017
@yeesian yeesian changed the title Refactoring JuMP.solve WIP: Refactoring JuMP.solve May 25, 2017
@mlubin
Copy link
Member

mlubin commented May 25, 2017

Travis is failing because there's a very delicate interplay of return status, solver pathway, and whether we ask the solver for primal and dual solutions. Everything will change with JuliaOpt/MathProgBase.jl#156 which I'm planning on working on soon, so you may want to hold off on this PR.

@yeesian
Copy link
Contributor Author

yeesian commented May 25, 2017

no hurry at all

@mlubin
Copy link
Member

mlubin commented Jun 9, 2017

Closing, we can revisit if needed after JuliaOpt/MathProgBase.jl#164

@mlubin mlubin closed this Jun 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants