Mercurial > hg > octave-nkf
diff libinterp/parse-tree/pt-mat.cc @ 17713:ccc0576641f9
Avoid use of numel for sparse matrix when concatenating (bug #40324)
* pt-mat.cc (void tm_row_const::tm_row_const_rep::do_init_element
(const octave_value&, bool&)) : Avoid use of numel for sparse matrices
author | David Bateman <dbateman@free.fr> |
---|---|
date | Mon, 21 Oct 2013 21:58:01 +0200 |
parents | bc924baa2c4e |
children | d63878346099 |
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-mat.cc +++ b/libinterp/parse-tree/pt-mat.cc @@ -330,7 +330,8 @@ if (!any_class && val.is_object ()) any_class = true; - all_1x1 = all_1x1 && val.numel () == 1; + // Special treatment of sparse matrices to avoid out-of-memory error + all_1x1 = all_1x1 && ! val.is_sparse_type () && val.numel () == 1; } void