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


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

Submitted by:  David Spies <dspyz>
Submitted on:  Sun 25 May 2014 06:19:20 PM UTC  
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: ConfirmedAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


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>
Project 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:

David Spies <dspyz>


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

Attach File(s):

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
  • -unavailable- added by hardy (Posted a comment)
  • -unavailable- added by siko1056 (Posted a comment)
  • -unavailable- added by dspyz (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 20 Aug 2015 10:59:00 AM UTCsiko1056StatusNone=>Confirmed
    Sun 25 May 2014 06:31:46 PM UTCdspyzAttached File-=>Added fixFind.diff, #31432

    Back to the top

    Powered by Savane 3.1-cleanup1