warp.sparse.bsr_from_triplets#

warp.sparse.bsr_from_triplets(
rows_of_blocks,
cols_of_blocks,
rows,
columns,
values,
prune_numerical_zeros=True,
)[source]#

Constructs a BSR matrix with values defined by coordinate-oriented (COO) triplets.

The first dimension of the three input arrays must match and indicates the number of COO triplets.

Parameters:
  • rows_of_blocks (int) – Number of rows of blocks.

  • cols_of_blocks (int) – Number of columns of blocks.

  • rows (Array[int]) – Row index for each non-zero.

  • columns (Array[int]) – Columns index for each non-zero.

  • values (Array[Scalar | _MatrixBlockType[Rows, Cols, Scalar] | _ScalarBlockType[Scalar]]) – Block values for each non-zero. Must be either a one-dimensional array with data type identical to the dest matrix’s block type, or a 3d array with data type equal to the dest matrix’s scalar type.

  • prune_numerical_zeros (bool) – If True, will ignore the zero-valued blocks.