mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-14 22:20:28 +01:00
FIXXX: clamp to 0 only those eps-close to 0, not < eps
This commit is contained in:
parent
33b45dd518
commit
3ff649683a
@ -58,7 +58,7 @@ dens(M::AbstractArray) = sum(abs.(M) .!= 0)/length(M)
|
||||
|
||||
function sparsify{T}(U::AbstractArray{T}, check=true)
|
||||
W = deepcopy(U)
|
||||
W[W .< eps(T)] .= zero(T)
|
||||
W[abs.(W) .< eps(T)] .= zero(T)
|
||||
if check && rank(W) != rank(U)
|
||||
info("Sparsification would decrease the rank!")
|
||||
W = U
|
||||
|
Loading…
Reference in New Issue
Block a user