bugGNU Octave - Bugs: bug #42421, "find" function...

 
 

bug #42421: "find" function overflows for large sparse matrices

Submitter:  David Spies <dspyz>
Submitted:  Sun 25 May 2014 06:19:20 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 25 Aug 2021 12:07:54 PM UTC, comment #5: 

I can confirm I get the correct result, as in comment #4. Closing report as fixed (even though I don't know what change fixed this).

Pantxo Diribarne <pantxo>
Group Member
Fri 30 Jul 2021 02:06:35 AM UTC, comment #4: 

Using version 6.1.0


>> x = sparse(100000,30000);
>> x(end, end) = 1;
>> i = find(x)
i = 3.0000e+09


Anonymous
Thu 15 Dec 2016 04:12:26 PM UTC, comment #3: 

This issue is still present in Octave 4.2.0.

The code example from comment #0 still gives a large negative number.

Hartmut <hardy>
Thu 20 Aug 2015 10:59:00 AM UTC, comment #2: 

I can still confirm the problem for the current development version. But I think the patch goes too far for just applying it.

Kai Torben Ohlhus <siko1056>
Group Member
Sun 25 May 2014 06:31:46 PM UTC, comment #1: 

This is fixed by adding a method to translate directly from row-column pairs to doubles and then multiplying.  I rewrote find with templates so that all calls to find go to the same place (as I already tried to do once, but this time I have a better understanding of the core of Octave so I could do it "right").

I've attached my patch. It's changesets 18792 and 18793 on my clone of Octave at https://dspyz@bitbucket.org/dspyz/octave
Note that this patch goes on top of 18791 which removes _colp from permutation matrices.


(file #31432)

David Spies <dspyz>
Sun 25 May 2014 06:19:20 PM UTC, original submission:  

The indices returned by "find" overflow on large matrices:


octave:1> x = sparse(100000,30000);
octave:2> x(end, end) = 1;
octave:3> i = find(x)
i =   -1.2950e+09


David Spies <dspyz>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #31432:  fixFind.diff added by dspyz (44KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by dspyz (Submitted the item)
  •  

    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
    2021-08-25 pantxo StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2015-08-20 siko1056 StatusNone Confirmed
    2014-05-25 dspyz Attached File- Added fixFind.diff, #31432

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code