import pyamg import numpy as np %matplotlib inline
A, B = pyamg.gallery.linear_elasticity((1000,1000), format='csr') n = A.shape[0] b = np.random.rand(n)
A.shape
(2000000, 2000000)
ml = pyamg.smoothed_aggregation_solver(A, B) res = [] ml.solve(b, residuals=res)
array([ 0.00024965, 0.00025289, 0.00039303, ..., 0.00036486, 0.00025024, 0.00025116])