warp.sparse.bsr_get_diag#

warp.sparse.bsr_get_diag(A, out=None)[source]#

Return the array of blocks that constitute the diagonal of a sparse matrix.

Parameters:
  • A (BsrMatrix[_MatrixBlockType[Rows, Cols, Scalar] | _ScalarBlockType[Scalar]] | _BsrExpression[_MatrixBlockType[Rows, Cols, Scalar] | _ScalarBlockType[Scalar]]) – The sparse matrix from which to extract the diagonal.

  • out (Array[_MatrixBlockType[Rows, Cols, Scalar] | _ScalarBlockType[Scalar]] | None) – If provided, the array into which to store the diagonal blocks.

Return type:

Array[_MatrixBlockType[Rows, Cols, Scalar] | _ScalarBlockType[Scalar]]