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:
parent
7fd18e9e57
commit
151a6ff6da
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user