Search in sources :

Example 81 with Well19937c

use of org.apache.commons.math3.random.Well19937c in project repseqio by repseqio.

the class ExportCloneSequencesActionTest method randomRoundTest.

@Test
public void randomRoundTest() throws Exception {
    double value = 12.34;
    double sum = 0.0;
    RandomGenerator random = new Well19937c(1232434);
    for (int i = 0; i < 100000; i++) sum += ExportCloneSequencesAction.randomizedRound(value, random);
    assertEquals(value, sum / 100000, 0.1);
}
Also used : Well19937c(org.apache.commons.math3.random.Well19937c) RandomGenerator(org.apache.commons.math3.random.RandomGenerator) Test(org.junit.Test)

Example 82 with Well19937c

use of org.apache.commons.math3.random.Well19937c in project cloudsim-plus by manoelcampos.

the class SortedSetVsLinkedList method doSetup.

@Setup(Level.Iteration)
public void doSetup() {
    sortedSet = new TreeSet<>();
    linkedList = new LinkedList<>();
    prng = new Well19937c();
    serial = 0;
    time = 0;
    maxTime = 0;
}
Also used : Well19937c(org.apache.commons.math3.random.Well19937c)

Aggregations

Well19937c (org.apache.commons.math3.random.Well19937c)81 RandomDataGenerator (org.apache.commons.math3.random.RandomDataGenerator)42 ArrayList (java.util.ArrayList)31 RandomGenerator (org.apache.commons.math3.random.RandomGenerator)28 Test (org.junit.Test)23 FakeGradientFunction (gdsc.smlm.function.FakeGradientFunction)17 DoubleEquality (gdsc.core.utils.DoubleEquality)7 Gaussian2DFunction (gdsc.smlm.function.gaussian.Gaussian2DFunction)6 DenseMatrix64F (org.ejml.data.DenseMatrix64F)6 TimingService (gdsc.core.test.TimingService)4 Statistics (gdsc.core.utils.Statistics)4 StoredDataStatistics (gdsc.core.utils.StoredDataStatistics)4 Gradient1Function (gdsc.smlm.function.Gradient1Function)4 ValueProcedure (gdsc.smlm.function.ValueProcedure)4 ErfGaussian2DFunction (gdsc.smlm.function.gaussian.erf.ErfGaussian2DFunction)4 TooManyEvaluationsException (org.apache.commons.math3.exception.TooManyEvaluationsException)4 NucleotideSequence (com.milaboratory.core.sequence.NucleotideSequence)3 PseudoRandomGenerator (gdsc.core.utils.PseudoRandomGenerator)3 PrecomputedGradient1Function (gdsc.smlm.function.PrecomputedGradient1Function)3 SingleFreeCircularGaussian2DFunction (gdsc.smlm.function.gaussian.SingleFreeCircularGaussian2DFunction)3