[Scipy-svn] r3303 - in trunk/scipy/sparse: . tests
scipy-svn at scipy.org
scipy-svn at scipy.org
Wed Sep 5 13:37:14 EDT 2007
Author: wnbell
Date: 2007-09-05 12:37:09 -0500 (Wed, 05 Sep 2007)
New Revision: 3303
Modified:
trunk/scipy/sparse/sparse.py
trunk/scipy/sparse/tests/test_sparse.py
Log:
added tolil() to spmatrix
fixed typo in test_sparse
Modified: trunk/scipy/sparse/sparse.py
===================================================================
--- trunk/scipy/sparse/sparse.py 2007-09-05 15:59:21 UTC (rev 3302)
+++ trunk/scipy/sparse/sparse.py 2007-09-05 17:37:09 UTC (rev 3303)
@@ -419,6 +419,9 @@
csc = self.tocsc()
return csc.tocoo()
+ def tolil(self):
+ return lil_matrix(self.tocsr())
+
def toself(self, copy=False):
if copy:
new = self.copy()
Modified: trunk/scipy/sparse/tests/test_sparse.py
===================================================================
--- trunk/scipy/sparse/tests/test_sparse.py 2007-09-05 15:59:21 UTC (rev 3302)
+++ trunk/scipy/sparse/tests/test_sparse.py 2007-09-05 17:37:09 UTC (rev 3303)
@@ -642,7 +642,7 @@
assert_equal( asp[ir, ic], bsp[ir, ic] )
def check_get_submatrix(self):
- a = sp.csr_matrix( array([[1,2,3],[1,2,3],[0,2,0]]) )
+ a = csr_matrix( array([[1,2,3],[1,2,3],[0,2,0]]) )
i0 = slice( 0, 2 )
i1 = slice( 1, 3 )
b = a.get_submatrix( i0, i1 )
More information about the Scipy-svn
mailing list