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

 
 

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

Submitted by:  None
Submitted on:  Fri 06 Mar 2015 04:44:50 PM UTC  
 
Category: DocumentationSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Documentation
Status: FixedAssigned to: None
Originator Name: DavidOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.0.0
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

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>
Project Administrator
Sat 21 Mar 2015 01:24:22 AM UTC, comment #2:

Fixed in this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/72ccbd36e23c).

Rik <rik5>
Project 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>
Project 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 File(s):
   
   
Comment:
   

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

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 02 Jun 2015 04:37:42 PM UTCjweRelease4.0.0-rc1=>4.0.0
    Sat 21 Mar 2015 01:24:22 AM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Sun 08 Mar 2015 01:25:21 AM UTCrik5CategoryOctave 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.1-cleanup1