1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-12-25 02:15:29 +01:00

better density for dense matrices

This commit is contained in:
kalmarek 2017-08-27 18:57:27 +02:00
parent 7fd18e9e57
commit 151a6ff6da

View File

@ -55,7 +55,7 @@ end
include("OrbitDecomposition.jl")
dens(M::SparseMatrixCSC) = length(M.nzval)/length(M)
dens(M::AbstractArray) = sum(abs.(M) .!= 0)/length(M)
dens(M::AbstractArray) = length(findn(M)[1])/length(M)
function sparsify{T}(U::AbstractArray{T}, check=true)
W = deepcopy(U)