Skip to content

Commit

Permalink
fix: recursion problem in glpk_interface (#59)
Browse files Browse the repository at this point in the history
_remove_variables would call self.variables for models with more than 350 variables.
  • Loading branch information
phantomas1234 authored Jan 20, 2017
1 parent 0d416e8 commit ff08502
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions optlang/glpk_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,8 @@ def _remove_variables(self, variables):
if len(variables) > 0:
if len(variables) > 350:
delete_indices = [variable._index - 1 for variable in variables]
keep_indices = [i for i in range(0, len(self.variables)) if i not in delete_indices]
self._variables = self.variables.fromkeys(keep_indices)
keep_indices = [i for i in range(0, len(self._variables)) if i not in delete_indices]
self._variables = self._variables.fromkeys(keep_indices)
else:
for variable in variables:
del self._variables[variable.name]
Expand Down

0 comments on commit ff08502

Please sign in to comment.