Module convert

Module convert 

Source
Expand description

Helper functions to convert between vanilla array and variants.

This is the module-level documentation.

Functionsยง

d1z_to_vanilla
Reverse the delta and zigzag transformation (vanilla_to_d1z).
d1z_to_vanilla_self
Same as d1z_to_vanilla() but modify the original array.
m1_to_vanilla
Add 1 to each value.
m1_to_vanilla_self
Same as m1_to_vanilla() but modify the original array.
vanilla_to_d1z
Transforms the original input into the difference between consecutive values, then zigzag it. If $x > 0$, $zigzag(x) = 2x$, while $x < 0$, $zigzag(x) = -2x - 1$.
vanilla_to_d1z_self
Same as vanilla_to_d1z() but modify the original array.
vanilla_to_m1
Substract 1 from each value.
vanilla_to_m1_self
Same as vanilla_to_m1() but modify the original array.