* Fred lunnon <fred.lunnon@gmail.com> [Apr 21. 2012 08:22]:
3-D Hilbert walk/curve? Joerg Arndt challenged me to find an algorithm for this a couple of years back, and it was discussed on math-fun then. I can dig out the code for my n-D solution if required: I don't know whether JJA ever got around to including it in his monumental fxtbook.
Searching for the terms Lunnon Hilbert curve points you to http://www.jjj.de/fxt/demo/comb/#hilbert-ndim This is the direct translation (Java --> C++) of the "first generation" algorithm you gave. Quite shockingly it is not even mentioned in the fxtbook (this a by mistake and I have NO idea how that could happen)! I now made that a To-Do item for the next edition. Also The errata at http://www.jjj.de/fxt/fxtbook-errata.txt are now updated to contain ------------------------------------------------------------ Page 83 (section 1.31.1): An algorithm for the generation of n-dimensional Hilbert curves, given by Fred Lunnon, is implemented in the class in fxt/src/comb/hilbert-ndim.h The corresponding program showing usage of the class is fxt/demo/comb/hilbert-ndim-demo.cc ------------------------------------------------------------ My latest edition of your "second generation" algorithm is now at http://www.jjj.de/lunnon/ (just for this list, not linked from anywhere). I revisited the code several times editing it (there are issues of mixed "has a"/"is a" relationships and quite a lot of variable shadowing) but I have so far not completed my work on it. This was one of several To-Do items that annoyingly just did not make it. Best regards, jj P.S.: Just got the first year's royalties from Springer and apparently putting the full text online for free download is (number-of-sold-copies wise) a VERY bad idea. The stupid over-pricing by Springer may have helped as well: 130 Euro for a book that has no color in it, and that's down from an initial 160 Euro. _I_ certainly would not by it!
Gosper also had a moderately trenchant view on this topic too, I recall --- I'll leave that matter to his discretion (always asssuming he can remember where he put it).
Fred Lunnon
[...]