From ccb1a1ed25f2b7019cc051bf8889da3b499d6d15 Mon Sep 17 00:00:00 2001 From: Alinson S Xavier Date: Thu, 12 Aug 2021 07:52:34 -0500 Subject: [PATCH] GurobiSolver: Fix LHS extraction --- miplearn/solvers/gurobi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miplearn/solvers/gurobi.py b/miplearn/solvers/gurobi.py index d49906a..751f66c 100644 --- a/miplearn/solvers/gurobi.py +++ b/miplearn/solvers/gurobi.py @@ -231,7 +231,7 @@ class GurobiSolver(InternalSolver): for (i, gp_constr) in enumerate(gp_constrs): expr = model.getRow(gp_constr) for j in range(expr.size()): - tmp[i, j] = expr.getCoeff(j) + tmp[i, expr.getVar(j).index] = expr.getCoeff(j) lhs = tmp.tocoo() if self._has_lp_solution: