bugGNU Octave - Bugs: bug #45686, intersect.m with empty input

 
 

bug #45686: intersect.m with empty input

Submitter:  Juan Pablo Carbajal <juanpi>
Submitted:  Mon 03 Aug 2015 09:29:12 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  juanpi Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 11 Aug 2015 08:26:22 PM UTC, comment #5: 

I checked in a change on the default branch that matches Matlab's preferences for the output (cell, char, or matrix).  The size is 0x0, rather than 0x1, but I'm prepared to accept that difference.  See this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/3fc21d7ac11c).

Rik <rik5>
Group administrator
Tue 11 Aug 2015 07:00:35 PM UTC, comment #4: 

Ethan says:


ans =

   Empty string: 0-by-1


Juan Pablo Carbajal <juanpi>
Group Member
Tue 11 Aug 2015 06:52:26 PM UTC, comment #3: 

Interesting.  One thing was not as expected.  Can you have Ethan test this


intersect (['a', 'b'], [])



Rik <rik5>
Group administrator
Tue 11 Aug 2015 06:28:31 PM UTC, comment #2: 

Courtesy of Ethan Meyers


intersect ({'a', 'b'}, [])
intersect ([], ['a', 'b'])
intersect ({}, [])

ans =

   Empty cell array: 0-by-1


ans =

   Empty string: 0-by-1



ans =

   Empty cell array: 0-by-1




intersect (['a', 'b'], {})
intersect ([], {'a', 'b'})
intersect ([], {})
ans =

   Empty cell array: 0-by-1


ans =

   Empty cell array: 0-by-1


ans =

   Empty cell array: 0-by-1


Juan Pablo Carbajal <juanpi>
Group Member
Tue 11 Aug 2015 05:09:49 PM UTC, comment #1: 

I have a patch for this, but I want to verify the expected output when an empty matrix is in the second position.  Can you run the following three tests under Matlab and report back?


intersect ({'a', 'b'}, [])
intersect ([], ['a', 'b'])
intersect ({}, [])



Rik <rik5>
Group administrator
Mon 03 Aug 2015 09:29:12 PM UTC, original submission:  


intersect (['a', 'b'], {})
intersect ([], {'a', 'b'})
intersect ([], {})


Return the empty array in Octave but the empty cell array (probably 0x1) in matlab.

See bug #45685

Juan Pablo Carbajal <juanpi>
Group Member

 

(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 rik5 (Posted a comment)
  • -email is unavailable- added by juanpi (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-08-11 rik5 StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2015-08-11 rik5 StatusNone In Progress

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code