Examples of nextDouble()


Examples of cc.mallet.util.Randoms.nextDouble()

    Variable var1 = new Variable (3);

    Randoms r = new Randoms (17671);

    double[] probs = new double[] {
      r.nextDouble(),
      r.nextDouble(),
      r.nextDouble(),
      r.nextDouble(),
      r.nextDouble(),
      r.nextDouble()
View Full Code Here

Examples of cern.jet.random.AbstractDistribution.nextDouble()

  @Test
  public void testGetSRID() {
    AbstractDistribution one = new Normal(1.0, 0.0, generator);
    AbstractDistribution two = new Normal(1.0, 0.0, generator);
   
    assertEquals(one.nextDouble(), two.nextDouble(), 0.0001);
  }
}
View Full Code Here

Examples of cern.jet.random.Normal.nextDouble()

  @Test
  public void testGetSRID() {
    AbstractDistribution one = new Normal(1.0, 0.0, generator);
    AbstractDistribution two = new Normal(1.0, 0.0, generator);
   
    assertEquals(one.nextDouble(), two.nextDouble(), 0.0001);
  }
}
View Full Code Here

Examples of cern.jet.random.Uniform.nextDouble()

   * Use a new random number generator to generate numExamples
   * random gaussians, and add them to the QuantileBin1D
   */
  Uniform dataRand = new Uniform(new DRand(7757));
  for (int i = 1; i <= numExamples; i++) {
    double gauss = dataRand.nextDouble();
      qAccum.add(gauss);
      dbin.add(gauss);
  }
 
  /*
 
View Full Code Here

Examples of cern.jet.random.engine.MersenneTwister64.nextDouble()

    };

    final RandomEngine ran = new MersenneTwister64(MersenneTwister.DEFAULT_SEED);
    final double[] temp = new double[nWeights];
    for (int i = 0; i < nWeights; i++) {
      temp[i] = ran.nextDouble();
    }
    final DoubleMatrix1D start = new DoubleMatrix1D(temp);

    final LeastSquareResults lsRes = NLLSWP.solve(new DoubleMatrix1D(obs), new DoubleMatrix1D(n, 0.01), func, jac, start, penalty);
    if(print) {
View Full Code Here

Examples of cern.jet.random.engine.RandomEngine.nextDouble()

    if (Math.abs(b) < 1e-3 && Math.abs(c) < 1e-3) { //almost flat smile
      final double theta = Math.PI / 2 - 0.01;
      return new DoubleMatrix1D(a, 0.01, theta, theta);
    }
    final double theta = Math.PI / 2 * random.nextDouble();
    return new DoubleMatrix1D(a * (0.8 + 0.4 * random.nextDouble()), a * 0.5 * random.nextDouble(), theta, theta);
  }

  @Override
  protected BitSet getLocalFixedValues() {
View Full Code Here

Examples of com.github.nmorel.gwtjackson.client.stream.JsonReader.nextDouble()

    public void testStrictVeryLongNumber() {
        JsonReader reader = newJsonReader( "[0." + repeat( '9', 8192 ) + "]" );
        reader.beginArray();
        try {
            assertEquals( 1d, reader.nextDouble() );
            fail();
        } catch ( MalformedJsonException expected ) {
        }
    }
View Full Code Here

Examples of com.heatonresearch.aifh.randomize.GenerateRandom.nextDouble()

        final double[][] ideal = new double[rows][cols];
        final double[][] actual = new double[rows][cols];

        for (int row = 0; row < rows; row++) {
            for (int col = 0; col < cols; col++) {
                ideal[row][col] = rnd.nextDouble(low, high);
                actual[row][col] = ideal[row][col] + (rnd.nextGaussian() * distort);
            }
        }

        final DataHolder result = new DataHolder();
View Full Code Here

Examples of com.heatonresearch.aifh.randomize.MersenneTwisterGenerateRandom.nextDouble()

        final double[][] ideal = new double[rows][cols];
        final double[][] actual = new double[rows][cols];

        for (int row = 0; row < rows; row++) {
            for (int col = 0; col < cols; col++) {
                ideal[row][col] = rnd.nextDouble(low, high);
                actual[row][col] = ideal[row][col] + (rnd.nextGaussian() * distort);
            }
        }

        final DataHolder result = new DataHolder();
View Full Code Here

Examples of freenet.crypt.DummyRandomSource.nextDouble()

        Logger.normal(RealNodeRoutingTest.class, "Connected nodes");
        // Now add some random links
        for(int i=0;i<NUMBER_OF_NODES*5;i++) {
            if(i % NUMBER_OF_NODES == 0)
                Logger.normal(RealNodeRoutingTest.class, String.valueOf(i));
            int length = (int)Math.pow(NUMBER_OF_NODES, random.nextDouble());
            int nodeA = random.nextInt(NUMBER_OF_NODES);
            int nodeB = (nodeA+length)%NUMBER_OF_NODES;
            //System.out.println(""+nodeA+" -> "+nodeB);
            Node a = nodes[nodeA];
            Node b = nodes[nodeB];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.