Skip to content

[BUG] segfault when writing MPS with an empty row #1663

Description

@mlubin

The following code segfaults on main and 26.6:

from cuopt.linear_programming import Problem
from cuopt.linear_programming.problem import LinearExpression

problem = Problem("empty-row")

x = problem.addVariable(
    name="x",
    lb=0.0,
    ub=1.0,
)

# A valid constant-only constraint: 0 <= 1.
empty_expression = LinearExpression(
    vars=[],
    coefficients=[],
    constant=0.0,
)
problem.addConstraint(empty_expression <= 1.0, name="empty")

problem.setObjective(x)
problem.writeMPS("empty-row.mps")

Metadata

Metadata

Assignees

Labels

awaiting responseThis expects a response from maintainer or contributor depending on who requested in last comment.bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions