mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-08 02:18:51 -06:00
InternalSolver: set_constraint_sense, set_constraint_rhs
This commit is contained in:
@@ -274,6 +274,14 @@ class GurobiSolver(InternalSolver):
|
||||
def get_constraint_slacks(self):
|
||||
return {c.ConstrName: c.Slack for c in self.model.getConstrs()}
|
||||
|
||||
def set_constraint_sense(self, cid, sense):
|
||||
c = self.model.getConstrByName(cid)
|
||||
c.Sense = sense
|
||||
|
||||
def set_constraint_rhs(self, cid, rhs):
|
||||
c = self.model.getConstrByName(cid)
|
||||
c.RHS = rhs
|
||||
|
||||
def relax(self):
|
||||
self.model = self.model.relax()
|
||||
self._update_vars()
|
||||
|
||||
Reference in New Issue
Block a user