Skip to content

Commit

Permalink
small edit
Browse files Browse the repository at this point in the history
  • Loading branch information
wnbell committed Dec 26, 2007
1 parent 36d6938 commit d7be9cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scipy/sparse/compressed.py
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions scipy/sparse/csr.py
Expand Up @@ -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]

Expand Down

0 comments on commit d7be9cd

Please sign in to comment.