From 76b8d2e2c6445af20e2fd7c695a83ac9df99c90e Mon Sep 17 00:00:00 2001 From: William Pettersson Date: Tue, 22 Oct 2024 12:33:36 +0100 Subject: [PATCH] Fix LpVariable.isBinary() with LpBinary (#775) 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):