Method GetNearestSetSize
GetNearestSetSize(Int32)
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.
Declaration
public static int GetNearestSetSize(int maxNumberOfBits)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | maxNumberOfBits |
Returns
Type | Description |
---|---|
System.Int32 |
GetNearestSetSize(Int32, Single)
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.
Declaration
public static int GetNearestSetSize(int maxNumberOfValuesExpected, float desiredSaturation)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | maxNumberOfValuesExpected | |
System.Single | desiredSaturation | A number between 0 and 1 expressing the % of bits set once all values have been recorded. |
Returns
Type | Description |
---|---|
System.Int32 | The size of the set nearest to the required size. |