coin-or / coin-or/python-mip

SEGFAULT after adding empty rows and defining coefficients later via column parameter of method add_var

Open
#184 0 comments 0 reactions 0 assignees View on GitHub
bug cbc reproducible
Dominant language
Linear Programming
Stars
600
Forks
108
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

**To Reproduce**
import mip

m = mip.Model("column_test", sense=mip.MAXIMIZE, solver_name=mip.CBC)

c1 = m.add_constr(mip.LinExpr(const=-10, sense=mip.LESS_OR_EQUAL), name="c1")
c2 = m.add_constr(mip.LinExpr(const=-10, sense=mip.LESS_OR_EQUAL), name="c2")
c3 = m.add_constr(mip.LinExpr(const=-10, sense=mip.LESS_OR_EQUAL), name="c3")
a1 = m.add_var(name="a1", obj=1, column=mip.Column(constrs=[c1, c2], coeffs=[1., 1.]))
a2 = m.add_var(name="a2", obj=1, column=mip.Column(constrs=[c1, c3], coeffs=[1., 1.]))
a3 = m.add_var(name="a3", obj=1, column=mip.Column(constrs=[c2, c3], coeffs=[1., 1.]))

m.write("prob.lp")

**Expected behavior**
The coefficients are added to the rows when the variables are created and the model is correctly written to file.

**Desktop (please complete the following information):**
- Operating System, version: OS X
- Python version: 3.9.1
- Python-MIP version (we recommend you to test with the latest version): 1.13.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.