Skip to content
New issue

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

Nothing happens on setting constant through set_constant method #50

Open
har-gup opened this issue May 2, 2017 · 1 comment
Open

Nothing happens on setting constant through set_constant method #50

har-gup opened this issue May 2, 2017 · 1 comment

Comments

@har-gup
Copy link

har-gup commented May 2, 2017

Here is the sample project which is reproducing the problem: https://github.com/har-gup/rhea-constant-issue.

The same issue doesn't happen if we use edit variable in a constraint instead of constant.
I tried debugging the issue, and saw that set_constant_ method is returning from https://github.com/Nocte-/rhea/blob/0.3/rhea/simplex_solver.cpp#L184 without adding any row to infeasible_rows_, and therefore dual_optimize function is not called.

@Nocte- If we change following lines https://github.com/Nocte-/rhea/blob/0.3/rhea/simplex_solver.cpp#L164 and https://github.com/Nocte-/rhea/blob/0.3/rhea/simplex_solver.cpp#L202 to
auto delta = -(constant - evs.prev_constant);, and expr.add(expr.coefficient(evs.marker) * delta); respectively, the way it is in suggest_value_ function https://github.com/Nocte-/rhea/blob/0.3/rhea/simplex_solver.cpp#L265 then it works fine.

@har-gup
Copy link
Author

har-gup commented May 7, 2017

@Nocte- Please see whether the fix I suggested above is fine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant