Skip to content

Commit 7a26243

Browse files
committed
highs: fix constr_get_expr (use actual column indices)
1 parent fc53603 commit 7a26243

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mip/highs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,8 @@ def constr_get_expr(self: "SolverHighs", constr: "mip.Constr") -> "mip.LinExpr":
659659
)
660660
)
661661
expr = mip.xsum(
662-
matrix_value[i] * self.model.vars[i] for i in range(num_nz[0])
662+
matrix_value[i] * self.model.vars[matrix_index[i]]
663+
for i in range(num_nz[0])
663664
)
664665

665666
# Also set sense and constant

0 commit comments

Comments
 (0)