[Scipy-svn] r3887 - trunk/scipy/splinalg/isolve

scipy-svn@scip... scipy-svn@scip...
Fri Feb 1 13:49:34 CST 2008


Author: wnbell
Date: 2008-02-01 13:49:30 -0600 (Fri, 01 Feb 2008)
New Revision: 3887

Modified:
   trunk/scipy/splinalg/isolve/minres.py
Log:
fixed missing import


Modified: trunk/scipy/splinalg/isolve/minres.py
===================================================================
--- trunk/scipy/splinalg/isolve/minres.py	2008-02-01 19:41:26 UTC (rev 3886)
+++ trunk/scipy/splinalg/isolve/minres.py	2008-02-01 19:49:30 UTC (rev 3887)
@@ -1,4 +1,4 @@
-from numpy import sqrt, inner, finfo
+from numpy import sqrt, inner, finfo, asarray, zeros
 from numpy.linalg import norm
 
 def psolve(x): return x
@@ -277,10 +277,11 @@
 
 
 if __name__ == '__main__':
-    from scipy import *
-    from scipy.sparse import *
-    from scipy.splinalg import *
-    from scipy.sandbox.multigrid import *
+    from scipy import ones, arange
+    from scipy.linalg import norm
+    from scipy.sparse import spdiags
+    from scipy.splinalg import cg
+    #from scipy.sandbox.multigrid import *
 
     n = 100
 
@@ -292,6 +293,6 @@
     #A = poisson((10,),format='csr')
     A = spdiags( [arange(1,n+1,dtype=float)], [0], n, n, format='csr')
     b = ones( A.shape[0] )
-    #x = minres(A,b,tol=1e-12,maxiter=None,callback=cb)
-    x = cg(A,b,x0=b,tol=1e-12,maxiter=None,callback=cb)[0]
+    x = minres(A,b,tol=1e-12,maxiter=None,callback=cb)
+    #x = cg(A,b,x0=b,tol=1e-12,maxiter=None,callback=cb)[0]
 



More information about the Scipy-svn mailing list