You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using BijectiveHilbert
xy =zeros(Int64, 4, 8)
alg =Compact(Int64, [4, 8])
CI =CartesianIndices(xy)
for cixy in CI
ix, iy =Tuple(cixy)
z =encode_hilbert(alg, [ix, iy])
xy[ix,iy] = z
display(decode_hilbert!(alg, [ix,iy], z))
enddisplay(xy)
You found a bug! The goal of this algorithm is to give you continuous indices. It looks to me like the 6th bit, that gives the value 32, is extra on the right side. 49 - 32 = 17, so it would be next.
This is going to be difficult to debug because the original preprint had errors, the paper had errors, and the final code I used as a reference didn't have much testing, so who knows how it was? I just reread the main paper, and it will take some attention.
By the way, the best workaround for this is to use a regular Hilbert curve, record the indices, throw out the ones you don't want, and then sort them. It's an extra level of indirection, and it can be time consuming, but sometimes it's enough.
Meanwhile, I'll take a look again at the paper and code. And thank you!
MWE
The above yields
It appears that the indexing is off and that the curve is not continuous.
Am I doing something wrong or is it just not possible to have it continuous?
The text was updated successfully, but these errors were encountered: