BitsX.BitArrays — ModuleBitArraysThis module implements a few functions for constructing Base.BitArray objects.
BitsX.BitArrays.bitarray! — Methodbitarray!(vector::AbstractVector{<:Unsigned}, [dims]) where {T}Return a BitArray with dimensions dims using vector as chunks.
If vector is not a Vector, it will be copied. If vector is a Vector{T} then it will be reinterpreted to T == UInt64 after possible padding.
Examples
julia> (bitarray!([UInt8(1), UInt8(2)]),)
(Bool[1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0],)BitsX.BitArrays.bitarray — Methodbitarray(x::Union{Integer, Base.IEEEFloat}, [dims])Return a BitArray from the bits in x.
Examples
julia> (bitarray(typemax(UInt16)),)
(Bool[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],)
julia> bitarray(typemax(UInt16), (2, 8))
2×8 BitMatrix:
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1BitsX.BitArrays.bitvector — Methodbitvector(x::Union{Integer, Base.IEEEFloat})Return a BitVector with the bits in x.
Examples
julia> (bitvector(UInt8(11)), )
(Bool[1, 1, 0, 1, 0, 0, 0, 0],)
julia> bstring(bitvector(UInt64(1<<32 -1)))
"1111111111111111111111111111111100000000000000000000000000000000"
julia> typeof(bitvector(UInt64(1<<32 -1)))
BitVector (alias for BitArray{1})