SparseArrays.jl
SparseArrays.jl copied to clipboard
SparseArrays.jl is a Julia stdlib
I posted this originally as a question here https://discourse.julialang.org/t/slow-arithmetic-on-views-of-sparse-matrices/3644 and got some useful feedback. It seems though that this functionality could be built into julia proper. Arithmetic on views of...
I would expect `similar` to work for creating empty sparse vectors: ```julia julia> similar(SparseVector{Float64,Int}, 5) ERROR: MethodError: Cannot `convert` an object of type Tuple{Int64} to an object of type SparseVector{Float64,Int64}...
Currently the 5 fields are named: - `m` - `n` - `colptr` - `rowval` - `nzval` My complaints are: 1. "row" and "col" are used in two of the fields,...
`indices` is our abstraction for getting the indices so one can iterate the index of a matrix. It works great for dense matrices. However, for sparse matrices, it is almost...
`sprand` accepts a function argument `rfn` that is used to generate the non zero values of a sparse random matrix or vector. I find the calling convention with rfn to...
When implementing custom array types it's useful to independently resolve indices using `to_indices`, and subsequently index into an underlying array with them. Right now this works with `Array`, but fails...
As far as I know, we currently export access to nonzero values to sparse vectors and sparse column views, via `SparseArrays.nonzeros`. However, the corresponding `SparseArrays.nonzeroinds` is not exported, which makes...
It seems that the TODO mentioned in https://github.com/JuliaLang/julia/blob/master/stdlib/SparseArrays/src/sparsematrix.jl#L2701 causes an error reported in https://stackoverflow.com/questions/55326817/mapping-a-function-to-an-array-of-sparse-matrices-in-julia. This issue is similar to https://github.com/JuliaLang/julia/issues/29034 but seems to be a separate case (not 100% sure,...
In JuliaLang/julia#33054 I proposed to expose `AbstractSparseMatrixCSC` interface so that it is possible for package developers to easily write `SparseMatrixCSC`-like custom matrices (without worrying about implementing all the complex functions...
It looks like `mapreduce` falls back to a generic implementation for `SparseVector` rather than taking advantage of the structure of the data type. EDIT. It seems that writing a method...