Skip to content

Instantly share code, notes, and snippets.

@chkwon
Created March 21, 2015 04:53
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 chkwon/f51c334bcae78a1b706f to your computer and use it in GitHub Desktop.
Save chkwon/f51c334bcae78a1b706f to your computer and use it in GitHub Desktop.
Simple CPLEX Test
using JuMP, CPLEX
m = Model(solver=CplexSolver())
@defVar(m, x <= 5)
@defVar(m, y <= 45)
@setObjective(m, Min, x + y)
@addConstraint(m, 50x + 24y <= 2400)
@addConstraint(m, 30x + 33y <= 2100)
status = solve(m)
println("Optimal objective: ",getObjectiveValue(m))
println("x = ", getValue(x), " y = ", getValue(y))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment