Describe the bug
A problem whose only constraint is a quadratic constraint (no linear
constraint rows) returns nan / NoTermination instead of solving. Adding any
linear row makes it solve correctly.
Steps/Code to reproduce bug
import numpy as np
from cuopt.linear_programming.problem import Problem, MINIMIZE
p = Problem()
x = p.addVariable(lb=-np.inf, name="x")
y = p.addVariable(lb=-np.inf, name="y")
p.addConstraint(2*x*x + 2*x*y + 2*y*y <= 6) # ONLY a quadratic constraint
p.setObjective(x + y, sense=MINIMIZE)
p.solve()
print(p.Status, p.ObjValue, x.Value) # 0 nan nan
Output:
Adding e.g. p.addConstraint(x + y >= -5) before solving makes it return the
correct optimum (-2.0 at x = y = -1).
Expected behavior
A problem with only quadratic (second-order-cone) constraints and no linear rows
should solve normally, not return nan.
Environment details:
Additional context
Surfaced while documenting general-convex-quadratic examples; the barrier / SOC
conversion path appears to require a non-empty linear constraint matrix.
Describe the bug
A problem whose only constraint is a quadratic constraint (no linear
constraint rows) returns
nan/NoTerminationinstead of solving. Adding anylinear row makes it solve correctly.
Steps/Code to reproduce bug
Output:
Adding e.g.
p.addConstraint(x + y >= -5)before solving makes it return thecorrect optimum (
-2.0atx = y = -1).Expected behavior
A problem with only quadratic (second-order-cone) constraints and no linear rows
should solve normally, not return
nan.Environment details:
release/26.06, cuOpt 26.06.00, includes Add support for general convex quadratic constraints (x^T Q x + c^T x… #1361)Additional context
Surfaced while documenting general-convex-quadratic examples; the barrier / SOC
conversion path appears to require a non-empty linear constraint matrix.