[Scipy-svn] r6606 - trunk/scipy/sparse/linalg/dsolve/tests

scipy-svn at scipy.org scipy-svn at scipy.org
Wed Jul 14 05:29:11 EDT 2010


Author: ptvirtan
Date: 2010-07-14 04:29:10 -0500 (Wed, 14 Jul 2010)
New Revision: 6606

Modified:
   trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py
Log:
TST: sparse.linalg: add another smoke test to spsolve

Modified: trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py
===================================================================
--- trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py	2010-07-14 09:29:02 UTC (rev 6605)
+++ trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py	2010-07-14 09:29:10 UTC (rev 6606)
@@ -1,6 +1,6 @@
 import warnings
 
-from numpy import array, finfo, arange, eye, all, unique, ones, dot
+from numpy import array, finfo, arange, eye, all, unique, ones, dot, matrix
 import numpy.random as random
 from numpy.testing import *
 
@@ -38,7 +38,18 @@
 
                 assert( norm(b - Asp*x) < 10 * cond_A * eps )
 
+    def test_smoketest(self):
+        Adense = matrix([[ 0.,  1.,  1.],
+                         [ 1.,  0.,  1.],
+                         [ 0.,  0.,  1.]])
+        As =  csc_matrix(Adense)
+        random.seed(1234)
+        x = random.randn(3)
+        b = As*x
+        x2 = spsolve(As, b)
 
+        assert_array_almost_equal(x, x2)
+
 class TestSplu(object):
     def setUp(self):
         n = 40




More information about the Scipy-svn mailing list