Synopsis

module sparse: (T: field) -> {
type t = T.t
type~ csr [n] [m] = ?[nnz].{col_idx: [nnz]i64, dummy_m: [m](), dummy_n: [n](), row_off: [n]i64, vals: [nnz]T.t}
type~ csc [n] [m] = ?[nnz].{col_idx: [nnz]i64, dummy_m: [n](), dummy_n: [m](), row_off: [m]i64, vals: [nnz]T.t}
type msr [n] [m] = {col_idx: [n]i64, dummy_m: [m](), vals: [n]T.t}
type msc [n] [m] = {col_idx: [m]i64, dummy_m: [n](), vals: [m]T.t}
module csrmodule cscmodule msrmodule msc}

Description

module sparse

Sparse matrix module with different representations, including a compressed sparse row (CSR) representation and a mono sparse row (MSR) representation. The representations are parameterised over a field (defined in the linalg package). The resulting module includes submodules for the different representations, including a csr module, a csc module, an msr module, and an msc module. Sparse matrix-vector multiplication is available in the csr and msr modules.