From 69e0f3d9e20c0b07031482b1d15a99993ef1713d Mon Sep 17 00:00:00 2001 From: Jukka Aho Date: Sat, 9 May 2026 18:21:34 +0300 Subject: [PATCH] chore(sparse): remove unused SparseVector DOK prototype Delete the experimental dictionary-backed sparse vector helper not wired into the package entry manifest. - Drop `src/sparse/sparsevectordok.jl`. --- src/sparse/sparsevectordok.jl | 47 ----------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 src/sparse/sparsevectordok.jl diff --git a/src/sparse/sparsevectordok.jl b/src/sparse/sparsevectordok.jl deleted file mode 100644 index d95297f..0000000 --- a/src/sparse/sparsevectordok.jl +++ /dev/null @@ -1,47 +0,0 @@ -# This file is a part of JuliaFEM. -# License is MIT: see https://github.com/JuliaFEM/FEMSparse.jl/blob/master/LICENSE - -mutable struct SparseVectorDOK{Tv,Ti<:Integer} <: AbstractSparseArray{Tv,Ti,1} - data::Dict{Ti,Tv} -end - -function SparseVectorDOK() - return SparseVectorDOK(Dict{Int64,Float64}()) -end - -function SparseVectorDOK{Tv,Ti<:Integer}(b::SparseVector{Tv,Ti}) - I, V = findnz(b) - c = SparseVectorDOK() - add!(c, I, V) - return c -end - -function SparseVectorDOK{T}(b::Vector{T}) - return SparseVectorDOK(sparsevec(b)) -end - -function add!{Tv,Ti<:Integer}(b::SparseVectorDOK{Tv,Ti}, i::Ti, v::Tv) - b.data[i] = get(b, i) + v - return nothing -end - -function add!{Tv,Ti<:Integer}(b::SparseVectorDOK{Tv,Ti}, dofs::Vector{Ti}, data::Vector{Tv}) - @assert length(dofs) == length(data) - z = Tv(0) - for i = 1:length(dofs) - @inbounds b.data[dofs[i]] = Base.get(b.data, i, z) + data[i] - end - return nothing -end - -function get{Tv,Ti<:Integer}(b::SparseVectorDOK{Tv,Ti}, i::Ti) - return Base.get(b.data, i, Tv(0)) -end - -function get!{Tv,Ti<:Integer}(b::SparseVectorDOK{Tv,Ti}, dofs::Vector{Ti}, data::Vector{Tv}) - for (i, j) in enumerate(dofs) - data[i] = get(b, i) - end - return nothing -end -