| 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 SuiteSparseDevelopment happens against Julia nightly. To run the tests:
julia +nightly --project -e 'using Pkg; Pkg.test()'That runs the standard mode, which is also what Julia's own CI runs. The comprehensive
mode adds the tests guarded with COMPREHENSIVE, test/issues.jl, and
test/solvers/issues.jl when GPL libraries are available. Run it before a pull request
that touches a kernel, since only the coverage job in CI runs it:
julia +nightly --project -e 'using Pkg; Pkg.test(test_args=["--comprehensive"])'To run just the standalone regressions, use test_args=["issues"]; this selects both
issue suites. test_args=["solvers/issues"] selects only the solver regressions.
The solvers selector includes them only in comprehensive mode, and !issues excludes
both issue suites.
AGENTS.md has the conventions this repository follows, the commands for
running a single test file, the whitespace check and the doctests, and links to the
skills in .agents/skills, which cover particular tasks such as
writing tests, changing the solvers, opening a pull request or upgrading SuiteSparse.