erlzord
Copyright (c) 2017 Guilherme Andrade
Version: 1.0.3
Authors: Guilherme Andrade (erlzord(at)gandrade(dot)net).
erlzord: N-dimensional Z-order curves for Erlang
erlzord is a straightforward Erlang implementation of the Z-order curve function.
- Any number of dimensions is supported
- No limit on the bitsize of output values
The code was successfully tested on generations 17, 18 and 19 of Erlang/OTP; the test cases and their data were automatically generated based on an existing Python implementation from the rubik project.
<a name=”Examples”>Examples</a>
% 1d points
Config = erlzord:config(1, 0, 100), % Coordinate values between 0 and 100
erlzord:encode({42}, Config), % 42
erlzord:decode(42, Config). % {42}
% 2d points
Config = erlzord:config(2, 0, 100),
erlzord:encode({50,0}, Config), % 1284
erlzord:decode(1284, Config). % {50,0}
% 3d points
Config = erlzord:config(3, 0, 100),
erlzord:encode({0,0,100}, Config), % 1179904
erlzord:decode(1179904, Config). % {0,0,100}
% 10d points
Config = erlzord:config(10, 0, 100),
erlzord:encode(
{100, 100, 100, 100, 100, 100, 100,
100, 100, 100}, Config), % 1180590494818577154048
erlzord:decode(
1180590494818577154048, Config). % {100,100,..,100}.
<a name=”TODO”>TODO</a>
- Range searches
Modules
| erlzord |