brainevent.binary_csrmv_indexed

brainevent.binary_csrmv_indexed#

brainevent.binary_csrmv_indexed(data, indices, indptr, perm, v, *, shape, transpose=False, backend=None, weighted=False, max_row_nnz=None, workspace=None)[source]#

Event-driven CSR matrix-vector product with a fused weight gather index.

Equivalent to binary_csrmv(data[perm], indices, indptr, v, ...) for heterogeneous weights, but the gather data[perm] is fused into the scatter kernel so that only weights of active rows/columns are read. For homogeneous weights (data.size == 1) perm is ignored.

Parameters:
  • data (Array | ndarray | Quantity | Number) – Non-zero weight values in their canonical order. Shape (nse,) for heterogeneous weights or (1,) for a homogeneous weight.

  • indices (Array | ndarray) – Secondary-axis indices of the (transposed) structure being traversed. Shape (nse,) with integer dtype.

  • indptr (Array | ndarray) – Pointer array of the traversed structure. Shape (shape[0] + 1,).

  • perm (Array | ndarray) – Permutation mapping structural slot j to the canonical weight index perm[j]. Shape (nse,) with the same dtype as indptr (int32 or int64).

  • v (Array | ndarray | Quantity | Number) – Dense event vector. Shape (shape[0],) when transpose=True or (shape[1],) when transpose=False. Boolean, integer or floating dtype; an entry is active iff it is True or non-zero (negative values and NaN are active), and weights are never scaled by its value.

  • shape (Tuple[int, int]) – Logical shape (m, k) of the traversed structure.

  • transpose (bool) – If True, compute the transposed (scatter) product. Default False.

  • backend (str | None) – Compute backend. Default None (auto-select).

  • weighted (bool) – If True, v holds value-weighted events (WeightedArray): active entries multiply the weights by their value instead of by 1. Default False.

  • max_row_nnz (int | None) – Upper bound on the longest row of the traversed indptr, used to size the cuda_raw hybrid task queue (see brainevent.binary_csrmv()); validated when indptr is concrete.

  • workspace (optional) – Deprecated and ignored; passing it emits a DeprecationWarning.

Returns:

y – Result vector, preserving units of data and v.

Return type:

Array | ndarray | Quantity | Number

See also

brainevent._csr.binary.binary_csrmv

The non-indexed event-driven product.