dpnp.scipy.sparse.linalg.LinearOperator

class dpnp.scipy.sparse.linalg.LinearOperator(*args, **kwargs)[source]

Common interface for performing matrix-vector products, backed by dpnp arrays.

Iterative solvers (cg, gmres, minres) only require the matrix-vector product A @ v and never the individual matrix entries. This class is the abstract interface between such solvers and matrix-like objects. Construct it either by passing callables to the constructor, or by subclassing and implementing _matvec (and optionally _rmatvec / _matmat / _rmatmat). It also supports the full operator algebra (+, @, scaling, power, adjoint A.H, transpose A.T), each producing a new lazy LinearOperator.

For full documentation refer to scipy.sparse.linalg.LinearOperator.

Parameters:
shapetuple of int

Operator dimensions (M, N).

matveccallable

Returns A @ v for a 1-D v.

rmatveccallable, optional

Returns A^H @ v (conjugate transpose applied to v).

matmatcallable, optional

Returns A @ V for a dense 2-D V of shape (N, K).

dtypedtype, optional

Data type of the operator. Inferred from a trial matvec when None.

rmatmatcallable, optional

Returns A^H @ V for a dense 2-D V of shape (M, K).

Attributes:
argstuple

For composite operators (sum, product, ...), the operands of the binary operation.

ndimint

Number of dimensions, always 2.