[Scipy-svn] r3862 - in trunk/scipy: . linalg sandbox/multigrid sandbox/multigrid/examples sparse/tests splinalg splinalg/dsolve splinalg/dsolve/umfpack/tests

scipy-svn@scip... scipy-svn@scip...
Fri Jan 25 16:24:10 CST 2008


Author: wnbell
Date: 2008-01-25 16:23:52 -0600 (Fri, 25 Jan 2008)
New Revision: 3862

Added:
   trunk/scipy/splinalg/dsolve/
   trunk/scipy/splinalg/dsolve/tests/
Removed:
   trunk/scipy/linsolve/
Modified:
   trunk/scipy/linalg/setup.py
   trunk/scipy/sandbox/multigrid/examples/adaptive.py
   trunk/scipy/sandbox/multigrid/multilevel.py
   trunk/scipy/sparse/tests/test_base.py
   trunk/scipy/splinalg/dsolve/__init__.py
   trunk/scipy/splinalg/dsolve/info.py
   trunk/scipy/splinalg/dsolve/linsolve.py
   trunk/scipy/splinalg/dsolve/setup.py
   trunk/scipy/splinalg/dsolve/umfpack/tests/test_umfpack.py
Log:
moved scipy.linsolve to scipy.splinalg.dsolve


Modified: trunk/scipy/linalg/setup.py
===================================================================
--- trunk/scipy/linalg/setup.py	2008-01-25 20:00:52 UTC (rev 3861)
+++ trunk/scipy/linalg/setup.py	2008-01-25 22:23:52 UTC (rev 3862)
@@ -183,24 +183,6 @@
                          extra_info = lapack_opt
                          )
 
-#    # iterative methods
-#    methods = ['BiCGREVCOM.f.src',
-#               'BiCGSTABREVCOM.f.src',
-#               'CGREVCOM.f.src',
-#               'CGSREVCOM.f.src',
-##               'ChebyREVCOM.f.src',
-#               'GMRESREVCOM.f.src',
-##               'JacobiREVCOM.f.src',
-#               'QMRREVCOM.f.src',
-##               'SORREVCOM.f.src'
-#               ]
-#    Util = ['STOPTEST2.f.src','getbreak.f.src']
-#    sources = Util + methods + ['_iterative.pyf.src']
-#    config.add_extension('_iterative',
-#                         sources = [join('iterative',x) for x in sources],
-#                         extra_info = lapack_opt
-#                         )
-
     config.add_data_dir('tests')
 
     return config

Modified: trunk/scipy/sandbox/multigrid/examples/adaptive.py
===================================================================
--- trunk/scipy/sandbox/multigrid/examples/adaptive.py	2008-01-25 20:00:52 UTC (rev 3861)
+++ trunk/scipy/sandbox/multigrid/examples/adaptive.py	2008-01-25 22:23:52 UTC (rev 3862)
@@ -1,5 +1,6 @@
 
 from scipy import *
+from scipy.splinalg import *
 from scipy.sandbox.multigrid.utils import diag_sparse
 from scipy.sandbox.multigrid.gallery import poisson, linear_elasticity
 from scipy.sandbox.multigrid.adaptive import adaptive_sa_solver
@@ -38,7 +39,7 @@
     def add_resid(x):
         residuals.append(linalg.norm(b - A*x))
     A.psolve = asa.psolve
-    x_sol = linalg.cg(A,b,x0=x,maxiter=30,tol=1e-10,callback=add_resid)[0]
+    x_sol = splinalg.cg(A,b,x0=x,maxiter=30,tol=1e-10,callback=add_resid)[0]
 
 residuals = array(residuals)/residuals[0]
 

Modified: trunk/scipy/sandbox/multigrid/multilevel.py
===================================================================
--- trunk/scipy/sandbox/multigrid/multilevel.py	2008-01-25 20:00:52 UTC (rev 3861)
+++ trunk/scipy/sandbox/multigrid/multilevel.py	2008-01-25 22:23:52 UTC (rev 3862)
@@ -4,7 +4,7 @@
 import numpy
 from numpy import ones,zeros,zeros_like,array,asarray,empty
 from numpy.linalg import norm
-from scipy.linsolve import spsolve
+from scipy.splinalg import spsolve
 from scipy.sparse import dia_matrix
 
 from rs import rs_interpolation

Modified: trunk/scipy/sparse/tests/test_base.py
===================================================================
--- trunk/scipy/sparse/tests/test_base.py	2008-01-25 20:00:52 UTC (rev 3861)
+++ trunk/scipy/sparse/tests/test_base.py	2008-01-25 22:23:52 UTC (rev 3862)
@@ -26,7 +26,7 @@
         coo_matrix, lil_matrix, dia_matrix, bsr_matrix, \
         speye, spkron, SparseEfficiencyWarning
 from scipy.sparse.sputils import supported_dtypes
-from scipy.linsolve import splu
+from scipy.splinalg import splu
 
 
 warnings.simplefilter('ignore',SparseEfficiencyWarning)

Copied: trunk/scipy/splinalg/dsolve (from rev 3861, trunk/scipy/linsolve)

Modified: trunk/scipy/splinalg/dsolve/__init__.py
===================================================================
--- trunk/scipy/linsolve/__init__.py	2008-01-25 20:00:52 UTC (rev 3861)
+++ trunk/scipy/splinalg/dsolve/__init__.py	2008-01-25 22:23:52 UTC (rev 3862)
@@ -1,9 +1,9 @@
-"Linear Solvers"
+"Direct Solvers for Sparse Linear Systems"
 
 from info import __doc__
 
 import umfpack
-__doc__ = '\n\n'.join( (__doc__,  umfpack.__doc__) )
+#__doc__ = '\n\n'.join( (__doc__,  umfpack.__doc__) )
 del umfpack
 
 from linsolve import *

Modified: trunk/scipy/splinalg/dsolve/info.py
===================================================================
--- trunk/scipy/linsolve/info.py	2008-01-25 20:00:52 UTC (rev 3861)
+++ trunk/scipy/splinalg/dsolve/info.py	2008-01-25 22:23:52 UTC (rev 3862)
@@ -11,9 +11,9 @@
 
 Example session:
 
->>> from scipy.sparse import csc_matrix
+>>> from scipy.sparse import csc_matrix, spdiags
 >>> from numpy import array
->>> from scipy.linsolve import spdiags, spsolve, use_solver
+>>> from scipy.splinalg import spsolve, use_solver
 >>>
 >>> print "Inverting a sparse linear system:"
 >>> print "The sparse matrix (constructed from diagonals):"

Modified: trunk/scipy/splinalg/dsolve/linsolve.py
===================================================================
--- trunk/scipy/linsolve/linsolve.py	2008-01-25 20:00:52 UTC (rev 3861)
+++ trunk/scipy/splinalg/dsolve/linsolve.py	2008-01-25 22:23:52 UTC (rev 3862)
@@ -154,42 +154,3 @@
     else:
         return splu( A ).solve
 
-def _testme():
-    from scipy.sparse import csc_matrix, spdiags
-    from numpy import array
-    from scipy.linsolve import spsolve, use_solver
-
-    print "Inverting a sparse linear system:"
-    print "The sparse matrix (constructed from diagonals):"
-    a = spdiags([[1, 2, 3, 4, 5], [6, 5, 8, 9, 10]], [0, 1], 5, 5)
-    b = array([1, 2, 3, 4, 5])
-    print "Solve: single precision complex:"
-    use_solver( useUmfpack = False )
-    a = a.astype('F')
-    x = spsolve(a, b)
-    print x
-    print "Error: ", a*x-b
-
-    print "Solve: double precision complex:"
-    use_solver( useUmfpack = True )
-    a = a.astype('D')
-    x = spsolve(a, b)
-    print x
-    print "Error: ", a*x-b
-
-    print "Solve: double precision:"
-    a = a.astype('d')
-    x = spsolve(a, b)
-    print x
-    print "Error: ", a*x-b
-
-    print "Solve: single precision:"
-    use_solver( useUmfpack = False )
-    a = a.astype('f')
-    x = spsolve(a, b.astype('f'))
-    print x
-    print "Error: ", a*x-b
-
-
-if __name__ == "__main__":
-    _testme()

Modified: trunk/scipy/splinalg/dsolve/setup.py
===================================================================
--- trunk/scipy/linsolve/setup.py	2008-01-25 20:00:52 UTC (rev 3861)
+++ trunk/scipy/splinalg/dsolve/setup.py	2008-01-25 22:23:52 UTC (rev 3862)
@@ -6,7 +6,7 @@
     from numpy.distutils.misc_util import Configuration
     from numpy.distutils.system_info import get_info
 
-    config = Configuration('linsolve',parent_package,top_path)
+    config = Configuration('dsolve',parent_package,top_path)
     config.add_data_dir('tests')
 
     lapack_opt = get_info('lapack_opt',notfound_action=2)

Modified: trunk/scipy/splinalg/dsolve/umfpack/tests/test_umfpack.py
===================================================================
--- trunk/scipy/linsolve/umfpack/tests/test_umfpack.py	2008-01-25 20:00:52 UTC (rev 3861)
+++ trunk/scipy/splinalg/dsolve/umfpack/tests/test_umfpack.py	2008-01-25 22:23:52 UTC (rev 3862)
@@ -10,12 +10,13 @@
 import random
 from scipy.testing import *
 
-from scipy import linsolve, rand, matrix, diag, eye
+from scipy import rand, matrix, diag, eye
 from scipy.sparse import csc_matrix, dok_matrix, spdiags
+from scipy.splinalg import linsolve
 
 import numpy as nm
 try:
-    import scipy.linsolve.umfpack as um
+    import scipy.splinalg.dsolve.umfpack as um
 except (ImportError, AttributeError):
     _have_umfpack = False
 else:



More information about the Scipy-svn mailing list