coomv#
- class brainpy.math.sparse.coomv(data, row, col, vector, *, shape, transpose=False)[source]#
Product of COO sparse matrix and a dense vector.
The
braineventCOO format was removed in v0.1.0, so the COO indices are converted to CSR (viabrainevent.coo2csr()) and the multiplication is delegated tobrainevent.CSR.This function supports JAX transformations, including
jit(),grad(),vmap()andpmap().- Parameters:
data (
Union[float,Array,Array]) – An array of shape(nse,).col (
Union[Array,Array]) – An array of shape(nse,)and dtyperow.dtype.vector (
Union[Array,Array]) – An array of shape(shape[0] if transpose else shape[1],)and dtypedata.dtype.transpose (
bool) – A boolean specifying whether to transpose the sparse matrix before computing.
- Returns:
y – An array of shape
(shape[1] if transpose else shape[0],)representing the matrix vector product.- Return type:
ndarray