brainevent.binary_csrmm_indexed#
- brainevent.binary_csrmm_indexed(data, indices, indptr, perm, B, *, shape, transpose=False, backend=None, weighted=False, max_row_nnz=None, workspace=None)[source]#
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 gatherdata[perm]is fused into the scatter kernel so only weights of active rows/columns are read. For homogeneous weights (data.size == 1)permis 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 slotjto canonical weight indexperm[j], shape(nse,), same dtype asindptr(int32 or int64).B (
Array|ndarray|Quantity|Number) – Dense event matrix. Shape(shape[0], n)whentranspose=Trueor(shape[1], n)whentranspose=False. Boolean, integer or floating dtype; an entry is active iff it isTrueor non-zero (negative values and NaN are active), and weights are never scaled by its value.shape (
Tuple[int,int]) – Logical(m, k)of the traversed structure.transpose (
bool) – IfTruecompute the transposed (scatter) product. DefaultFalse.backend (
str|None) – Compute backend. DefaultNone(auto-select).weighted (
bool) – IfTrue,Bholds value-weighted events (WeightedArray): active entries multiply the weights by their value instead of by1. DefaultFalse.max_row_nnz (
int|None) – Upper bound on the longest row of the traversedindptr, used to size thecuda_rawhybrid task queue (seebrainevent.binary_csrmv()); validated whenindptris concrete.workspace (optional) – Deprecated and ignored; passing it emits a
DeprecationWarning.
- Returns:
C – Result matrix, preserving units of
dataandB. Shape(shape[1], n)whentranspose=Trueor(shape[0], n).- Return type:
Array|ndarray|Quantity|Number
See also
brainevent._csr.binary.binary_csrmmThe non-indexed event-driven product.
brainevent._csr.binary_indexed.binary_csrmv_indexedThe matvec analog.