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

Ted Dunning commented on MAHOUT-687:
------------------------------------

{quote}
SamplingLongPrimitiveIterator used one common Random which cause the unit test 
"deterministic seed" trick fail for some unknown reason. Changed class to use 
one Random per instance.
{quote}

Random number generators should almost never be shared between objects for many 
reasons.  The two I think are most important that it makes the objects 
inherently thread unsafe and it makes the threads sharing the RNG's very slow 
due to memory synchronization.  Some RNG's aren't even thread safe themselves 
so sharing is a complete disaster as opposed to just bad.

> Random generator objects- slight refactor
> -----------------------------------------
>
>                 Key: MAHOUT-687
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-687
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Lance Norskog
>            Priority: Minor
>         Attachments: MAHOUT-687.patch, MAHOUT-687.patch
>
>
> Problems:
> * Uncommons MersenneTwisterRNG, the default RandomUtils.getRandom(), ignores 
> setSeed without throwing an error.
> * The project wants to move off Uncommons anyway.
> This patch uses the org.apache.commons.math.random.RandomGenerator classes 
> instead of org.apache.uncommons.maths.RepeatableRNG classes.
> Testcases: All math test cases pass except for 
> org.apache.mahout.math.stats.LogLikelihoodTest. 
> Other package tests fail that are mostly about testing random-oriented 
> classes; not a surprise.
> Almost all tests that use random numbers in algorithms still pass; this is a 
> good sign of their stability.
> .
> Still, a lot of tests have to be fiddled to make this commit.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to