data SparseFormat { } #
COO

Coordinate format: (row, col, value) triples

CSR

Compressed Sparse Row

CSC

Compressed Sparse Column

BSR

Block Sparse Row

data SparseCOO a { } #
SparseCOO { cooRows :: !Int, cooCols :: !Int, cooRowIndices :: !(VU.Vector Int), cooColIndices :: !(VU.Vector Int), cooValues :: !(VU.Vector a) }
Coordinate (COO) sparse matrix format.
data SparseCSR a { } #
SparseCSR { csrRows :: !Int, csrCols :: !Int, csrRowPtrs :: !(VU.Vector Int), csrColIndices :: !(VU.Vector Int), csrValues :: !(VU.Vector a) }
Compressed Sparse Row (CSR) format.
data SparseCSC a { } #
SparseCSC { cscRows :: !Int, cscCols :: !Int, cscColPtrs :: !(VU.Vector Int), cscRowIndices :: !(VU.Vector Int), cscValues :: !(VU.Vector a) }
Compressed Sparse Column (CSC) format.
data SparseBSR a { } #
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.
class Sparse s { } #

Methods

nnz :: (s a) -> Int
shape :: (s a) -> (Int, Int)
mkCOO :: VU.Unbox a { } #
Create a COO sparse matrix from coordinate arrays.
mkCSR :: VU.Unbox a { } #
Create a CSR sparse matrix directly.
mkCSC :: VU.Unbox a { } #
Create a CSC sparse matrix directly.
fromTriples :: VU.Unbox a { } #
Create sparse matrix from (row, col, value) triples.
fromDense :: (VU.Unbox a, Eq a, Num a) { } #
Convert dense tensor to sparse COO format.
sh :: { } #
toCSR :: VU.Unbox a { } #
row :: { } #
col :: { } #
val :: { } #
toCSC :: VU.Unbox a { } #
col :: { } #
row :: { } #
col :: { } #
val :: { } #
toCOO :: VU.Unbox a { } #
end :: { } #
toDense :: (VU.Unbox a, Num a) { } #
j :: { } #
density :: (Sparse s) => (s a) -> Double { } #
Density of the sparse matrix (nnz / total elements).
getRow :: VU.Unbox a { } #
Get a specific row from CSR matrix as a sparse vector.
end :: { } #
getCol :: VU.Unbox a { } #
end :: { } #
colSlice :: { } #
valSlice :: { } #
get :: (VU.Unbox a, Num a) { } #
end :: { } #
colSlice :: { } #
valSlice :: { } #
slice :: VU.Unbox a { } #
rowStart :: { } #
rowEnd :: { } #
j :: { } #
coo :: { } #
transpose :: VU.Unbox a { } #
end :: { } #
spmv :: (VU.Unbox a, Num a) { } #
end :: { } #
col :: { } #
val :: { } #
xVal :: { } #
foldM :: { } #
spmm :: (VU.Unbox a, Num a) { } #
Sparse-dense matrix multiplication (SpMM).
elemMul :: (VU.Unbox a, Num a) { } #
add :: (VU.Unbox a, Num a, Eq a) { } #
Add two sparse matrices.
validate :: VU.Unbox a { } #
Validate sparse matrix invariants.
curr :: { } #
col :: { } #
compact :: (VU.Unbox a, Num a, Eq a) { } #
binarySearch :: (VU.Vector Int) -> Int -> Maybe Int { } #
Binary search in a sorted vector.
instance Sparse SparseCOO { }
instance Sparse SparseCSR { }
instance Sparse SparseCSC { }