Skip to content

Commit

Permalink
Fix LpVariable.isBinary() with LpBinary (#775)
Browse files Browse the repository at this point in the history
LpVariable.isBinary() was returning False if the category was LpBinary,
this fixes that issue.
  • Loading branch information
WPettersson authored Oct 22, 2024
1 parent 6af3801 commit 76b8d2e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pulp/pulp.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,8 @@ def infeasibilityGap(self, mip=1):
return 0

def isBinary(self):
if self.cat == const.LpBinary:
return True
return self.cat == const.LpInteger and self.lowBound == 0 and self.upBound == 1

def isInteger(self):
Expand Down

0 comments on commit 76b8d2e

Please sign in to comment.