From f87cd2569a1c1be3eb145de8bb000e0c8809ee3f Mon Sep 17 00:00:00 2001 From: William Pettersson Date: Sat, 21 Sep 2024 17:02:59 +0100 Subject: [PATCH] Fix LpVariable.isBinary() with LpBinary LpVariable.isBinary() was returning False if the category was LpBinary, this fixes that issue. --- pulp/pulp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pulp/pulp.py b/pulp/pulp.py index a05a964f..e1cade69 100644 --- a/pulp/pulp.py +++ b/pulp/pulp.py @@ -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):