Permalink
Browse files

small edit

  • Loading branch information...
wnbell
wnbell committed Dec 26, 2007
1 parent 36d6938 commit d7be9cdf9142d1a9f658b73f4d9e5f0572095d0f
Showing with 3 additions and 1 deletion.
  1. +1 −1 scipy/sparse/compressed.py
  2. +2 −0 scipy/sparse/csr.py
@@ -175,7 +175,7 @@ def check_format(self, full_check=True):
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()
View
@@ -160,8 +160,10 @@ def __setitem__(self, key, val):
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]

0 comments on commit d7be9cd

Please sign in to comment.