bugGNU Octave - Bugs: bug #36535, randperm(X,Y) returns duplicates

 
 

bug #36535: randperm(X,Y) returns duplicates

Submitter:  None
Submitted:  Thu 24 May 2012 03:58:16 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  jordigh
Originator Name:  Patrick Tierney Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.1
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 25 May 2012 03:34:06 PM UTC, comment #2: 

Okay, I pushed a fix on stable:

    http://hg.savannah.gnu.org/hgweb/octave/rev/42edbe6f6a8d

This should be part of the 3.6.2 release that should happen very soon now.

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Thu 24 May 2012 04:13:19 PM UTC, comment #1: 

Yeah, confirmed. Something is wrong with randperm. I made the current implementation, so I probably made a mistake somewhere.

This reproduces it for me:


rand("seed", 30); sort(randperm(305,30))


Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Thu 24 May 2012 03:58:16 PM UTC, original submission:  

Not sure if this a bug in the new randperm(X,M) or in sort() but I just got output [2 3 3 6 10 ...] when calling sort(randperm(305,30)).  This is a one-time error. Repeated calls produce correct values.

Using 3.6.1 mingw version on Win7.

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 jordigh (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-05-25 jordigh StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2012-05-24 jordigh Assigned toNone jordigh
        Summarysort(randperm(X,Y) returns duplicates randperm(X,Y) returns duplicates
    2012-05-24 jordigh StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code