Skip to content

Commit

Permalink
julia interface cleanup + comments
Browse files Browse the repository at this point in the history
  • Loading branch information
milankl authored Sep 19, 2023
1 parent e6c5147 commit f6c80c5
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{UInt16,UInt32,UInt64,Int16,Int32,Int64}}

IC = bitinformation(X; kwargs...)

return IC

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

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

0 comments on commit f6c80c5

Please sign in to comment.