- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 11 for biggestBinomials (0.47 sec)
-
android/guava-tests/test/com/google/common/math/MathBenchmarking.java
static final int MAX_EXPONENT = 100; /* * Duplicated from LongMath. * binomial(biggestBinomials[k], k) fits in a long, but not * binomial(biggestBinomials[k] + 1, k). */ static final int[] biggestBinomials = { Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, 3810779, 121977, 16175, 4337, 1733, 887,
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 4.1K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/math/LongMathBenchmark.java
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; 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 - 3.5K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/math/LongMathBenchmark.java
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; 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 - 3.5K bytes - Viewed (0) -
guava-tests/test/com/google/common/math/MathBenchmarking.java
static final int MAX_EXPONENT = 100; /* * Duplicated from LongMath. * binomial(biggestBinomials[k], k) fits in a long, but not * binomial(biggestBinomials[k] + 1, k). */ static final int[] biggestBinomials = { Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, 3810779, 121977, 16175, 4337, 1733, 887,
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/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/test/com/google/common/math/IntMathTest.java
} public void testConstantsBiggestBinomials() { for (int k = 0; k < IntMath.biggestBinomials.length; k++) { assertTrue(fitsInInt(BigIntegerMath.binomial(IntMath.biggestBinomials[k], k))); assertTrue( IntMath.biggestBinomials[k] == Integer.MAX_VALUE || !fitsInInt(BigIntegerMath.binomial(IntMath.biggestBinomials[k] + 1, k)));
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 23.1K bytes - Viewed (0) -
guava-tests/test/com/google/common/math/LongMathTest.java
public void testConstantsBiggestBinomials() { for (int k = 0; k < LongMath.biggestBinomials.length; k++) { assertTrue(fitsInLong(BigIntegerMath.binomial(LongMath.biggestBinomials[k], k))); assertTrue( LongMath.biggestBinomials[k] == Integer.MAX_VALUE || !fitsInLong(BigIntegerMath.binomial(LongMath.biggestBinomials[k] + 1, k)));
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 15:00:32 UTC 2024 - 30.6K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/math/IntMathTest.java
} public void testConstantsBiggestBinomials() { for (int k = 0; k < IntMath.biggestBinomials.length; k++) { assertTrue(fitsInInt(BigIntegerMath.binomial(IntMath.biggestBinomials[k], k))); assertTrue( IntMath.biggestBinomials[k] == Integer.MAX_VALUE || !fitsInInt(BigIntegerMath.binomial(IntMath.biggestBinomials[k] + 1, k)));
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 23.1K bytes - Viewed (0) -
guava/src/com/google/common/math/LongMath.java
// so denominator must be a divisor of numerator. return x * (numerator / denominator); } /* * binomial(biggestBinomials[k], k) fits in a long, but not binomial(biggestBinomials[k] + 1, k). */ static final int[] biggestBinomials = { Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, 3810779, 121977, 16175, 4337, 1733,
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 09 16:39:37 UTC 2024 - 45.2K bytes - Viewed (0) -
guava/src/com/google/common/math/BigIntegerMath.java
checkNonNegative("n", n); checkNonNegative("k", k); checkArgument(k <= n, "k (%s) > n (%s)", k, n); if (k > (n >> 1)) { k = n - k; } if (k < LongMath.biggestBinomials.length && n <= LongMath.biggestBinomials[k]) { return BigInteger.valueOf(LongMath.binomial(n, k)); } BigInteger accum = BigInteger.ONE; long numeratorAccum = n; long denominatorAccum = 1;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 16 17:21:56 UTC 2024 - 18.8K bytes - Viewed (0)