bugGNU Octave - Bugs: bug #41512, max() of sparse logical matrix...


bug #41512: max() of sparse logical matrix fails

Submitted by:  David Spies <dspyz>
Submitted on:  Sat 08 Feb 2014 06:34:56 PM UTC  
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: ConfirmedAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: Any

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


Sat 08 Feb 2014 10:38:32 PM UTC, comment #2:

Confirmed. This is actually a regression that happened sometime between 3.2.4 and 3.4.3. Even in 3.2.4 the behavior isn't totally perfect because the return value j should be a sparse matrix.

3.2.4 example code:

Rik <rik5>
Project Administrator
Sat 08 Feb 2014 08:18:08 PM UTC, comment #1:

a simpler offending case: [i,j]=max(sparse(true))
(although i=max(sparse(true)) works fine)

Felipe G. Nievinski <fgnievinski>
Sat 08 Feb 2014 06:34:56 PM UTC, original submission:

Looking at the second return value of max(a,[],2) is a way to find the index of the first true element in each row of a.

matlab supports this when a is sparse logical, but octave gives an error:

octave:7> [i,j] = max(logical(speye(3)),[],2);
error: octave_base_value::int8_array_value(): wrong type argument 'sparse bool matrix'

Of course you can always just convert the argument to double

David Spies <dspyz>


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

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by fgnievinski (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 08 Feb 2014 10:38:32 PM UTCrik5Item GroupMatlab Compatibility=>Regression
      SummaryTake max of sparse logical matrix=>max() of sparse logical matrix fails

    Back to the top

    Powered by Savane 3.1-cleanup