bugGNU Octave - Bugs: bug #44453, Document that intersect (and other...

 
 

bug #44453: Document that intersect (and other set functions) return only unique elements

Submitter:  None
Submitted:  Fri 06 Mar 2015 04:44:50 PM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Fixed Assigned to:  None
Originator Name:  David Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.0.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 02 Jun 2015 04:37:42 PM UTC, comment #3: 

Retagging release from 4.0.0-rc1 to 4.0.0.

John W. Eaton <jwe>
Group administrator
Sat 21 Mar 2015 01:24:22 AM UTC, comment #2: 
Rik <rik5>
Group administrator
Sun 08 Mar 2015 01:25:21 AM UTC, comment #1: 

This is the correct behavior and matches the Matlab function (http://www.mathworks.com/help/matlab/ref/intersect.html).  The documentation needs to be updated to say that "unique" or "non-repetitive" elements are returned.

This is a pretty easy change to the m-files in the scripts/set directory.  If you can prepare a changeset or diff I can review and push it to the Mercurial repository

Rik <rik5>
Group administrator
Fri 06 Mar 2015 04:44:50 PM UTC, original submission:  

Here is a minimum working example that should illustrate the function's deficiencies:

length = 1000; %or any number you desire
randNum = 14;

A = randNum*ones(1, length);

B = randNum*ones(1, length);

[C, Ia, Ib] = intersect(A, B);

As described in the header, intersect does not return the correct output. In this instance, I observe the output as follows,
C =  14
Ia =  1000
Ib =  1000

when clearly C, Ia, and Ib should all be 1x1000 vectors where C is the common value 14, and Ia and Ib contain the numbers 1 thru 1000 or
C = [14, 14, 14, etc...]
Ia = [(1,1),(1,2),(1,3), etc...]
Ib = [(1,1),(1,2),(1,3), etc...]

Thanks for making Octave what it is today!

Anonymous

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2015-06-02 jwe Release4.0.0-rc1 4.0.0
    2015-03-21 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2015-03-08 rik5 CategoryOctave Function Documentation
        Item GroupIncorrect Result Documentation
        StatusNone Confirmed
        Release3.8.2 4.0.0-rc1
        Operating SystemMicrosoft Windows Any
        SummaryIntersect function returning neither complete vector of common elements nor indices Document that intersect (and other set functions) return only unique elements

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code