mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-23 00:10:28 +01:00
better info in sparsify!
This commit is contained in:
parent
d31933a02f
commit
d69e33629b
@ -108,14 +108,10 @@ end
|
|||||||
|
|
||||||
function sparsify!(M::AbstractArray{T}, eps=eps(T); verbose=false) where T
|
function sparsify!(M::AbstractArray{T}, eps=eps(T); verbose=false) where T
|
||||||
densM = dens(M)
|
densM = dens(M)
|
||||||
if verbose
|
|
||||||
@info("Sparsifying $(size(M))-matrix... ")
|
|
||||||
end
|
|
||||||
|
|
||||||
clamp_small!(M, eps)
|
clamp_small!(M, eps)
|
||||||
|
|
||||||
if verbose
|
if verbose
|
||||||
@info("$(rpad(densM, 20)) → $(rpad(dens(M),20))), ($(count(!iszero, M)) non-zeros)")
|
@info("Sparsifying $(size(M))-matrix... \n $(rpad(densM, 20)) → $(rpad(dens(M),20))), ($(count(!iszero, M)) non-zeros)")
|
||||||
end
|
end
|
||||||
|
|
||||||
return sparse(M)
|
return sparse(M)
|
||||||
|
Loading…
Reference in New Issue
Block a user