getMutable

fun getMutable(valueCount: Int, bitsPerValue: Int, acceptableOverheadRatio: Float): PackedInts.Mutable

Create a packed integer array with the given amount of values initialized to 0. the valueCount and the bitsPerValue cannot be changed after creation. All Mutables known by this factory are kept fully in RAM.

Positive values of acceptableOverheadRatio will trade space for speed by selecting a faster but potentially less memory-efficient implementation. An acceptableOverheadRatio of PackedInts.COMPACT will make sure that the most memory-efficient implementation is selected whereas PackedInts.FASTEST will make sure that the fastest implementation is selected.

Return

a mutable packed integer array

Parameters

valueCount

the number of elements

bitsPerValue

the number of bits available for any given value

acceptableOverheadRatio

an acceptable overhead ratio per value


fun getMutable(valueCount: Int, bitsPerValue: Int, format: PackedInts.Format): PackedInts.Mutable

Same as .getMutable with a pre-computed number of bits per value and format.