Hypex v1.1.1 Hypex.Bitstring View Source
This module provides a Hypex register implementation using a Bitstring under the hood.
Using this implementation provides several guarantees about memory, in that the memory cost stays constant and falls well below that of other registers.
Unfortunately this efficiency comes at the cost of some throughput, although this module should be easily sufficient for all but the most write-intensive use cases.
Link to this section Summary
Functions
Takes a list of bits and converts them to a bitstring
Returns a bit from the list of registers
Creates a new bitstring with a size of (2 ^ width) * width
with all bits initialized to 0
Converts a list of registers into a provided accumulator
Sets a bit inside the list of registers
Takes a bitstring and converts it to a list of bits
Link to this section Functions
Takes a list of bits and converts them to a bitstring.
We can just delegate to the native Erlang implementation as it provides the functionality we need built in.
Returns a bit from the list of registers.
Creates a new bitstring with a size of (2 ^ width) * width
with all bits initialized to 0.
Converts a list of registers into a provided accumulator.
Internally we pass everything to the binary reduction function in the utils module, as there’s already a native implementation for accumulation.
Sets a bit inside the list of registers.
Takes a bitstring and converts it to a list of bits.
We can just delegate to the native Erlang implementation as it provides the functionality we need built in.