octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #48857] Incorrect indices for `union` with 'ro


From: Joakim Andén
Subject: [Octave-bug-tracker] [bug #48857] Incorrect indices for `union` with 'rows' flag
Date: Mon, 22 Aug 2016 14:23:37 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0

URL:
  <http://savannah.gnu.org/bugs/?48857>

                 Summary: Incorrect indices for `union` with 'rows' flag
                 Project: GNU Octave
            Submitted by: janden
            Submitted on: Mon 22 Aug 2016 02:23:35 PM GMT
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.0.0
        Operating System: GNU/Linux

    _______________________________________________________

Details:

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.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 22 Aug 2016 02:23:35 PM GMT  Name: union_fix.diff  Size: 1kB   By:
janden

<http://savannah.gnu.org/bugs/download.php?file_id=38314>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48857>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]