Skip to content

Commit ad7011f

Browse files
committed
check _skip_trivial_costraints before the constraint body
1 parent c68ce66 commit ad7011f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Diff for: pyomo/solvers/plugins/solvers/gurobi_direct.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,8 @@ def _add_constraint(self, con):
493493
if not con.active:
494494
return None
495495

496-
if is_fixed(con.body):
497-
if self._skip_trivial_constraints:
498-
return None
496+
if self._skip_trivial_constraints and is_fixed(con.body):
497+
return None
499498

500499
conname = self._symbol_map.getSymbol(con, self._labeler)
501500

Diff for: pyomo/solvers/plugins/solvers/xpress_direct.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,8 @@ def _add_constraint(self, con):
667667
if not con.active:
668668
return None
669669

670-
if is_fixed(con.body):
671-
if self._skip_trivial_constraints:
672-
return None
670+
if self._skip_trivial_constraints and is_fixed(con.body):
671+
return None
673672

674673
conname = self._symbol_map.getSymbol(con, self._labeler)
675674

0 commit comments

Comments
 (0)