[ https://issues.apache.org/jira/browse/MATH-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15065729#comment-15065729 ]
Luc Maisonobe commented on MATH-1300: ------------------------------------- My position would be that even if having values independent of chunk size is a nice features, it is not worth degrading either understandability or performances for it. So just advertising the fact this property does *not* hold would be fine to me. I'm also not sure losing much time with Mersenne twister is worth it. This generator was the best one a few years ago but has been superseded with the WELL family of generators almost 10 years ago (see http://www.iro.umontreal.ca/~panneton/WELLRNG.html, where a mink to the reference paper can be found). According to the paper, the Mersenne twister suffers fro a lack of chaos at the start (i.e. the first few millions generations) that the WELL generators fix. > BitsStreamGenerator#nextBytes(byte[]) is wrong > ---------------------------------------------- > > Key: MATH-1300 > URL: https://issues.apache.org/jira/browse/MATH-1300 > Project: Commons Math > Issue Type: Bug > Affects Versions: 3.5 > Reporter: Rostislav Krasny > Attachments: MersenneTwister2.java, TestMersenneTwister.java > > > Sequential calls to the BitsStreamGenerator#nextBytes(byte[]) must generate > the same sequence of bytes, no matter by chunks of which size it was divided. > This is also how java.util.Random#nextBytes(byte[]) works. > When nextBytes(byte[]) is called with a bytes array of length multiple of 4 > it makes one unneeded call to next(int) method. This is wrong and produces an > inconsistent behavior of classes like MersenneTwister. > I made a new implementation of the BitsStreamGenerator#nextBytes(byte[]) see > attached code. -- This message was sent by Atlassian JIRA (v6.3.4#6332)