octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #35148] Error Msg suppressed: tic; sparse(1e5,


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #35148] Error Msg suppressed: tic; sparse(1e5, 1e5, 0); toc
Date: Mon, 16 Apr 2012 19:43:11 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2 Iceweasel/10.0.2

Follow-up Comment #4, bug #35148 (project octave):

The error happens because in


sparse (1e5, 1e5, 0)


dim_vector::safe_numel throws a std::bad_alloc exception.  However, safe_numel
is only called when Octave attempts to print the result, not when the sparse
matrix object is constructed.  So if you terminate the expression with a
semicolon, you won't see the error.

I'm not sure why safe numel is called here.  We should be able to create a
sparse matrix object like this since it doesn't require much memory, and
neither of the dimensions are larger than the max index size, only the product
is, but that shouldn't matter since we aren't trying to store that number of
elements.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?35148>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]