dpnp.scipy.sparse.linalg.aslinearoperator

dpnp.scipy.sparse.linalg.aslinearoperator(A) → LinearOperator[source]

Return A as a LinearOperator.

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

Parameters:
Aobject

The object to wrap. It may be any of the following:

  • a LinearOperator (returned unchanged);

  • a dpnp.scipy.sparse sparse matrix, e.g. csr_matrix (the iterative solvers further specialise this to a cached oneMKL SpMV handle, bypassing densification);

  • a 2-D array, dpnp.ndarray or usm_ndarray (promoted via dpnp.atleast_2d());

  • an object exposing .shape and .matvec (and optionally rmatvec / matmat / rmatmat / dtype).

Returns:
outLinearOperator

The A operand wrapped as a LinearOperator.

See also

dpnp.scipy.sparse.linalg.LinearOperator

The wrapped type.

Notes

A host numpy.ndarray is rejected: dpnp does not perform implicit host-to-device copies, which would defeat routing through the device. Transfer it with dpnp.asarray first.