Home
last modified time | relevance | path

Searched refs:IntMath (Results 1 – 25 of 61) sorted by relevance

123

/external/guava/android/guava-tests/test/com/google/common/math/
DIntMathTest.java49 assertTrue(IntMath.isPowerOfTwo(IntMath.MAX_SIGNED_POWER_OF_TWO)); in testMaxSignedPowerOfTwo()
52 long value = IntMath.MAX_SIGNED_POWER_OF_TWO * 2L; in testMaxSignedPowerOfTwo()
53 assertFalse(IntMath.isPowerOfTwo((int) value)); in testMaxSignedPowerOfTwo()
60 assertEquals(expectedResult.intValue(), IntMath.ceilingPowerOfTwo(x)); in testCeilingPowerOfTwo()
63 IntMath.ceilingPowerOfTwo(x); in testCeilingPowerOfTwo()
74 assertEquals(expectedResult.intValue(), IntMath.floorPowerOfTwo(x)); in testFloorPowerOfTwo()
81 IntMath.ceilingPowerOfTwo(x); in testCeilingPowerOfTwoNegative()
91 IntMath.floorPowerOfTwo(x); in testFloorPowerOfTwoNegative()
100 IntMath.ceilingPowerOfTwo(0); in testCeilingPowerOfTwoZero()
108 IntMath.floorPowerOfTwo(0); in testFloorPowerOfTwoZero()
[all …]
/external/guava/guava-tests/test/com/google/common/math/
DIntMathTest.java49 assertTrue(IntMath.isPowerOfTwo(IntMath.MAX_SIGNED_POWER_OF_TWO)); in testMaxSignedPowerOfTwo()
52 long value = IntMath.MAX_SIGNED_POWER_OF_TWO * 2L; in testMaxSignedPowerOfTwo()
53 assertFalse(IntMath.isPowerOfTwo((int) value)); in testMaxSignedPowerOfTwo()
60 assertEquals(expectedResult.intValue(), IntMath.ceilingPowerOfTwo(x)); in testCeilingPowerOfTwo()
63 IntMath.ceilingPowerOfTwo(x); in testCeilingPowerOfTwo()
74 assertEquals(expectedResult.intValue(), IntMath.floorPowerOfTwo(x)); in testFloorPowerOfTwo()
81 IntMath.ceilingPowerOfTwo(x); in testCeilingPowerOfTwoNegative()
91 IntMath.floorPowerOfTwo(x); in testFloorPowerOfTwoNegative()
100 IntMath.ceilingPowerOfTwo(0); in testCeilingPowerOfTwoZero()
108 IntMath.floorPowerOfTwo(0); in testFloorPowerOfTwoZero()
[all …]
/external/guava/guava-tests/benchmark/com/google/common/math/
DIntMathBenchmark.java59 tmp += IntMath.pow(positive[j], exponent[j]); in pow()
69 tmp += IntMath.mod(ints[j], positive[j]); in mod()
79 tmp += IntMath.gcd(nonnegative[j], positive[j]); in gCD()
89 tmp += IntMath.factorial(factorial[j]); in factorial()
99 tmp += IntMath.binomial(factorial[j], binomial[j]); in binomial()
109 if (IntMath.isPrime(positive[j])) { in isPrime()
DIntMathRoundingBenchmark.java57 tmp += IntMath.log2(positive[j], mode); in log2()
67 tmp += IntMath.log10(positive[j], mode); in log10()
77 tmp += IntMath.sqrt(positive[j], mode); in sqrt()
87 tmp += IntMath.divide(ints[j], nonzero[j], mode); in divide()
DApacheBenchmark.java46 return IntMath.gcd(a, b); in gcdInt()
62 int unused = IntMath.checkedAdd(a, b); in noAddOverflow()
82 int unused = IntMath.checkedMultiply(a, b); in noMulOverflow()
/external/guava/android/guava-tests/benchmark/com/google/common/math/
DIntMathBenchmark.java59 tmp += IntMath.pow(positive[j], exponent[j]); in pow()
69 tmp += IntMath.mod(ints[j], positive[j]); in mod()
79 tmp += IntMath.gcd(nonnegative[j], positive[j]); in gCD()
89 tmp += IntMath.factorial(factorial[j]); in factorial()
99 tmp += IntMath.binomial(factorial[j], binomial[j]); in binomial()
109 if (IntMath.isPrime(positive[j])) { in isPrime()
DIntMathRoundingBenchmark.java57 tmp += IntMath.log2(positive[j], mode); in log2()
67 tmp += IntMath.log10(positive[j], mode); in log10()
77 tmp += IntMath.sqrt(positive[j], mode); in sqrt()
87 tmp += IntMath.divide(ints[j], nonzero[j], mode); in divide()
DApacheBenchmark.java46 return IntMath.gcd(a, b); in gcdInt()
62 int unused = IntMath.checkedAdd(a, b); in noAddOverflow()
82 int unused = IntMath.checkedMultiply(a, b); in noMulOverflow()
/external/guava/guava-tests/benchmark/com/google/common/collect/
DImmutableSetHashFloodingDetectionBenchmark.java22 import com.google.common.math.IntMath;
58 return 12 * IntMath.log2(tableSize, RoundingMode.UNNECESSARY); in maxRunBeforeFallback()
98 return 13 * IntMath.log2(tableSize, RoundingMode.UNNECESSARY); in maxRunBeforeFallback()
146 return 13 * IntMath.log2(tableSize, RoundingMode.UNNECESSARY); in maxRunBeforeFallback()
/external/guava/android/guava/src/com/google/common/collect/
DCollections2.java28 import com.google.common.math.IntMath;
443 permutations = IntMath.saturatedMultiply(permutations, IntMath.binomial(n, r)); in calculateSize()
452 return IntMath.saturatedMultiply(permutations, IntMath.binomial(n, r)); in calculateSize()
583 return IntMath.factorial(inputList.size()); in size()
DTopKSelector.java24 import com.google.common.math.IntMath;
127 this.buffer = (T[]) new Object[IntMath.checkedMultiply(k, 2)]; in TopKSelector()
172 int maxIterations = IntMath.log2(right - left, RoundingMode.CEILING) * 3; in trim()
DCartesianList.java22 import com.google.common.math.IntMath;
59 axesSizeProduct[i] = IntMath.checkedMultiply(axesSizeProduct[i + 1], axes.get(i).size()); in CartesianList()
/external/guava/guava/src/com/google/common/collect/
DCollections2.java28 import com.google.common.math.IntMath;
466 permutations = IntMath.saturatedMultiply(permutations, IntMath.binomial(n, r)); in calculateSize()
475 return IntMath.saturatedMultiply(permutations, IntMath.binomial(n, r)); in calculateSize()
606 return IntMath.factorial(inputList.size()); in size()
DTopKSelector.java24 import com.google.common.math.IntMath;
128 this.buffer = (T[]) new Object[IntMath.checkedMultiply(k, 2)]; in TopKSelector()
173 int maxIterations = IntMath.log2(right - left, RoundingMode.CEILING) * 3; in trim()
DCartesianList.java22 import com.google.common.math.IntMath;
59 axesSizeProduct[i] = IntMath.checkedMultiply(axesSizeProduct[i + 1], axes.get(i).size()); in CartesianList()
/external/exoplayer/tree_15dc86382f17a24a3e881e52e31a810c1ea44b49/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/
DRtpPacket.java26 import com.google.common.math.IntMath;
138 return IntMath.mod(sequenceNumber + 1, MAX_SEQUENCE_NUMBER + 1); in getNextSequenceNumber()
143 return IntMath.mod(sequenceNumber - 1, MAX_SEQUENCE_NUMBER + 1); in getPreviousSequenceNumber()
/external/guava/guava/src/com/google/common/graph/
DAbstractBaseGraph.java30 import com.google.common.math.IntMath;
140 return IntMath.saturatedAdd(predecessors(node).size(), successors(node).size());
144 return IntMath.saturatedAdd(neighbors.size(), selfLoopCount);
DAbstractDirectedNetworkConnections.java29 import com.google.common.math.IntMath;
79 return IntMath.saturatedAdd(inEdgeMap.size(), outEdgeMap.size() - selfLoopCount); in incidentEdges()
DAbstractNetwork.java34 import com.google.common.math.IntMath;
145 return IntMath.saturatedAdd(inEdges(node).size(), outEdges(node).size());
147 return IntMath.saturatedAdd(incidentEdges(node).size(), edgesConnecting(node, node).size());
/external/guava/android/guava/src/com/google/common/graph/
DAbstractBaseGraph.java30 import com.google.common.math.IntMath;
140 return IntMath.saturatedAdd(predecessors(node).size(), successors(node).size());
144 return IntMath.saturatedAdd(neighbors.size(), selfLoopCount);
DAbstractDirectedNetworkConnections.java29 import com.google.common.math.IntMath;
79 return IntMath.saturatedAdd(inEdgeMap.size(), outEdgeMap.size() - selfLoopCount); in incidentEdges()
DAbstractNetwork.java34 import com.google.common.math.IntMath;
144 return IntMath.saturatedAdd(inEdges(node).size(), outEdges(node).size());
146 return IntMath.saturatedAdd(incidentEdges(node).size(), edgesConnecting(node, node).size());
/external/exoplayer/tree_8e57d3715f9092d5ec54ebe2e538f34bfcc34479/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/
DRtpPacket.java26 import com.google.common.math.IntMath;
138 return IntMath.mod(sequenceNumber + 1, MAX_SEQUENCE_NUMBER + 1); in getNextSequenceNumber()
143 return IntMath.mod(sequenceNumber - 1, MAX_SEQUENCE_NUMBER + 1); in getPreviousSequenceNumber()
/external/guava/guava-tests/test/com/google/common/collect/
DTopKSelectorTest.java22 import com.google.common.math.IntMath;
122 assertThat(compareCalls[0]).isAtMost(10L * n * IntMath.log2(k, RoundingMode.CEILING)); in testWorstCase()
/external/guava/android/guava-tests/test/com/google/common/collect/
DTopKSelectorTest.java22 import com.google.common.math.IntMath;
122 assertThat(compareCalls[0]).isAtMost(10L * n * IntMath.log2(k, RoundingMode.CEILING)); in testWorstCase()

123