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