def test_basic(): svx = np.linalg.solve(G, b) X = lsqr(G, b, show=show, atol=tol, btol=tol, iter_lim=maxit) xo = X[0] assert norm(svx - xo) < 1e-5
tol = 1e-10 show = False maxit = None def test_basic(): svx = np.linalg.solve(G, b) X = lsqr(G, b, show=show, atol=tol, btol=tol, iter_lim=maxit) xo = X[0] assert norm(svx - xo) < 1e-5 if __name__ == "__main__": svx = np.linalg.solve(G, b) tic = time() X = lsqr(G, b, show=show, atol=tol, btol=tol, iter_lim=maxit) xo = X[0] phio = X[3] psio = X[7] k = X[2] chio = X[8] mg = np.amax(G - G.T) if mg > 1e-14: sym='No' else: sym='Yes' print 'LSQR' print "Is linear operator symmetric? " + sym print "n: %3g iterations: %3g" % (n, k) print "Norms computed in %.2fs by LSQR" % (time() - tic)
show = False maxit = None def test_basic(): svx = np.linalg.solve(G, b) X = lsqr(G, b, show=show, atol=tol, btol=tol, iter_lim=maxit) xo = X[0] assert norm(svx - xo) < 1e-5 if __name__ == "__main__": svx = np.linalg.solve(G, b) tic = time() X = lsqr(G, b, show=show, atol=tol, btol=tol, iter_lim=maxit) xo = X[0] phio = X[3] psio = X[7] k = X[2] chio = X[8] mg = np.amax(G - G.T) if mg > 1e-14: sym = 'No' else: sym = 'Yes' print 'LSQR' print "Is linear operator symmetric? " + sym print "n: %3g iterations: %3g" % (n, k) print "Norms computed in %.2fs by LSQR" % (time() - tic)