C# Класс CasualGodComplex.RandomExtensions

Показать файл Открыть проект

Открытые методы

Метод Описание
NormallyDistributedSingle ( this random, float standardDeviation, float mean ) : float

Generates a single value from a normal distribution, using Box-Muller https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform

NormallyDistributedSingle ( this random, float standardDeviation, float mean, float min, float max ) : float

Generates a single normal value clamped within min and max

Originally used inverse phi method, but this method, found here: http://arxiv.org/pdf/0907.4010.pdf is significantly faster

NormallyDistributedSingles ( this random, float standardDeviation, float mean ) : IEnumerable

Generates a sequence of values from a normal distribution, using Box-Muller https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform

NormallyDistributedSingles ( this random, float standardDeviation, float mean, float min, float max ) : IEnumerable

Generates a sequence of normal values clamped within min and max

Originally used inverse phi method, but this method, found here: http://arxiv.org/pdf/0907.4010.pdf is significantly faster

Описание методов

NormallyDistributedSingle() публичный статический Метод

Generates a single value from a normal distribution, using Box-Muller https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform
public static NormallyDistributedSingle ( this random, float standardDeviation, float mean ) : float
random this A (uniform) random number generator
standardDeviation float The standard deviation of the distribution
mean float The mean of the distribution
Результат float

NormallyDistributedSingle() публичный статический Метод

Generates a single normal value clamped within min and max
Originally used inverse phi method, but this method, found here: http://arxiv.org/pdf/0907.4010.pdf is significantly faster
public static NormallyDistributedSingle ( this random, float standardDeviation, float mean, float min, float max ) : float
random this A (uniform) random number generator
standardDeviation float The standard deviation of the distribution
mean float The mean of the distribution
min float The minimum allowed value (does not bias)
max float The max allowed value (does not bias)
Результат float

NormallyDistributedSingles() публичный статический Метод

Generates a sequence of values from a normal distribution, using Box-Muller https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform
public static NormallyDistributedSingles ( this random, float standardDeviation, float mean ) : IEnumerable
random this A (uniform) random number generator
standardDeviation float The standard deviation of the distribution
mean float The mean of the distribution
Результат IEnumerable

NormallyDistributedSingles() публичный статический Метод

Generates a sequence of normal values clamped within min and max
Originally used inverse phi method, but this method, found here: http://arxiv.org/pdf/0907.4010.pdf is significantly faster
public static NormallyDistributedSingles ( this random, float standardDeviation, float mean, float min, float max ) : IEnumerable
random this A (uniform) random number generator
standardDeviation float The standard deviation of the distribution
mean float The mean of the distribution
min float The minimum allowed value (does not bias)
max float The max allowed value (does not bias)
Результат IEnumerable