Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 736 Bytes

array-linear-operator.rst

File metadata and controls

28 lines (18 loc) · 736 Bytes

LinearOperator

Dask arrays implement the SciPy LinearOperator interface and so can be used with any SciPy algorithm depending on that interface.

Example

import dask.array as da
x = da.random.random(size=(10000, 10000), chunks=(1000, 1000))

from scipy.sparse.linalg.interface import MatrixLinearOperator
A = MatrixLinearOperator(x)

import numpy as np
b = np.random.random(10000)

from scipy.sparse.linalg import gmres
x = gmres(A, b)

Disclaimer: This is just a toy example and not necessarily the best way to solve this problem for this data.