dsdbcsr#
Includes our Numba csr datastructure kernels.
Functions:
-
find_inds–Finds the corresponding indices of the given rows and columns.
-
densify_block–Fills the dense block with the given data.
-
sparsify_block–Fills the data with the given dense block.
-
compute_rowptr_map–Computes the rowptr map for a sparse matrix.
find_inds
#
find_inds(rowptr_map: dict[tuple, NDArray], block_offsets: NDArray, self_cols: NDArray, rows: NDArray, cols: NDArray) -> tuple[NDArray, NDArray]
Finds the corresponding indices of the given rows and columns.
Parameters:
-
rowptr_map(dict) –The row pointer map.
-
block_offsets(NDArray) –The block offsets.
-
self_cols(NDArray) –The columns of this matrix.
-
rows(NDArray) –The rows to find the indices for.
-
cols(NDArray) –The columns to find the indices for.
Returns:
densify_block
#
densify_block(block: NDArray, block_offset: NDArray, self_cols: NDArray, rowptr: NDArray, data: NDArray)
Fills the dense block with the given data.
Parameters:
sparsify_block
#
sparsify_block(block: NDArray, block_offset: NDArray, self_cols: NDArray, rowptr: NDArray, data: NDArray)
Fills the data with the given dense block.
Parameters:
compute_rowptr_map
#
Computes the rowptr map for a sparse matrix.
Parameters:
-
coo_rows(NDArray) –The row indices of the matrix in coordinate format.
-
coo_cols(NDArray) –The column indices of the matrix in coordinate format.
-
block_sizes(NDArray) –The block sizes of the block-sparse matrix we want to construct.
Returns: