scipy.sparse.linalg.LinearOperator.

matvec#

LinearOperator.matvec(x)[source]#

Matrix-vector multiplication.

Applies A to x, where A is an M x N linear operator (or batch of linear operators) and x is a row vector (or batch of such vectors).

Parameters:
x{matrix, ndarray}

An array with shape (..., N) representing a row vector (or batch of row vectors).

Added in version 1.18.0: A FutureWarning is emitted for column vector input of shape (N, 1), for which an array with shape (M, 1) is returned. matmat can be called instead for identical behaviour on such input.

Returns:
y{matrix, ndarray}

An array with shape (..., M).

Notes

This method wraps the user-specified matvec routine or overridden _matvec method to ensure that y has the correct shape and type.