commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (MATH-1020) "nextPermutation" method broken (in class "o.a.c.m.random.RandomDataGenerator")
Date Fri, 09 Aug 2013 13:35:49 GMT

     [ https://issues.apache.org/jira/browse/MATH-1020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Gilles updated MATH-1020:
-------------------------

    Attachment: MATH-1020.patch

IIUC, the whole array must be randomized (which is what the broken "shuffle" was doing), then
from the "n" entries, "k" are picked (see attached patch).

                
> "nextPermutation" method broken (in class "o.a.c.m.random.RandomDataGenerator")
> -------------------------------------------------------------------------------
>
>                 Key: MATH-1020
>                 URL: https://issues.apache.org/jira/browse/MATH-1020
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.2
>            Reporter: Gilles
>             Fix For: 3.3
>
>         Attachments: MATH-1020.patch
>
>
> Correct behaviour of this method relied on the [broken behaviour of "shuffle"|MATH-1019].
> With a fixed "shuffle", the "nextSample()" unit test caught the bug in this method.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message