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 gatherdata[perm]is fused into the scatter kernel so that only weights of active rows/columns are read. For homogeneous weights (data.size == 1)permis 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 slotjto the canonical weight indexperm[j]. Shape(nse,)with the same dtype asindptr(int32 or int64).v (
Array|ndarray|Quantity|Number) – Dense event vector. Shape(shape[0],)whentranspose=Trueor(shape[1],)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 shape(m, k)of the traversed structure.transpose (
bool) – IfTrue, compute the transposed (scatter) product. DefaultFalse.backend (
str|None) – Compute backend. DefaultNone(auto-select).weighted (
bool) – IfTrue,vholds 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:
y – Result vector, preserving units of
dataandv.- Return type:
Array|ndarray|Quantity|Number
See also
brainevent._csr.binary.binary_csrmvThe non-indexed event-driven product.