Method | Description | |
---|---|---|
DrawBinarySearch ( ) : int |
Draw a random integer from {0, .., n-1} according to previously supplied probability distribution. Time-complexity is O(log(n)), where n is the length of the probabilities-array supplied to CreateIndexDistribution(). Use this function if you make repeated draws from the same set and the set-size is large.
|
|
DrawLinearSearch ( ) : int |
Draw a random integer from {0, .., n-1} according to previously supplied probability distribution. Time-complexity is O(n), where n is the length of the probabilities-array supplied to CreateIndexDistribution(). Use this function if you make repeated draws from the same set and the set-size is small.
|
|
IndexDistribution ( |
Create the object. Time-complexity for doing this is O(n), where n is the length of the probabilities-array.
|
public IndexDistribution ( |
||
rand | RNG object to use. | |
probabilities | double | Probability distribution. |