Skip to content

Fast Hilbert space-filling curve transformation using a LUT

License

Notifications You must be signed in to change notification settings

DoubleHyphen/fast-hilbert

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fast Hilbert

Build Status doc crates.io usage license

Fast Hilbert 2D curve computation using an efficient Lookup Table (LUT) and a more efficient "orientation-stable encoding". The curve is slightly than the original hilbert curve. Every odd iteration is oriented by 90 degrees compared to the original hilbert implementation.

h1 h2 h3 h4 h5 h6

  • Orientation-stable encoding (all credits to DoubleHyphen see this PR for more information)
  • Convert from discrete 2D space to 1D hilbert space and reverse
  • No order or iteration input required
  • Very fast using an efficient 512 Byte LUT
  • No additional dependencies except for rust std lib.

Benchmarking the conversion from full 256x256 discrete 2D space to the 1D hilbert space, shows that fast_hilbert is almost 5 times faster compared to the fastest 2D hilbert transformation libs written in rust. Benchmarked on a Intel i5-6400 CPU @ 2.70 GHz, 4 Cores with 8 GB RAM:

Library Time Description
fast_hilbert 0.6 ms Optimized for fast computation in 2D discrete space using an efficient LUT
hilbert_2d 2.5 ms Also allows other variants such as Moore and LIU
hilbert_curve 2.0 ms Implements algorithm described on Wikipedia
hilbert 32.1 ms Allows computation of higher dimensional Hilbert curves

About

Fast Hilbert space-filling curve transformation using a LUT

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%