getNearestSetSize

fun getNearestSetSize(maxNumberOfBits: Int): Int

Rounds down required maxNumberOfBits to the nearest number that is made up of all ones as a binary number. Use this method where controlling memory use is paramount.


fun getNearestSetSize(maxNumberOfValuesExpected: Int, desiredSaturation: Float): Int

Use this method to choose a set size where accuracy (low content saturation) is more important than deciding how much memory to throw at the problem.

Return

The size of the set nearest to the required size

Parameters

desiredSaturation

A number between 0 and 1 expressing the % of bits set once all values have been recorded