Use when working with sparse matrices, sparse storage formats (CSR, CSC, COO, BSR, ELL), sparse matrix-vector multiply (SpMV), sparse matrix-matrix multiply (SpGEMM), triangular solves, level scheduling, ILU and IC preconditioners, iterative solvers (CG, GMRES, BiCGSTAB), algebraic multigrid, reordering (RCM, AMD, nested dissection, Metis), fill-in analysis, graph-based sparsity reasoning, graph partitioning, coloring, and sparse direct solvers.
Reason about, implement, optimize, and debug sparse matrix algorithms, iterative and direct solvers, preconditioners, reorderings, and the graph-theoretic structure underlying sparsity patterns.
Use when the task involves:
| Format | Best for | Notes |
|---|---|---|
| CSR (Compressed Sparse Row) | row-wise SpMV, general kernels | most common default; row pointers + column indices + values |
| CSC (Compressed Sparse Column) | column-wise access, direct solvers | transpose of CSR; natural for column-oriented factorization |
| COO (Coordinate) | assembly, incremental construction, format conversion | simple triplet storage; sort by row or column for conversion |
| BSR (Block Sparse Row) | FEM matrices with fixed block size | block entries stored as dense sub-matrices; improves register reuse |
| ELL (ELLPACK) | GPU SpMV with uniform row lengths | padded to max nnz per row; wasteful if row lengths vary widely |
| DIA (Diagonal) | banded/stencil matrices | stores offsets + dense diagonals; very efficient for structured grids |
| HYB (Hybrid ELL+COO) | GPU SpMV with skewed row-length distribution | ELL for bulk, COO for outlier rows |
Provide: