Examples of nextDouble()


Examples of org.jamesii.core.math.random.generators.IRandom.nextDouble()

        if (partition != null && partition.containsKey(i)) {
          int p = partition.get(i);

          if (p >= usedColors.size()) {
            for (int k = usedColors.size(); k <= p; k++) {
              usedColors.add(rand.nextDouble() + " " + rand.nextDouble() + " "
                  + rand.nextDouble());
            }
          }

          file.write("node [color=\"" + usedColors.get(p) + "\"];\n");
View Full Code Here

Examples of org.jamesii.core.math.random.generators.java.JavaRandom.nextDouble()

    eles = 1000;
    // The seed -7538847116595691071l caused a problem in one of the queues
    // (with at least 1000 and 10000 eles)
    IRandom rand = new JavaRandom(-7538847116595691071l);
    for (int i = 0; i < eles; i++) {
      myQueue.enqueue(new Object(), tim + rand.nextDouble());
    }

    // get the min
    Double ti = myQueue.getMin();
    // remember the queue size
View Full Code Here

Examples of org.jenetics.util.LCG64ShiftRandom.nextDouble()

    final Random random = new LCG64ShiftRandom(1234);
    final Quantile<Double> quantile = new Quantile<>(q);

    final int N = 2_000_000;
    for (int i = 0; i < N; ++i) {
      quantile.accumulate(random.nextDouble());
    }

    Assert.assertEquals(quantile.getSamples(), N);
    Assert.assertEquals(quantile.getValue(), q, 1.0/sqrt(N));
  }
View Full Code Here

Examples of org.uncommons.maths.random.MersenneTwisterRNG.nextDouble()

    for (int nloop = 0; nloop < n; nloop++) {
      long datasetSize = 100;
      MersenneTwisterRNG rng = new MersenneTwisterRNG();
      byte[] seed = rng.getSeed();
      double threshold = rng.nextDouble();

      JobConf conf = new JobConf();
      RndLineRecordReader rndReader;
      Set<Long> dataset = new HashSet<Long>();
      LongWritable key = new LongWritable();
View Full Code Here

Examples of prefuse.util.collections.LiteralIterator.nextDouble()

     * Test method for 'edu.berkeley.guir.prefuse.data.util.IntIntTreeMap.keyIterator()'
     */
    public void testKeyIterator() {
        LiteralIterator iter = map.keyIterator();
        for ( int i=0; iter.hasNext(); ++i ) {
            double key = iter.nextDouble();
            assertEquals(sort[i], (int)key);
        }
    }

    /*
 
View Full Code Here

Examples of ucar.ma2.Array.nextDouble()

  }

  public double readValue(Variable targetVar, Variable fromVar, int[] index) throws InvalidRangeException, IOException {
    Section axisElement = mapIndex( targetVar, fromVar, index);
    Array result = targetVar.read(axisElement);
    return result.nextDouble();
  }

  public Section mapIndex(Variable targetVar, Variable fromVar, int[] fromIndex) throws InvalidRangeException {
    List<Dimension> toDims = targetVar.getDimensions();
    List<Dimension> fromDims = fromVar.getDimensions();
View Full Code Here

Examples of ucar.ma2.Array.nextDouble()

      for (PointObVar v : nvars) {
        if (v.getDataType().isNumeric()) {
          Array data = sdata.getArray(v.getName());
          data.resetLocalIterator();
          if (data.hasNext())
            dvals[dcount++] = data.nextDouble();

        } else if (v.getDataType().isString()) {
          ArrayChar data = (ArrayChar) sdata.getArray(v.getName());
          svals[scount++] = data.getString();
        }
View Full Code Here

Examples of vash.Seed.nextDouble()

      0.4729503362008035,
      0.21240207599109995
    };
    Seed s = getSeedOrFail("1.1", null, "Vash".getBytes());
    for(double e : expected) {
      double a = s.nextDouble();
      Assert.assertEquals(e, a, 0.0001);
    }
  }
 
  @Test
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.