Closed dannyopts closed 8 months ago
This causes a bug when using the direct api that cost coeffs are rounded to ints
>>> m = Model()
>>> x = m.add_variables(name="x")
>>> m.add_objective(0.1 * x)
>>> m.solve("highs", "direct")
>>> m.objective.value
0.0
>>> m.solve("highs", "lp")
>>> m.objective.value
nan
When accessing model.matrices.c the value is coherrsed to int (see failing test below)
This is because when c is created, it has a default value of 0, which is used to create the initial vector.
switching this default to 0.0 fixes the issue.
I will raise a PR to fix this now
Fails with