CPMpy / cpmpy

Constraint Programming and Modeling library in Python, based on numpy, with direct solver access.
Apache License 2.0
205 stars 19 forks source link

GurobiError when variable lb is smaller then 0 with pow() #149

Closed rubenkindt closed 6 months ago

rubenkindt commented 1 year ago

solver: 'gurobi' CPMpy: version v0.9.9 commit e79b3afedc934a9437c2ddb3a9f54d7e2d7bd3ee

m = Model()
i = intvar(lb=-10, ub=10)
m += pow(i,2)==9
m.solve(solver="gurobi") # crashes

expected behavior: solve i=3, like other solvers ('ortools'...) do

bug found while working on my master thesis. Edits: just layout stuff

tias commented 1 year ago

will fix, gurobi docs say that x >= 0; I have an additional assert half-ready but low in my priority queue...