warp.sparse.bsr_axpy#

warp.sparse.bsr_axpy(
x,
y=None,
alpha=1.0,
beta=1.0,
masked=False,
work_arrays=None,
)[source]#

Perform the sparse matrix addition y := alpha * X + beta * y on BSR matrices x and y and return y.

The x and y matrices are allowed to alias.

Parameters:
  • x (BsrMatrix[BlockType] | _BsrExpression[BlockType]) – Read-only first operand.

  • y (BsrMatrix[_MatrixBlockType[Rows, Cols, Scalar] | _ScalarBlockType[Scalar]] | None) – Mutable second operand and output matrix. If y is not provided, it will be allocated and treated as zero.

  • alpha (Scalar) – Uniform scaling factor for x.

  • beta (Scalar) – Uniform scaling factor for y.

  • masked (bool) – If True, keep the non-zero topology of y unchanged.

  • work_arrays (bsr_axpy_work_arrays | None) – In most cases, this function will require the use of temporary storage. This storage can be reused across calls by passing an instance of bsr_axpy_work_arrays in work_arrays.

Return type:

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