sparsify for sparse arrays

This commit is contained in:
kalmar 2017-06-21 16:38:57 +02:00
parent 8ce128d926
commit 806d9c822c

View File

@ -53,6 +53,7 @@ function sparsify!{T}(U::SparseMatrixCSC{T}, eps=eps(T))
return U
end
sparsify{T}(U::SparseMatrixCSC{T}, eps=eps(T)) = sparsify!(deepcopy(U), eps)
small_to_zero!{T}(A::AbstractArray{T}, eps=eps(T)) = A[abs(A) .< eps] = zero(T)
function init_model(Uπs)