Skip to content

Commit

Permalink
check _skip_trivial_costraints before the constraint body
Browse files Browse the repository at this point in the history
  • Loading branch information
bknueven committed Apr 8, 2024
1 parent c68ce66 commit ad7011f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions pyomo/solvers/plugins/solvers/gurobi_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,8 @@ def _add_constraint(self, con):
if not con.active:
return None

if is_fixed(con.body):
if self._skip_trivial_constraints:
return None
if self._skip_trivial_constraints and is_fixed(con.body):
return None

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

Expand Down
5 changes: 2 additions & 3 deletions pyomo/solvers/plugins/solvers/xpress_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,9 +667,8 @@ def _add_constraint(self, con):
if not con.active:
return None

if is_fixed(con.body):
if self._skip_trivial_constraints:
return None
if self._skip_trivial_constraints and is_fixed(con.body):
return None

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

Expand Down

0 comments on commit ad7011f

Please sign in to comment.