[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #40324] Concatenating Sparse matrices throws O
From: |
David Bateman |
Subject: |
[Octave-bug-tracker] [bug #40324] Concatenating Sparse matrices throws OOM |
Date: |
Mon, 21 Oct 2013 19:59:20 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0 |
Follow-up Comment #2, bug #40324 (project octave):
That should of course have read horzcat.
Looking at this problem a bit further, the difference between
[s, s]
and
horzcat(s,s)
is that the first goes through the parse tree code pt-mat.cc to construct the
matrix list to concatenate, and in this code there are multiple uses of numel
and in particular one to test if all the values are scalar. As sparse matrices
can't profit from the fact that all elements are scalar in the concatenation
this test should be avoided as a call to numel calls the
idx_vector::safe_numel method that throws a bad alloc in this case even though
it doesn't need to.
Fixed in the changeset
http://hg.savannah.gnu.org/hgweb/octave/rev/ccc0576641f9
D.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?40324>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/