SciPy - Sparse Linear Algebra
Given the following code, what will be the output of print(M.matvec(b))?
import numpy as np
from scipy.sparse.linalg import LinearOperator
A = np.array([[2, 0], [0, 5]])
b = np.array([4, 10])
M = LinearOperator(shape=A.shape, matvec=lambda x: x / np.diag(A))
print(M.matvec(b))
