better density for dense matrices

This commit is contained in:
kalmarek 2017-08-27 18:57:27 +02:00
parent 7fd18e9e57
commit 151a6ff6da
1 changed files with 1 additions and 1 deletions

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)