- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 115 for nextInt (0.09 sec)
-
android/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java
int factorialBound; @BeforeExperiment void setUp() { for (int i = 0; i < ARRAY_SIZE; i++) { factorials[i] = RANDOM_SOURCE.nextInt(factorialBound); slowFactorials[i] = RANDOM_SOURCE.nextInt(factorialBound); binomials[i] = RANDOM_SOURCE.nextInt(factorials[i] + 1); } } /** Previous version of BigIntegerMath.factorial, kept for timing purposes. */
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Aug 19 16:21:24 UTC 2024 - 3.4K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/math/ApacheBenchmark.java
} } while (!Impl.GUAVA.noMulOverflow(longsToMul[i][0], longsToMul[i][1])); int k = binomials[i][1] = RANDOM_SOURCE.nextInt(MathBenchmarking.biggestBinomials.length); binomials[i][0] = RANDOM_SOURCE.nextInt(MathBenchmarking.biggestBinomials[k] - k) + k; } } @Benchmark long factorialDouble(int reps) { long tmp = 0; for (int i = 0; i < reps; i++) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 6.9K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/math/LongMathBenchmark.java
longs[i] = RANDOM_SOURCE.nextLong(); factorialArguments[i] = RANDOM_SOURCE.nextInt(30); binomialArguments[i][1] = RANDOM_SOURCE.nextInt(MathBenchmarking.biggestBinomials.length); int k = binomialArguments[i][1]; binomialArguments[i][0] = RANDOM_SOURCE.nextInt(MathBenchmarking.biggestBinomials[k] - k) + k; } } @Benchmark int pow(int reps) { int tmp = 0;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 3.5K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java
assertEquals(-1L, map.get(key)); } public void testAddAndGet() { AtomicLongMap<String> map = AtomicLongMap.create(); String key = "key"; long addend = random.nextInt(MAX_ADDEND); for (int i = 0; i < ITERATIONS; i++) { long before = map.get(key); long result = map.addAndGet(key, addend); long after = map.get(key); assertEquals(before + addend, after);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Feb 13 14:28:25 UTC 2024 - 17.4K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/base/WhitespaceMatcherBenchmark.java
result[i] = allMatchingChars.charAt(random.nextInt(allMatchingChars.length())); } // Replace some of chars by non-matching. int remaining = (int) ((100 - percentMatching) * result.length / 100.0 + 0.5); while (remaining > 0) { final char c = (char) random.nextInt(); if (bitSet.get(c)) { final int pos = random.nextInt(result.length); if (bitSet.get(result[pos])) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed May 16 22:49:59 UTC 2018 - 3.9K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/base/WhitespaceMatcherBenchmark.java
result[i] = allMatchingChars.charAt(random.nextInt(allMatchingChars.length())); } // Replace some of chars by non-matching. int remaining = (int) ((100 - percentMatching) * result.length / 100.0 + 0.5); while (remaining > 0) { final char c = (char) random.nextInt(); if (bitSet.get(c)) { final int pos = random.nextInt(result.length); if (bitSet.get(result[pos])) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed May 16 22:49:59 UTC 2018 - 3.9K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java
int factorialBound; @BeforeExperiment void setUp() { for (int i = 0; i < ARRAY_SIZE; i++) { factorials[i] = RANDOM_SOURCE.nextInt(factorialBound); slowFactorials[i] = RANDOM_SOURCE.nextInt(factorialBound); binomials[i] = RANDOM_SOURCE.nextInt(factorials[i] + 1); } } /** Previous version of BigIntegerMath.factorial, kept for timing purposes. */
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Aug 19 16:21:24 UTC 2024 - 3.4K bytes - Viewed (0) -
guava-tests/test/com/google/common/math/MathBenchmarking.java
double result = RANDOM_SOURCE.nextDouble(); result = Math.scalb(result, RANDOM_SOURCE.nextInt(maxExponent + 1)); return RANDOM_SOURCE.nextBoolean() ? result : -result; } /** Returns a random integer between zero and {@code MAX_EXPONENT}. */ static int randomExponent() { return RANDOM_SOURCE.nextInt(MAX_EXPONENT + 1); } static double randomPositiveDouble() {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 4.1K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/graph/NetworkMutationTest.java
assertThat(network.nodes()).isEmpty(); assertThat(network.edges()).isEmpty(); AbstractNetworkTest.validateNetwork(network); while (network.nodes().size() < NUM_NODES) { network.addNode(gen.nextInt(NODE_POOL_SIZE)); } ArrayList<Integer> nodeList = new ArrayList<>(network.nodes()); for (int i = 0; i < NUM_EDGES; ++i) { // Parallel edges are allowed, so this should always succeed.
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Apr 10 19:42:18 UTC 2024 - 4.5K bytes - Viewed (0) -
guava-tests/test/com/google/common/graph/GraphMutationTest.java
assertThat(graph.nodes()).isEmpty(); assertThat(graph.edges()).isEmpty(); AbstractGraphTest.validateGraph(graph); while (graph.nodes().size() < NUM_NODES) { graph.addNode(gen.nextInt(NODE_POOL_SIZE)); } ArrayList<Integer> nodeList = new ArrayList<>(graph.nodes()); while (graph.edges().size() < NUM_EDGES) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Aug 18 16:17:46 UTC 2017 - 4.2K bytes - Viewed (0)