Class IntCompactModifications
java.lang.Object
io.deephaven.engine.table.impl.by.ssmcountdistinct.compactmodifications.IntCompactModifications
Reduces a parallel pair of "removed" (pre-modify) and "added" (post-modify) value runs to the net change required of
a
SegmentedSortedMultiSet: values that were both
removed and added in equal quantity cancel out, leaving only the net removals in removedValues and the net
additions in addedValues.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcompactAndCountModifications(WritableIntChunk<? extends Values> removedValues, WritableIntChunk<ChunkLengths> removedCounts, WritableIntChunk<? extends Values> addedValues, WritableIntChunk<ChunkLengths> addedCounts, int removedStart, int removedLength, int addedStart, int addedLength, boolean countNull, boolean countNaN, MutableInt removedSize, MutableInt addedSize) Diff theremovedLengthremoved values beginning atremovedStartagainst theaddedLengthadded values beginning ataddedStart: values that were both removed and added in equal quantity cancel out.
-
Constructor Details
-
IntCompactModifications
public IntCompactModifications()
-
-
Method Details
-
compactAndCountModifications
public static void compactAndCountModifications(WritableIntChunk<? extends Values> removedValues, WritableIntChunk<ChunkLengths> removedCounts, WritableIntChunk<? extends Values> addedValues, WritableIntChunk<ChunkLengths> addedCounts, int removedStart, int removedLength, int addedStart, int addedLength, boolean countNull, boolean countNaN, MutableInt removedSize, MutableInt addedSize) Diff theremovedLengthremoved values beginning atremovedStartagainst theaddedLengthadded values beginning ataddedStart: values that were both removed and added in equal quantity cancel out. After the callremovedValues/removedCountshold the net removals compacted to distinct values beginning atremovedStart, andaddedValues/addedCountshold the net additions compacted to distinct values beginning ataddedStart; the surviving lengths are returned viaremovedSize/addedSize. The chunk sizes are left unchanged so the inputs may be sub-ranges of larger shared chunks (the removed and added ranges may have different starts and lengths, e.g. when each side is a separately-flattened run of child deltas).- Parameters:
removedValues- the removed values; receives the net removalsremovedCounts- receives the count removed for each surviving net removaladdedValues- the added values; receives the net additionsaddedCounts- receives the count added for each surviving net additionremovedStart- the first position to process in the removed chunkremovedLength- the number of positions to process in the removed chunkaddedStart- the first position to process in the added chunkaddedLength- the number of positions to process in the added chunkcountNull- whether null is a countable valuecountNaN- whether NaN is a countable valueremovedSize- set to the number of surviving net removalsaddedSize- set to the number of surviving net additions
-