{ } Raw JSON

bundles / scipy 1.17.1 / scipy / sparse / linalg / _interface / aslinearoperator

function

scipy.sparse.linalg._interface:aslinearoperator

source: /scipy/sparse/linalg/_interface.py :870

Signature

def   aslinearoperator ( A )

Summary

Return A as a LinearOperator.

Extended Summary

'A' may be any of the following types:

  • ndarray

  • matrix

  • sparse array (e.g. csr_array, lil_array, etc.)

  • LinearOperator

  • An object with .shape and .matvec attributes

See the LinearOperator documentation for additional information.

Notes

If 'A' has no .dtype attribute, the data type is determined by calling LinearOperator.matvec() - set the .dtype attribute to prevent this call upon the linear operator creation.

Examples

import numpy as np
from scipy.sparse.linalg import aslinearoperator
M = np.array([[1,2,3],[4,5,6]], dtype=np.int32)
aslinearoperator(M)

Aliases

  • scipy.sparse.linalg.aslinearoperator

Referenced by