We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
create_vector(vars, ds.coeffs, fill_value=0, shape=shape)
switching this default to 0.0 fixes the issue.
I will raise a PR to fix this now
def test_matrices_float_c(): m = Model() x = m.add_variables(pd.Series([0, 0]), 1, name="x") m.add_objective(x * 1.5) c = m.matrices.c assert np.all(c == np.array([1.5, 1.5]))
Fails with
assert np.all(c == np.array([1.5, 1.5]))
E assert False E + where False = <function all at 0x1044e5b30>(array([1, 1]) == array([1.5, 1.5])
The text was updated successfully, but these errors were encountered:
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
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
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
E assert False
E + where False = <function all at 0x1044e5b30>(array([1, 1]) == array([1.5, 1.5])
The text was updated successfully, but these errors were encountered: