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

Balas bug #1

Open
danyaljj opened this issue Nov 17, 2015 · 0 comments
Open

Balas bug #1

danyaljj opened this issue Nov 17, 2015 · 0 comments

Comments

@danyaljj
Copy link
Member

From email:

I'm using your open sourced implementation of Balas algorithm. Thank you for making it open. It contains a bug at LBJ2/infer/BalasHook.java:321

for (int i = 0; i < variables; ++i)
  if (negated[i]) {
    x[i] = 1 - x[i];   

At that last line must be "solution" instead of "x", because x is already copied to solution and changes
to x will not affect solution. So solution accessed through getBooleanValue will be wrong
(in the case of for maximization and positive objective coefficients).
Not a bug, but weird: LBJ2/infer/BalasHook.java:342

for (int j = 0; j < Ac.size(i); ++j)
  lhs += x[Av.get(i, j)] * Ac.get(i, j);

These 2 lines do nothing, because x always contains zeros only at that point.

christos-c pushed a commit that referenced this issue Jan 15, 2016
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