DiscreteDistribution
public protocol DiscreteDistribution
Protocol for discrete distributions.
Defines the quantile() method that must be implemented.
-
Undocumented
Declaration
Swift
func quantile(_ p: Double) -> Int
-
random(using:)Extension methodSingle discrete random value using a user-provided random number generator
Declaration
Swift
public func random<T>(using generator: inout T) -> Int where T : RandomNumberGeneratorParameters
usingA random number generator
Return Value
A random number from the distribution represented by the instance
-
random()Extension methodSingle discrete random value using the system random number generator
Declaration
Swift
public func random() -> IntReturn Value
A random number from the distribution represented by the instance
-
random(_:)Extension methodArray of discrete random values
Complexity
O(n)Declaration
Swift
public func random(_ n: Int) -> [Int]Parameters
nnumber of values to produce
DiscreteDistribution Protocol Reference