commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-1339) "shuffle" in "MathArrays"
Date Sun, 20 Mar 2016 23:54:33 GMT

    [ https://issues.apache.org/jira/browse/MATH-1339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15203574#comment-15203574
] 

Gilles commented on MATH-1339:
------------------------------

Proposed fix available in branch "feature-MATH-1339".

> "shuffle" in "MathArrays"
> -------------------------
>
>                 Key: MATH-1339
>                 URL: https://issues.apache.org/jira/browse/MATH-1339
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>              Labels: performance
>             Fix For: 4.0
>
>
> Method {{shuffle}} creates an instance of {{UniformIntegerDistribution}} for each entry
of the list to be shuffled.  Then {{sample()}} is called on each instance, which in turn will
call {{nextInt()}} on the provided RNG.
> The same effect could be achieved more efficiently by calling {{nextInt(int)}} directly
on the provided RNG, followed by an addition.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message