Skip to content

Instantly share code, notes, and snippets.

@abelsiqueira
Created June 19, 2015 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abelsiqueira/d0a8fa2507b271a77be5 to your computer and use it in GitHub Desktop.
Save abelsiqueira/d0a8fa2507b271a77be5 to your computer and use it in GitHub Desktop.
Testing Interface with MathProgBase
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