| Documentation | Build Status |
|---|---|
SparseArrays.jl provides functionality for working with sparse arrays in Julia.
This package ships as part of the Julia stdlib, so its version is tied to the Julia version: each Julia release bundles a fixed copy, and it cannot be upgraded separately.
using SparseArrays, LinearAlgebra
A = sparse([1, 2, 3, 3], [1, 2, 1, 3], [4.0, 5.0, 1.0, 6.0]) # rows, columns, values
A[3, 1] # 1.0
nnz(A) # 4 stored entries
x = A \ ones(3) # sparse direct solve through SuiteSparseSee AGENTS.md for the conventions this repository follows. Development happens against Julia nightly. To run the tests, and to build the docs and run the doctests:
julia +nightly --project -e 'using Pkg; Pkg.test()'
julia +nightly --project=docs -e 'using Pkg; Pkg.develop(path="."); include("docs/make.jl")'The second command edits docs/Project.toml; discard that change before committing.
In order to upgrade SparseArrays.jl to use a new release of SuiteSparse, the following steps are necessary:
- Update SuiteSparse in Yggdrasil
- Update the SuiteSparse wrappers in SparseArrays.jl/gen and generate the new wrappers
- Run BumpStdlibs to update the SparseArrays.jl version in julia master
- Update the relevant stdlibs in Julia to pull in the new releases