Package org.apache.commons.math3.random

Examples of org.apache.commons.math3.random.Well44497b


    int rowNum = 2;
    int haploidNum = 2;
    int groupNum = 1;
    int simSize = 1000000;
    CornSurface myCornSurface = new CornSurface(kernelNum,rowNum,haploidNum,groupNum);
    RandomGenerator rg = new Well44497b();
    RandomDataImpl rng = new RandomDataImpl(rg);
//    CornSimulation myCornSimulation = new CornSimulation(myCornSurface,rng,simSize);
//    System.out.println("The pvalue for four neighbor group is: " + myCornSimulation.simulate(NeighborType.FourNeighbor)+".");
//
//    System.out.println("The pvalue for eight neighbor group is: "+ myCornSimulation.simulate(NeighborType.EightNeighbor)+".");
View Full Code Here


* @author adu
*
*/
public class TestSpeed {
  public static void main(String[] args) {
    RandomGenerator rg = new Well44497b();
    RandomDataImpl rng = new RandomDataImpl(rg);
    Timer timer = new Timer();
    timer.begin();
    final int MAX_THREADS = Runtime.getRuntime().availableProcessors();
    ExecutorService pool = Executors.newFixedThreadPool(MAX_THREADS);
View Full Code Here

import dclong.util.Timer;

public class TestRNGSpeed {
  public static void main(String[] args){
    //CommonMath
    RandomGenerator rg = new Well44497b(29);
    RandomDataImpl rng = new RandomDataImpl(rg);
    Timer timer = new Timer();
    timer.start();
    for(long i=0; i<130000000; ++i){
//      rng.nextPermutation(16, 8);
View Full Code Here

import org.apache.commons.math3.random.Well44497b;


public class TestFinal {
  public static void main(String[] args){
    RandomGenerator rg = new Well44497b(5);
    RandomDataImpl rng = new RandomDataImpl(rg);
    FinalClass fc = new FinalClass.Builder(rng).builder();
    System.out.println(fc.getRNG().nextInt(0, 10));
    System.out.println(fc.getRNG().nextInt(0, 10));
    System.out.println(fc.getRNG().nextInt(0, 10));
View Full Code Here

import org.apache.commons.math3.random.RandomGenerator;
import org.apache.commons.math3.random.Well44497b;

public class TestRNG {
  public static void main(String[] args){
    RandomGenerator rg = new Well44497b(29);
    RandomDataImpl rng = new RandomDataImpl(rg);
    int numberOfElements = 12870;
    int upper = numberOfElements - 1;
    int[] freq = new int[numberOfElements];
    Arrays.fill(freq, 0);
View Full Code Here

import org.apache.commons.math3.random.Well44497b;


public class TestNextInt {
  public static void main(String[] args){
    RandomGenerator rg = new Well44497b();
    RandomDataImpl rng = new RandomDataImpl(rg);
    System.out.println(rng.nextInt(0, 1));
  }
View Full Code Here

            dest.meanImpl = new Mean(dest.secondMoment);
        } else {
            dest.meanImpl = source.meanImpl.copy();
        }
        if (source.getGeoMeanImpl() instanceof GeometricMean) {
            dest.geoMeanImpl = new GeometricMean((SumOfLogs) dest.sumLogImpl);
        } else {
            dest.geoMeanImpl = source.geoMeanImpl.copy();
        }

        // Make sure that if stat == statImpl in source, same
View Full Code Here

        for (int i = 0; i < k; ++i) {
            sumImpl[i]     = new Sum();
            sumSqImpl[i]   = new SumOfSquares();
            minImpl[i]     = new Min();
            maxImpl[i]     = new Max();
            sumLogImpl[i= new SumOfLogs();
            geoMeanImpl[i] = new GeometricMean();
            meanImpl[i]    = new Mean();
        }

        covarianceImpl =
View Full Code Here

        geoMeanImpl = new StorelessUnivariateStatistic[k];
        meanImpl    = new StorelessUnivariateStatistic[k];

        for (int i = 0; i < k; ++i) {
            sumImpl[i]     = new Sum();
            sumSqImpl[i]   = new SumOfSquares();
            minImpl[i]     = new Min();
            maxImpl[i]     = new Max();
            sumLogImpl[i= new SumOfLogs();
            geoMeanImpl[i] = new GeometricMean();
            meanImpl[i]    = new Mean();
View Full Code Here

     * @param checker Convergence checker.
     */
    protected BaseOptimizer(ConvergenceChecker<PAIR> checker) {
        this.checker = checker;

        evaluations = new Incrementor(0, new MaxEvalCallback());
        iterations = new Incrementor(0, new MaxIterCallback());
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.math3.random.Well44497b

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.