Sparse
Types
COO
Coordinate format: (row, col, value) triples
CSR
Compressed Sparse Row
CSC
Compressed Sparse Column
BSR
Block Sparse Row
SparseCOO { cooRows :: !Int, cooCols :: !Int, cooRowIndices :: !(VU.Vector Int), cooColIndices :: !(VU.Vector Int), cooValues :: !(VU.Vector a) }
Coordinate (COO) sparse matrix format.
SparseCSR { csrRows :: !Int, csrCols :: !Int, csrRowPtrs :: !(VU.Vector Int), csrColIndices :: !(VU.Vector Int), csrValues :: !(VU.Vector a) }
Compressed Sparse Row (CSR) format.
SparseCSC { cscRows :: !Int, cscCols :: !Int, cscColPtrs :: !(VU.Vector Int), cscRowIndices :: !(VU.Vector Int), cscValues :: !(VU.Vector a) }
Compressed Sparse Column (CSC) format.
SparseBSR { bsrRows :: !Int, bsrCols :: !Int, bsrBlockRows :: !Int, bsrBlockCols :: !Int, bsrRowPtrs :: !(VU.Vector Int), bsrColIndices :: !(VU.Vector Int), bsrValues :: !(V.Vector (VU.Vector a)) }
Block Sparse Row (BSR) format.
Type Classes
Methods
nnz :: (s a) -> Int
shape :: (s a) -> (Int, Int)
Functions
Create a COO sparse matrix from coordinate arrays.
Create a CSR sparse matrix directly.
Create a CSC sparse matrix directly.
Create sparse matrix from (row, col, value) triples.
Convert dense tensor to sparse COO format.
Density of the sparse matrix (nnz / total elements).
Get a specific row from CSR matrix as a sparse vector.
Sparse-dense matrix multiplication (SpMM).
Add two sparse matrices.
Validate sparse matrix invariants.
Binary search in a sorted vector.