brainevent.binary_csrmm_indexed

brainevent.binary_csrmm_indexed#

brainevent.binary_csrmm_indexed = <NameScope(brainevent.binary_csrmm_indexed)>#

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

Equivalent to binary_csrmm(data[perm], indices, indptr, B, ...) for heterogeneous weights, but the gather data[perm] is fused into the scatter kernel so 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 weights in canonical order. Shape (nse,) (heterogeneous) or (1,) (homogeneous).

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

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

  • perm (Array | ndarray) – Permutation mapping structural slot j to canonical weight index perm[j], shape (nse,), same integer dtype as indices.

  • B (Array | ndarray | Quantity | Number) – Dense event matrix. Shape (shape[0], n) when transpose=True or (shape[1], n) when transpose=False. Boolean or floating dtype.

  • shape (Tuple[int, int]) – Logical (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).

Returns:

C – Result matrix, preserving units of data and B. Shape (shape[1], n) when transpose=True or (shape[0], n).

Return type:

Array | ndarray | Quantity | Number

See also

brainevent._csr.binary.binary_csrmm

The non-indexed event-driven product.

brainevent._csr.binary_indexed.binary_csrmv_indexed

The matvec analog.