[Scipy-svn] r3720 - trunk/scipy/sparse

scipy-svn at scipy.org scipy-svn at scipy.org
Tue Dec 25 19:04:30 EST 2007


Author: wnbell
Date: 2007-12-25 18:03:49 -0600 (Tue, 25 Dec 2007)
New Revision: 3720

Modified:
   trunk/scipy/sparse/compressed.py
   trunk/scipy/sparse/csr.py
Log:
small edit


Modified: trunk/scipy/sparse/compressed.py
===================================================================
--- trunk/scipy/sparse/compressed.py	2007-12-25 23:43:46 UTC (rev 3719)
+++ trunk/scipy/sparse/compressed.py	2007-12-26 00:03:49 UTC (rev 3720)
@@ -175,7 +175,7 @@
                 if numpy.diff(self.indptr).min() < 0:
                     raise ValueError,'index pointer values must form a " \
                                         "non-decreasing sequence'
-        
+
         #if not self.has_sorted_indices():
         #    warn('Indices were not in sorted order.  Sorting indices.')
         #    self.sort_indices()

Modified: trunk/scipy/sparse/csr.py
===================================================================
--- trunk/scipy/sparse/csr.py	2007-12-25 23:43:46 UTC (rev 3719)
+++ trunk/scipy/sparse/csr.py	2007-12-26 00:03:49 UTC (rev 3720)
@@ -160,8 +160,10 @@
             self.shape = (M, N)
 
             indxs = numpy.where(col == self.indices[self.indptr[row]:self.indptr[row+1]])
+
             if len(indxs[0]) == 0:
                 #value not present
+                self.sort_indices()
                 newindx = self.indices[self.indptr[row]:self.indptr[row+1]].searchsorted(col)
                 newindx += self.indptr[row]
 




More information about the Scipy-svn mailing list