[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #40341] Logical indexing into sparse matrices
From: |
David Bateman |
Subject: |
[Octave-bug-tracker] [bug #40341] Logical indexing into sparse matrices causes OOM |
Date: |
Tue, 22 Oct 2013 18:27:27 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0 |
Follow-up Comment #2, bug #40341 (project octave):
This one is documented in the projects file
http://wiki.octave.org/Projects#Sparse_Matrices
Sparse logical indexing in idx_vector class so that something like
'a=sprandn(1e6,1e6,1e-6); a(a<1) = 0' won't cause a memory overflow.
What is happening now in your case is that the logical "b" is being converted
to a single argument numeric index for the "true" values of the sparse logical
matrix. This is identical to what happens for normal logical matrix indexing,
but in the case of sparse matrices the values of the numerically index can
depasse intmax().
The solution is the create a new idx_vector class particularly for sparse
logical indexing that stores (row,column) pairs. If used in its default form
it would act identically to idx_vector::idx_vector_rep, but the Sparse indexed
assignment could then special case it.
There is no call to numel() anywhere here
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?40341>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/