csrmv#
- class brainpy.math.event.csrmv(data, indices, indptr, events, *, shape, transpose=False)[source]#
Product of a sparse CSR matrix and a dense event vector.
This function supports JAX transformations, including jit(), grad(), vmap() and pmap().
- Parameters:
indices (
Array) – An array of shape(nse,).indptr (
Array) – An array of shape(shape[0] + 1,)and dtypeindices.dtype.events (
Array) – An array of shape(shape[0] if transpose else shape[1],)and dtypedata.dtype.shape (
Tuple[int,int]) – A length-2 tuple representing the matrix shape.transpose (
bool) – A boolean specifying whether to transpose the sparse matrix before computing. Iftranspose=True, the operator will compute based on the event-driven property of theeventsvector.
- Returns:
y – The array of shape
(shape[1] if transpose else shape[0],)representing the matrix vector product.- Return type:
Array