Skip to content

Commit

Permalink
Merge pull request #233 from Ishaanj18/add_uint16
Browse files Browse the repository at this point in the history
added data types UInt16,UInt32,UInt64 to bitinformation_wrapper.jl
  • Loading branch information
observingClouds authored Sep 20, 2023
2 parents 38fd8c0 + 755a11b commit 2a50214
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions xbitinfo/bitinformation_wrapper.jl
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
using BitInformation
using StatsBase

function get_bitinformation(X::AbstractArray{T}; kwargs...) where {T<:Base.IEEEFloat}

BitInformation.signed_exponent!(X)
IC = bitinformation(X; kwargs...)

return IC

# version for floats with biased to signed exponent conversion
function get_bitinformation(X::AbstractArray{<:Base.IEEEFloat}; kwargs...)
BitInformation.signed_exponent!(X) # this changes X in-place
return bitinformation(X; kwargs...)
end


function get_bitinformation(X::AbstractArray{T}; kwargs...) where {T<:Union{Int16,Int32,Int64}}

IC = bitinformation(X; kwargs...)

return IC

end
# version for (un-/signed) integers
get_bitinformation(X::AbstractArray{<:Integer}; kwargs...) = bitinformation(X; kwargs...)

function get_keepbits(bitinfo_dict)
# filter insignificant information via binomial distribution as explained in methods
Expand Down

0 comments on commit 2a50214

Please sign in to comment.