Reference
Contents
Index
SparseMatricesCOO.AbstractSparseMatrixCOOSparseMatricesCOO.SparseMatrixCOOSparseArrays.nnzSparseArrays.nonzerosSparseMatricesCOO.coo_spzerosSparseMatricesCOO.rows
SparseMatricesCOO.AbstractSparseMatrixCOO — TypeAbstractSparseMatrixCOO{Tv,Ti<:Integer} <: AbstractSparseMatrix{Tv,Ti}Supertype for matrix in sparse coordinate format (COO).
SparseMatricesCOO.SparseMatrixCOO — MethodSparseMatrixCOO(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 = 4SparseArrays.nnz — Methodnnz(A)Returns the number of stored (filled) elements in a sparse array.
SparseArrays.nonzeros — Methodnonzeros(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.
SparseMatricesCOO.coo_spzeros — Methodcoo_spzeros(T, m, n)Creates a zero SparseMatrixCOO of type T with m rows and n columns.
SparseMatricesCOO.rows — Methodrows(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.