Skip to main content

Module sparse_utils

Module sparse_utils 

Source
Expand description

Sparse matrix utility operations

This module provides fundamental sparse matrix operations including:

  • Norms: 1-norm, infinity-norm, Frobenius norm
  • SpGEMM: Sparse matrix-matrix multiplication
  • Arithmetic: Sparse addition, subtraction, scaling
  • Kronecker product: Sparse Kronecker (tensor) product
  • Reordering: Reverse Cuthill-McKee bandwidth reduction
  • Condition number estimate: Cheap 1-norm-based condition estimate

Structs§

RcmResult
Result of the Reverse Cuthill-McKee algorithm.

Enums§

SparseNorm
Type of matrix norm to compute.

Functions§

condest_1norm
Estimate the 1-norm condition number of a sparse matrix.
permute_matrix
Apply a permutation to a sparse matrix: P * A * P^T.
reverse_cuthill_mckee
Compute the Reverse Cuthill-McKee permutation of a sparse matrix.
sparse_add
Sparse matrix addition: C = alpha * A + beta * B.
sparse_extract_diagonal
Extract the diagonal of a sparse CSR matrix as a dense vector.
sparse_identity
Create an n x n sparse identity matrix in CSR format.
sparse_kronecker
Compute the Kronecker product C = A kron B.
sparse_matrix_norm
Compute a matrix norm of a sparse CSR matrix.
sparse_matrix_trace
Compute the trace of a sparse matrix (sum of diagonal elements).
sparse_scale
Scale a sparse matrix: C = alpha * A.
sparse_sub
Sparse matrix subtraction: C = A - B.
sparse_transpose
Compute the transpose of a sparse CSR matrix (returns a new CSR matrix).
spgemm
Sparse matrix-matrix multiplication: C = A * B.