public static int compareUnsigned(long leftRawLow, long leftRawHigh, long rightRawLow, long rightRawHigh) { if (leftRawHigh != rightRawHigh) { return Long.compareUnsigned(leftRawHigh, rightRawHigh); } if (leftRawLow != rightRawLow) { return Long.compareUnsigned(leftRawLow, rightRawLow); } return 0; }
public static int compareUnsigned(long leftRawLow, long leftRawHigh, long rightRawLow, long rightRawHigh) { if (leftRawHigh != rightRawHigh) { return Long.compareUnsigned(leftRawHigh, rightRawHigh); } if (leftRawLow != rightRawLow) { return Long.compareUnsigned(leftRawLow, rightRawLow); } return 0; }
private static void doCheckAccess( long pointer, int size ) { long boundary = pointer + size; Allocation allocation = lastUsedAllocation.get(); if ( allocation != null ) { if ( compareUnsigned( allocation.pointer, pointer ) <= 0 && compareUnsigned( allocation.boundary, boundary ) > 0 && allocation.freeCounter == freeCounter.get() ) { return; } } Map.Entry<Long,Allocation> fentry = allocations.floorEntry( boundary ); if ( fentry == null || compareUnsigned( fentry.getValue().boundary, boundary ) < 0 ) { Map.Entry<Long,Allocation> centry = allocations.ceilingEntry( pointer ); throwBadAccess( pointer, size, fentry, centry ); } //noinspection ConstantConditions lastUsedAllocation.set( fentry.getValue() ); }
public static int compareAbsolute(Slice left, Slice right) { long leftHigh = getLong(left, 1); long rightHigh = getLong(right, 1); if (leftHigh != rightHigh) { return Long.compareUnsigned(leftHigh, rightHigh); } long leftLow = getLong(left, 0); long rightLow = getLong(right, 0); if (leftLow != rightLow) { return Long.compareUnsigned(leftLow, rightLow); } return 0; }
public static int compareAbsolute(Slice left, Slice right) { long leftHigh = getLong(left, 1); long rightHigh = getLong(right, 1); if (leftHigh != rightHigh) { return Long.compareUnsigned(leftHigh, rightHigh); } long leftLow = getLong(left, 0); long rightLow = getLong(right, 0); if (leftLow != rightLow) { return Long.compareUnsigned(leftLow, rightLow); } return 0; }
@UsedByGeneratedCode public static long divideShortShortShort(long dividend, long divisor, int rescaleFactor) { if (divisor == 0) { throw new PrestoException(DIVISION_BY_ZERO, "Division by zero"); } if (dividend == 0) { return 0; } int resultSignum = signum(dividend) * signum(divisor); long unsignedDividend = abs(dividend); long unsignedDivisor = abs(divisor); long rescaledUnsignedDividend = unsignedDividend * longTenToNth(rescaleFactor); long quotient = rescaledUnsignedDividend / unsignedDivisor; long remainder = rescaledUnsignedDividend - (quotient * unsignedDivisor); if (Long.compareUnsigned(remainder * 2, unsignedDivisor) >= 0) { quotient++; } return resultSignum * quotient; }
while (Long.compareUnsigned(rhat, INT_BASE) < 0 && Long.compareUnsigned((v0 & LONG_MASK) * qhat, combineInts(lowInt(rhat), u0)) > 0) { iterations++; qhat--;
while (Long.compareUnsigned(rhat, INT_BASE) < 0 && Long.compareUnsigned((v0 & LONG_MASK) * qhat, combineInts(lowInt(rhat), u0)) > 0) { iterations++; qhat--;
public static boolean greaterThanOrEqualTo(long a, long b) { return Long.compareUnsigned(a, b) >= 0; }
public static boolean lessThanOrEqualTo(long a, long b) { return Long.compareUnsigned(a, b) <= 0; }
if (pSize != 0 && (qSize == 0 || q == null || Long.compareUnsigned(p.morton, q.morton) <= 0)) { e = p; p = p.nextZ;
@Override public long rangeCardinality(long start, long end) { if(Long.compareUnsigned(start, end) >= 0) { return 0; } long size = 0; int startIndex = this.highLowContainer.getIndex(Util.highbits(start)); if(startIndex < 0) { startIndex = -startIndex - 1; } else { int inContainerStart = Util.toIntUnsigned(Util.lowbits(start)); if(inContainerStart != 0) { size -= this.highLowContainer .getContainerAtIndex(startIndex) .rank((short)(inContainerStart - 1)); } } short xhigh = Util.highbits(end - 1); for (int i = startIndex; i < this.highLowContainer.size(); i++) { short key = this.highLowContainer.getKeyAtIndex(i); int comparison = Util.compareUnsigned(key, xhigh); if (comparison < 0) { size += this.highLowContainer.getContainerAtIndex(i).getCardinality(); } else if (comparison == 0) { return size + this.highLowContainer .getContainerAtIndex(i).rank(Util.lowbits((int)(end - 1))); } } return size; }
@Override public long rangeCardinality(long start, long end) { if(Long.compareUnsigned(start, end) >= 0) { return 0;
private void turnoverIfNecessary(long ts, boolean force) throws IOException { long duration = ts - batchStartTime; boolean initial = outputStream == null; boolean overDuration = config.getMaxTimeNS() <= 0 ? false : Long.compareUnsigned(duration, config.getMaxTimeNS()) >= 0; boolean tooManyPackets = numWritten >= config.getNumPackets(); if(force || initial || overDuration || tooManyPackets ) {
public static long minUnsigned(long a, long b) { if (Long.compareUnsigned(a, b) < 0) { return a; } return b; }
static void p_bytePut(final long page, int index, byte v) { if (CHECK_BOUNDS && Long.compareUnsigned(index, CHECKED_PAGE_SIZE) >= 0) { throw new ArrayIndexOutOfBoundsException(index); } UNSAFE.putByte(page + index, v); }
static void p_bytePut(final long page, int index, byte v) { if (CHECK_BOUNDS && Long.compareUnsigned(index, CHECKED_PAGE_SIZE) >= 0) { throw new ArrayIndexOutOfBoundsException(index); } UNSAFE.putByte(page + index, v); }
private static void validateScoresDoNotIncreaseWithNorm(Version indexCreatedVersion, Similarity similarity) throws IOException { CollectionStatistics collectionStats = new CollectionStatistics("some_field", 1200, 1100, 3000, 2000); TermStatistics termStats = new TermStatistics(new BytesRef("some_value"), 100, 130); SimWeight simWeight = similarity.computeWeight(2f, collectionStats, termStats); SimScorer previousScorer = null; long previousNorm = 0; float previousScore = Float.POSITIVE_INFINITY; for (int length = 1; length <= 10; ++length) { FieldInvertState state = new FieldInvertState(indexCreatedVersion.luceneVersion.major, "some_field", length, length, 0, 50); // length = 20, no overlap final long norm = similarity.computeNorm(state); if (Long.compareUnsigned(previousNorm, norm) > 0) { // esoteric similarity, skip this check break; } LeafReader reader = new SingleNormLeafReader(norm); SimScorer scorer = similarity.simScorer(simWeight, reader.getContext()); float score = scorer.score(0, 1); if (score > previousScore) { DEPRECATION_LOGGER.deprecated("Similarity scores should not increase when norm increases:\n" + previousScorer.explain(0, Explanation.match(1, "term freq")) + "\n" + scorer.explain(0, Explanation.match(1, "term freq"))); break; } previousScorer = scorer; previousScore = score; previousNorm = norm; } }
@Override public int compareTo( final Unsigned128BitType t ) { final long upper1 = dataAccess.getValue( i * 2 + 1 ); final long upper2 = t.dataAccess.getValue( t.i * 2 + 1 ); final int compareUpper = Long.compareUnsigned( upper1, upper2 ); if ( compareUpper != 0 ) return compareUpper; final long lower1 = dataAccess.getValue( i * 2 ); final long lower2 = t.dataAccess.getValue( t.i * 2 ); return Long.compareUnsigned( lower1, lower2 ); }
while (p != null && Long.compareUnsigned(p.morton, minZ) >= 0 && n != null && Long.compareUnsigned(n.morton, maxZ) <= 0) { if (p.idx != ear.previous.idx && p.idx != ear.next.idx && pointInEar(p.getX(), p.getY(), ear.previous.getX(), ear.previous.getY(), ear.getX(), ear.getY(), while (p != null && Long.compareUnsigned(p.morton, minZ) >= 0) { if (p.idx != ear.previous.idx && p.idx != ear.next.idx && pointInEar(p.getX(), p.getY(), ear.previous.getX(), ear.previous.getY(), ear.getX(), ear.getY(), Long.compareUnsigned(n.morton, maxZ) <= 0) { if (n.idx != ear.previous.idx && n.idx != ear.next.idx && pointInEar(n.getX(), n.getY(), ear.previous.getX(), ear.previous.getY(), ear.getX(), ear.getY(),