Skip to content

About

SparseArrays.jl is a Julia stdlib for working with sparse matrices

Topics

Resources

Stars

109 stars

Watchers

11 watching

Forks

Latest commit

 

History

1,040 Commits

Folders and files

Repository files navigation

SparseArrays

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 SuiteSparse

Contributing

Development 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 pointers to the guides for the solvers, the test suite and upgrading SuiteSparse.

About

SparseArrays.jl is a Julia stdlib for working with sparse matrices

Topics

Resources

Stars

109 stars

Watchers

11 watching

Forks

Used by

Contributors

Languages