bugGNU Octave - Bugs: bug #29863, ismember outputs do not match...

 
 

bug #29863: ismember outputs do not match input array dimension

Submitted by:  Qianqian Fang <fangq>
Submitted on:  Wed 12 May 2010 04:17:45 AM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: Works For MeAssigned to: Jaroslav Hajek <highegg>
Originator Name: Qianqian FangOpen/Closed: Closed
Release: 3.2.0Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 12 May 2010 02:35:26 PM UTC, comment #3:

Summary: broken in 3.2.0, but already fixed in dev version.

I'm going to close this bug.

Rik <rik5>
Project Administrator
Wed 12 May 2010 05:17:04 AM UTC, comment #2:

sorry, the paths messed up. I was running 3.2.0 after all.

Qianqian Fang <fangq>
Wed 12 May 2010 05:09:46 AM UTC, comment #1:

This is what I get in the development version:

octave:1> f=[1 2 3;3 4 5; 1 4 9];
octave:2> [ii,jj]=ismember(f,f(1,:));
octave:3> ii
ii =

1 1 1
1 0 0
1 0 0

octave:4> jj
jj =

1 2 3
3 0 0
1 0 0

I can confirm that in 3.2.x the behavior is wrong, i.e. column vectors are produced.

If you have both 3.2.x and dev version installed, please make sure that the paths don't mix up, i.e. that the output of "which ismember" points really to the 3.3.51+ version.

Jaroslav Hajek <highegg>In charge of this item.
Wed 12 May 2010 04:17:45 AM UTC, original submission:

ismember behaves differently from matlab. Based on the help description, the output logic array has the same dimension as the input, however, in octave 3.2 as well as the hg version, the output is a vertical vector no matter what the input dimension is.

Here is an example:

f=[1 2 3;3 4 5; 1 4 9];
[ii,jj]=ismember(f,f(1,:));

the outputs ii and jj are both 9x1 vectors. while, in matlab, both are 3x3 arrays (the same as f).

Possible fix:

maybe a line such as the following

a_idx = reshape(a_idx, size(a));

should be added around #98 and #123 in ismember.m

Qianqian Fang <fangq>

 

(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 rik5 (Posted a comment)
  • -unavailable- added by highegg (Posted a comment)
  • -unavailable- added by fangq (Submitted the item)
  • -unavailable- added by fangq ([BUG] ismember outputs do not match input array dimension)
  • -unavailable- added by fangq ([BUG] ismember outputs do not match input array dimension)
  •  

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

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 12 May 2010 02:35:26 PM UTCrik5Open/ClosedOpen=>Closed
      Releasedev=>3.2.0
    Wed 12 May 2010 05:09:46 AM UTChigheggStatusNone=>Works For Me
      Assigned toNone=>highegg
    Wed 12 May 2010 04:17:45 AM UTCfangqCarbon-Copy-=>Added -unavailable-
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1