warp.sparse.bsr_block_index#
- warp.sparse.bsr_block_index( ) int[source]#
Return the index of the block at block-coordinates (row, col), or -1 if no such block exists.
Assumes that the segments of
bsr_columnscorresponding to each row are sorted. This overload searches the storage rowbsr_offsets[row]:bsr_offsets[row + 1]. For matrices with padded row capacity, passbsr_row_countsto search active blocks only.- Parameters:
row – Row of the block.
col – Column of the block.
bsr_offsets – Array of size at least
1 + rowcontaining the offsets of the blocks in each row.bsr_columns – Array of size at least equal to
bsr_offsets[row + 1]containing the column indices of the blocks.
- warp.sparse.bsr_block_index(
- row: int,
- col: int,
- bsr_offsets: Array[int32],
- bsr_columns: Array[int32],
- bsr_row_counts: Array[int32],
Return the active block index in a capacity-aware BSR matrix, or -1 if no such block exists.
This row-capacity overload searches
bsr_offsets[row]:bsr_offsets[row] + bsr_row_counts[row]and ignores slack storage. Ifbsr_row_countsisNone, it falls back to compact storage rows defined bybsr_offsets.