-
Notifications
You must be signed in to change notification settings - Fork 506
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
unrespected bounds #169
Comments
Good catch once again! Another easy fix would be to set |
I'd rather not change the logic too much to be honest, cython allows for breaks in loops anyway. (also the only reason why I spotted it is because I use your code as a benchmark, I am implementing something very similar that directly computes Gamma x U :)) |
Btw, there are a few things that could be improved in this cython code, mostly compatibility-wise. You should use fuse types to be able to use float32 or float64 types seemlessly for example |
I am a newbie in Cython, so any improvement to the code would be welcome, feel free to do that in the PR as well. |
errr I should have run it locally, tests are failing |
That's gonna be more work, I'll fix the bug and open a new issue for later on |
tests are passing |
Hi,
There is a (subtle) bug in EMD_1d: the indices i and j are allowed to reach n and m, therefore these lines have unkown behaviour (the resulting values w_i and w_j are dereferenced from the next memory slot in the machine, therefore it could be any value or even fail depending on compiler).
An easy fix would be to change the while condition to a while True and add break condiditions within the if-else branches.
POT/ot/lp/emd_wrap.pyx
Line 191 in 0a1e8cd
POT/ot/lp/emd_wrap.pyx
Line 199 in 0a1e8cd
I'll send a pull request if you are happy with this alternative
The text was updated successfully, but these errors were encountered: