/external/apache-commons-math/src/main/java/org/apache/commons/math/random/ |
AbstractRandomGenerator.java | 24 * Default implementations for all methods other than {@link #nextDouble()} and 27 * All data generation methods are based on {@code code nextDouble()}. 130 * <code>(int) (nextDouble() * Integer.MAX_VALUE)</code> 137 return (int) (nextDouble() * Integer.MAX_VALUE); 147 * <code>(int) (nextDouble() * n</code> 160 int result = (int) (nextDouble() * n); 172 * <code>(long) (nextDouble() * Long.MAX_VALUE)</code> 179 return (long) (nextDouble() * Long.MAX_VALUE); 189 * <code>nextDouble() <= 0.5</code> 197 return nextDouble() <= 0.5 [all...] |
RandomGenerator.java | 135 double nextDouble();
|
UniformRandomGenerator.java | 58 return SQRT3 * (2 * generator.nextDouble() - 1.0);
|
BitsStreamGenerator.java | 51 * #nextBoolean()}, {@link #nextBytes(byte[])}, {@link #nextDouble()}, 84 public double nextDouble() { 101 final double x = nextDouble(); 102 final double y = nextDouble();
|
RandomAdaptor.java | 99 public double nextDouble() { 100 return randomGenerator.nextDouble();
|
UnitSphereRandomVectorGenerator.java | 69 final double comp = 2 * rand.nextDouble() - 1;
|
RandomDataImpl.java | 204 double r = getRan().nextDouble(); 224 double r = getRan().nextDouble(); 316 return lower + (int) (sec.nextDouble() * (upper - lower + 1)); 337 return lower + (long) (sec.nextDouble() * (upper - lower + 1)); 372 rnd = generator.nextDouble(); 487 double unif = generator.nextDouble(); 489 unif = generator.nextDouble(); 498 * Random.nextDouble(), but rejects 0 values (i.e., will generate another 499 * random double if Random.nextDouble() returns 0). This is necessary to 518 // ensure nextDouble() isn't 0. [all...] |
/libcore/benchmarks/src/benchmarks/ |
XmlSerializeBenchmark.java | 57 while(r.nextDouble() < contChance) { 58 while(level > 0 && r.nextDouble() < levelUpChance) { 62 while(r.nextDouble() < levelDownChance) { 68 while(r.nextDouble() < attributeChance) { 73 while(r.nextDouble() < writeChance1) 75 while(r.nextDouble() < writeChance2)
|
/libcore/ojluni/src/main/java/java/util/ |
PrimitiveIterator.java | 241 double nextDouble(); 253 * action.accept(nextDouble()); 262 action.accept(nextDouble()); 269 * {@link #nextDouble()}, and returns that boxed result. 275 return nextDouble();
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/ |
ChoiceFormatTest.java | 30 double[] limits = new double[] { 0, 1, ChoiceFormat.nextDouble(1), 31 ChoiceFormat.nextDouble(2) }; 150 double[] choiceLimits = { -1, 0, 1, ChoiceFormat.nextDouble(1) }; 179 choiceLimits[0] = ChoiceFormat.nextDouble(-1); 216 double[] orangeLimits = { -2, 0, ChoiceFormat.nextDouble(0), 1, 2 }; 331 * @tests java.text.ChoiceFormat#nextDouble(double) 334 // Test for method double java.text.ChoiceFormat.nextDouble(double) 335 assertTrue("Not greater 5", ChoiceFormat.nextDouble(5) > 5); 336 assertTrue("Not greater 0", ChoiceFormat.nextDouble(0) > 0); 337 assertTrue("Not greater -5", ChoiceFormat.nextDouble(-5) > -5) [all...] |
/cts/tests/tests/util/src/android/util/cts/ |
JsonReaderTest.java | 205 assertEquals(1.0, reader.nextDouble()); 228 assertEquals(-0.0, reader.nextDouble()); 229 assertEquals(1.0, reader.nextDouble()); 230 assertEquals(1.7976931348623157E308, reader.nextDouble()); 231 assertEquals(4.9E-324, reader.nextDouble()); 232 assertEquals(0.0, reader.nextDouble()); 233 assertEquals(-0.5, reader.nextDouble()); 234 assertEquals(2.2250738585072014E-308, reader.nextDouble()); 235 assertEquals(3.141592653589793, reader.nextDouble()); 236 assertEquals(2.718281828459045, reader.nextDouble()); [all...] |
/external/apache-commons-math/src/main/java/org/apache/commons/math/genetics/ |
RandomKeyMutation.java | 52 newRepr.set(rInd, GeneticAlgorithm.getRandomGenerator().nextDouble());
|
GeneticAlgorithm.java | 152 if (randGen.nextDouble() < getCrossoverRate()) { 158 if (randGen.nextDouble() < getMutationRate()) {
|
/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/filters/ |
FilterCropRepresentation.java | 168 mCrop.left = (float) reader.nextDouble(); 170 mCrop.top = (float) reader.nextDouble(); 172 mCrop.right = (float) reader.nextDouble(); 174 mCrop.bottom = (float) reader.nextDouble();
|
FilterVignetteRepresentation.java | 217 mCenterX = (float) sreader.nextDouble(); 219 mCenterY = (float) sreader.nextDouble(); 221 mRadiusX = (float) sreader.nextDouble(); 223 mRadiusY = (float) sreader.nextDouble();
|
FilterCurvesRepresentation.java | 156 float x = (float) sreader.nextDouble(); 158 float y = (float) sreader.nextDouble();
|
/libcore/jsr166-tests/src/test/java/jsr166/ |
ThreadLocalRandomTest.java | 104 * Repeated calls to nextDouble produce at least two distinct results 107 double f = ThreadLocalRandom.current().nextDouble(); 109 while (i < NCALLS && ThreadLocalRandom.current().nextDouble() == f) 269 * nextDouble(non-positive) throws IllegalArgumentException 282 rnd.nextDouble(bound); 289 * nextDouble(least, bound) returns least <= value < bound; 295 double f = ThreadLocalRandom.current().nextDouble(least, bound); 300 (j = ThreadLocalRandom.current().nextDouble(least, bound)) == f) {
|
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ |
DoublePrimitiveOpsTests.java | 60 double[] content = DoubleStream.generate(() -> r.nextDouble()).limit(10).toArray(); 78 double[] content = DoubleStream.generate(() -> r.nextDouble()).limit(10).toArray();
|
/cts/tests/tests/keystore/src/android/keystore/cts/ |
CountingSecureRandom.java | 77 public double nextDouble() {
|
/external/guava/guava-tests/test/com/google/common/math/ |
MathBenchmarking.java | 110 double result = RANDOM_SOURCE.nextDouble();
|
/libcore/ojluni/src/main/java/java/text/ |
ChoiceFormat.java | 79 * <em>limits</em> = {0, 1, ChoiceFormat.nextDouble(1)}<br> 81 * (<code>nextDouble</code> can be used to get the next higher double, to 218 startValue = nextDouble(startValue); 440 public static final double nextDouble (double d) { 441 return nextDouble(d,true); 447 * @see #nextDouble 450 return nextDouble(d,false); 527 private static double nextDouble (double d, boolean positive) { 564 public static double nextDouble (double d, boolean positive) {
|
/external/crcalc/tests/src/com/hp/creals/ |
SlowCRTest.java | 185 double d = Math.exp(2.0 * r.nextDouble() - 1.0); 192 double d = Math.exp(200.0 * r.nextDouble()); 213 double d = Math.exp(10.0 * r.nextDouble() - 1.0); 220 double d = Math.exp(200.0 * r.nextDouble()); 232 double d = Math.exp(10.0 * r.nextDouble() - 1.0); 239 double d = Math.exp(600.0 * r.nextDouble());
|
/external/icu/android_icu4j/src/main/tests/android/icu/dev/util/ |
Pick.java | 62 private double nextDouble() { 63 return random.nextDouble(); 216 items[weightedIndex.toIndex(target.nextDouble())].addTo(target); 270 for (int i = weightedIndex.toIndex(target.nextDouble()); i > 0; --i) { 363 int c = choice.toIndex(target.nextDouble()); 693 return start + (int)(random.nextDouble() * (end + 1 - start)); 697 return start + (random.nextDouble() * (end + 1 - start)); 701 return random.nextDouble() <= percent; 787 return start + (int)(spread.spread(random.nextDouble()) * (end + 1 - start));
|
/external/icu/icu4j/main/tests/framework/src/com/ibm/icu/dev/util/ |
Pick.java | 61 private double nextDouble() { 62 return random.nextDouble(); 215 items[weightedIndex.toIndex(target.nextDouble())].addTo(target); 269 for (int i = weightedIndex.toIndex(target.nextDouble()); i > 0; --i) { 362 int c = choice.toIndex(target.nextDouble()); 692 return start + (int)(random.nextDouble() * (end + 1 - start)); 696 return start + (random.nextDouble() * (end + 1 - start)); 700 return random.nextDouble() <= percent; 786 return start + (int)(spread.spread(random.nextDouble()) * (end + 1 - start));
|
/libcore/luni/src/test/java/libcore/java/util/ |
RandomTest.java | 201 rands[i] = rand.nextDouble(); 214 rands[i] = rand.nextDouble(); 234 double r = rand.nextDouble() * (bound - origin) + origin; 257 double r = rand.nextDouble() * (bound - origin) + origin;
|