[Scipy-svn] r4120 - trunk/scipy/sparse/linalg/eigen/lobpcg

scipy-svn@scip... scipy-svn@scip...
Tue Apr 8 16:19:45 CDT 2008


Author: wnbell
Date: 2008-04-08 16:19:42 -0500 (Tue, 08 Apr 2008)
New Revision: 4120

Modified:
   trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py
Log:
fix recursive import


Modified: trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py
===================================================================
--- trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py	2008-04-08 21:09:51 UTC (rev 4119)
+++ trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py	2008-04-08 21:19:42 UTC (rev 4120)
@@ -18,7 +18,6 @@
 import scipy.sparse as sp
 import scipy.io as io
 from scipy.sparse.linalg import aslinearoperator, LinearOperator
-import scipy.linalg as sla
 
 ## try:
 ##     from symeig import symeig
@@ -26,6 +25,7 @@
 ##     raise ImportError('lobpcg requires symeig')
 
 def symeig( mtxA, mtxB = None, eigenvectors = True, select = None ):
+    import scipy.linalg as sla
     import scipy.lib.lapack as ll
     if select is None:
         if nm.iscomplexobj( mtxA ):
@@ -112,6 +112,7 @@
 def applyConstraints( blockVectorV, factYBY, blockVectorBY, blockVectorY ):
     """Internal. Changes blockVectorV in place."""
     gramYBV = sc.dot( blockVectorBY.T, blockVectorV )
+    import scipy.linalg as sla
     tmp = sla.cho_solve( factYBY, gramYBV )
     blockVectorV -= sc.dot( blockVectorY, tmp )
 
@@ -119,6 +120,7 @@
 def b_orthonormalize( B, blockVectorV,
                       blockVectorBV = None, retInvR = False ):
     """Internal."""
+    import scipy.linalg as sla
     if blockVectorBV is None:
         if B is not None:
             blockVectorBV = B( blockVectorV )
@@ -203,6 +205,7 @@
 
     """
     failureFlag = True
+    import scipy.linalg as sla
 
     if blockVectorY is not None:
         sizeY = blockVectorY.shape[1]



More information about the Scipy-svn mailing list