bugGNU Octave - Bugs: bug #38936, Wrong result of numel() for sparse...

 
 

bug #38936: Wrong result of numel() for sparse matrices

Submitter:  None
Submitted:  Wed 08 May 2013 01:26:28 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  dbateman
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.4
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 20 Jun 2013 12:36:12 AM UTC, comment #2: 

As 1e12 is larger than sizemax() for 32-bit indexing as Jordi says in the thread he posted numel will always be wrong. I've push a changeset

http://hg.savannah.gnu.org/hgweb/octave/rev/8fce0ed4894a

that ensures that this is an error


David Bateman <dbateman>
Group Member
Thu 09 May 2013 07:38:30 PM UTC, comment #1: 
Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Wed 08 May 2013 01:26:28 PM UTC, original submission:  

Executing the command


  numel(spalloc(1e6,1e6,0))


returns -727379968 instead of 1e12. However, the following command produces the correct result:


  prod(size(spalloc(1e6, 1e6)))



I could verify this behaviour using octave 3.4.3 (CentOS release 6.4 (final), kernel 2.6.32-358.2.1.el6.x86_64) and octave 3.6.4 (Ubuntu 13.04, kernel 3.8.0-19-generic).

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dbateman (Posted a comment)
  • -email is unavailable- added by jordigh (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-06-20 dbateman StatusConfirmed Fixed
        Assigned toNone dbateman
        Open/ClosedOpen Closed
    2013-05-09 jordigh StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code