bugGNU Octave - Bugs: bug #48857, Incorrect indices for `union` with...

 
 

bug #48857: Incorrect indices for `union` with 'rows' flag

Submitter:  Joakim Andén <janden>
Submitted:  Mon 22 Aug 2016 02:23:35 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.0.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 01 Sep 2016 04:03:50 AM UTC, comment #1: 

I reviewed your patch and pushed it here (http://hg.savannah.gnu.org/hgweb/octave/rev/5a3f581a314f).  It will be a part of the 4.2 release which is expected in the next month.

The things I changed were using 2 spaces for indentation and wrapping long lines to less than 80 characters.

Thanks for the patch.

Rik <rik5>
Group administrator
Mon 22 Aug 2016 02:23:35 PM UTC, original submission:  

When calling `union` with the 'rows' flag, the correct set of rows is returned, but their indices within the two input arrays are not correct. Specifically, calling


[c, ia, ib] = union([1 2; 2 3; 4 5], [2 3; 3 4; 5 6], 'rows');


we get as output


c =

   1   2
   2   3
   3   4
   4   5
   5   6

ia =

   1
   4
   5
   3
   6

ib = [](0x1)


where 'ia' and 'ib' should be


ia =

   1
   3

ib =

   1
   2
   3


I've included a changeset that fixes this and includes some tests to make sure we have the proper behavior.

Joakim Andén <janden>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #38314:  union_fix.diff added by janden (1KiB - text/x-patch)

 

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 janden (Submitted the item)
  • -email is unavailable- added by janden
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2016-09-01 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2016-08-22 janden Attached File- Added union_fix.diff, #38314
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code