Expand description
Sparse matrix utility functions
This module provides convenience functions that return concrete typed sparse
matrices (CsrArray<T>) instead of trait objects, plus additional utility
functions for common sparse matrix constructions.
Functions provided:
sparse_eye(n)- Sparse identity matrixsparse_random(m, n, density)- Random sparse matrixsparse_kron(A, B)- Kronecker productsparse_hstack(arrays)- Horizontal stackingsparse_vstack(arrays)- Vertical stackingsparse_block_diag(arrays)- Block diagonal constructionsparse_diags(diags, offsets, shape)- Construct from diagonals
Functionsยง
- sparse_
block_ diag - Construct a block diagonal sparse matrix from a list of sub-matrices.
- sparse_
diag_ matrix - Create a sparse matrix with given values on the specified diagonal.
- sparse_
diags - Construct a sparse matrix from diagonals.
- sparse_
eye - Create a sparse identity matrix of size n x n in CSR format.
- sparse_
eye_ rect - Create a rectangular sparse identity-like matrix of size m x n in CSR format.
- sparse_
hstack - Stack sparse matrices horizontally (column-wise).
- sparse_
kron - Compute the Kronecker product of two sparse matrices.
- sparse_
kronsum - Kronecker sum of two sparse matrices: A (x) I_q + I_p (x) B
- sparse_
random - Create a random sparse matrix in CSR format.
- sparse_
vstack - Stack sparse matrices vertically (row-wise).