bugGNU Octave - Bugs: bug #53655, regression?...

 
 

bug #53655: regression? "find(false)" was 0x0 now its 0x1

Submitter:  Colin Macdonald <cbm>
Submitted:  Sun 15 Apr 2018 05:22:18 AM UTC
   
 
Category:  Interpreter Severity:  4 - Important
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.3.90 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 16 Apr 2018 07:26:52 AM UTC, comment #3: 

This is fixed on the stable branch for Octave 4.4

https://hg.savannah.gnu.org/hgweb/octave/rev/316b75b0d886

Mike Miller <mtmiller>
Group Member
Sun 15 Apr 2018 09:49:17 PM UTC, comment #2: 

Yes, this regression is caused by the change for bug #53603.

At 6f1fde568e46, size(find(false)) is [0 0]. At 2f0c0c0652d5, size(find(false)) is [0 1].

I made the following additional change


--- a/libinterp/corefcn/find.cc
+++ b/libinterp/corefcn/find.cc
@@ -446,7 +446,8 @@ b = sparse (i, j, v, sz(1), sz(2));

           dim_vector dv = result.dims ();

-          retval(0) = (dv.isvector () ? result : result.reshape (dv.as_column ()));
+          retval(0) = (dv.all_zero () || dv.isvector ()
+                       ? result : result.reshape (dv.as_column ()));
         }
       else
         {


and the regression is fixed.

I'll push this on stable later today if there are no objections and if it still works after I update the stable branch and run the full test suite.

Mike Miller <mtmiller>
Group Member
Sun 15 Apr 2018 01:49:06 PM UTC, comment #1: 

MATLAB 2017a

>> find(false)
ans =
     []
>> whos
  Name      Size            Bytes  Class     Attributes

  ans       0x0                 0  double



Ceral Paquet <octavebugs>
Sun 15 Apr 2018 05:22:18 AM UTC, original submission:  

This is surely related to https://savannah.gnu.org/bugs/?53603

With 4.2.2 and stable from a week or so ago (13fd0610480f+)


octave:17> find(false)
ans = [](0x0)
octave:18> find([false false])
ans = [](1x0)
octave:19> find([false; false])
ans = [](0x1)
octave:20> find([false false; false false])
ans = [](0x1)


But with 4.3.90 (hg id: 65f201566857+):


octave:48> find(false)
ans = [](0x1)
octave:49> find([false false])
ans = [](1x0)
octave:50> find([false; false])
ans = [](0x1)
octave:51> find([false false; false false])
ans = [](0x1)


I have not tested Matlab but because this caused a bunch of test failures in the Symbolic pkg, I think 0x0 is the Matlab result.

Colin Macdonald <cbm>

 

(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 mtmiller (Updated the item)
  • -email is unavailable- added by octavebugs (Posted a comment)
  • -email is unavailable- added by cbm (Submitted the item)
  • -email is unavailable- added by cbm
  • -email is unavailable- added by cbm
  •  

    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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-16 mtmiller StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2018-04-15 mtmiller StatusConfirmed Patch Submitted
    2018-04-15 mtmiller Severity3 - Normal 4 - Important
        StatusNone Confirmed
    2018-04-15 cbm Carbon-Copy- Added jwe
        Carbon-Copy- Added rik

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code