Reference

Index

SparseMatricesCOO.SparseMatrixCOOMethod
SparseMatrixCOO(m, n, rows, cols, vals)

Creates a sparse matrix stored in COO format.

Examples

julia> A = SparseMatrixCOO(3, 4, [1, 2, 2, 4], [1, 2, 3, 4], [4.0, 3.0, -2.0, 6.0])
3×4 SparseMatrixCOO{Float64, Int64} with 4 stored entries:
┌─────┐
1 │⠀⠄⠀⠀⠀│ > 0
3 │⠀⠀⠁⠁⡀│ < 0
└─────┘
⠀1⠀⠀⠀4⠀
⠀nz = 4
source
SparseArrays.nonzerosMethod
nonzeros(A)

Return a vector of the structural nonzero values in sparse array A. This includes zeros that are explicitly stored in the sparse array. The returned vector points directly to the internal nonzero storage of A, and any modifications to the returned vector will mutate A as well. See rows.

source
SparseMatricesCOO.rowsMethod
rows(A::AbstractSparseMatrixCOO)

Return a vector of the row indices of A. Any modifications to the returned vector will mutate A as well. Providing access to how the row indices are stored internally can be useful in conjunction with iterating over structural nonzero values. See also nonzeros.

source