Created
June 19, 2015 16:32
-
-
Save abelsiqueira/d0a8fa2507b271a77be5 to your computer and use it in GitHub Desktop.
Testing Interface with MathProgBase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CUTEst | |
using Ipopt | |
using CUTEst.MathProgBaseInterface | |
if length(ARGS) != 1 | |
error("Usage: julia test.jl PROBLEM") | |
end | |
nlp = CUTEstModel(ascii(ARGS[1])) | |
m = MathProgBase.model(IpoptSolver()) | |
CUTEst.MathProgBaseInterface.load_cutest_problem!(m, nlp) | |
MathProgBase.optimize!(m) | |
objval = MathProgBase.getobjval(m) | |
x = MathProgBase.getsolution(m) | |
println("Optimal value: $objval") | |
println("Solution: $x") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment