You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gilles (JIRA)" <ji...@apache.org> on 2016/03/28 03:50:25 UTC
[jira] [Commented] (MATH-1348) Provide an adaptor that is a
subclass of "java.util.Random"
[ https://issues.apache.org/jira/browse/MATH-1348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15213715#comment-15213715 ]
Gilles commented on MATH-1348:
------------------------------
Available on branch "feature-MATH-1158".
This feature is broken (see Javadoc), as this class only exists to serve as a compatible _interface_.
Since {{Random}} is a class, not an interface, inheritance was necessary; but no inherited implementation is actually used: neither the "core" RNG (method {{next(int bits)}}) nor any of the methods that create other Java types from the generated bits.
> Provide an adaptor that is a subclass of "java.util.Random"
> -----------------------------------------------------------
>
> Key: MATH-1348
> URL: https://issues.apache.org/jira/browse/MATH-1348
> Project: Commons Math
> Issue Type: Sub-task
> Reporter: Gilles
> Assignee: Gilles
> Priority: Minor
> Labels: api, compatibility
> Fix For: 4.0
>
>
> Some utilities of the JDK require a {{java.util.Random}} as an argument (e.g. method "shuffle" in {{java.util.Collections}}.
> In order to use such utilities but with the actual RNG delegated to alternative algorithms (i.e. those provided in CM), we have to extend {{Random}}, overriding all the generation methods.
> The adaptor will be similar to {{o.a.c.m.random.RandomAdaptor}} but for {{o.a.c.m.rng.UniformRandomProvider}} instead of {{o.a.c.m.random.RandomGenerator}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)