You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Ole Ersoy (JIRA)" <ji...@apache.org> on 2015/12/26 22:51:49 UTC
[jira] [Commented] (MATH-1307) Create a base class for all RNGs
[ https://issues.apache.org/jira/browse/MATH-1307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15071989#comment-15071989 ]
Ole Ersoy commented on MATH-1307:
---------------------------------
Suggesting BaseGenerator for the name. It might be good to have a naming convention that works across the board. RealVector is an abstract class, but leaves Abstract out of the name, however AbstractRealMatrix does not...
> Create a base class for all RNGs
> --------------------------------
>
> Key: MATH-1307
> URL: https://issues.apache.org/jira/browse/MATH-1307
> Project: Commons Math
> Issue Type: Improvement
> Reporter: Gilles
> Assignee: Gilles
> Priority: Minor
> Labels: api, inheritance
> Fix For: 4.0
>
> Attachments: BaseAbstractRandomGenerator.java
>
>
> I proposed to create a base class which the existing abstract classes {{AbstractRandomGenerator}} and {{BitsStreamGenerator}} will extend.
> This would allow to define {{nextBytes(byte[])}} at the base class level.
> The code for that method is almost identical in the two hierarchies: they only differ in a call to either {{nextInt()}} or {{next(32)}} respectively; the latter is however the same as the former, in disguise, and is not subject to change given the type of return value.
> As a corollary, the new base class can be the unique place where to add utilities such as the one proposed in MATH-1306.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)