Last active
September 2, 2016 16:22
-
-
Save sschnug/d50e35ca5f0b5ea771f4c3f078d2efda to your computer and use it in GitHub Desktop.
Example
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
from gurobipy import * | |
m = Model("model") | |
x = m.addVar(lb=0.0, name="x") | |
y = m.addVar(lb=0.0, name="y") | |
m.update() | |
obj = -x*x - y*y | |
m.setObjective(obj) # default: minimize | |
m.addConstr(x + y >= 1, "c0") | |
m.addConstr(x + y <= 1, "c1") | |
m.optimize() | |
# Output | |
# gurobipy.GurobiError: Objective Q not PSD (negative diagonal entry) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment