C# Класс Redzen.Numerics.NumericsUtils

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

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

Метод Описание
BuildHistogramData ( double valArr, int categoryCount ) : HistogramData

Calculate a frequency distribution for the provided array of values. 1) The minimum and maximum values are found. 2) The resulting value range is divided into equal sized sub-ranges (categoryCount). 3) The number of values that fall into each category is determined.

CalculateMedian ( IList valueList ) : double

Calculates the median value in a list of sorted values.

ProbabilisticRound ( double val, XorShiftRandom rng ) : double

Rounds up or down to a whole number by using the fractional part of the input value as the probability that the value will be rounded up. This is useful if we wish to round values and then sum them without generating a rounding bias. For monetary rounding this problem is solved with rounding to e.g. the nearest even number which then causes a bias towards even numbers. This solution is more appropriate for certain types of scientific values.

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

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

Calculate a frequency distribution for the provided array of values. 1) The minimum and maximum values are found. 2) The resulting value range is divided into equal sized sub-ranges (categoryCount). 3) The number of values that fall into each category is determined.
public static BuildHistogramData ( double valArr, int categoryCount ) : HistogramData
valArr double
categoryCount int
Результат HistogramData

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

Calculates the median value in a list of sorted values.
public static CalculateMedian ( IList valueList ) : double
valueList IList
Результат double

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

Rounds up or down to a whole number by using the fractional part of the input value as the probability that the value will be rounded up. This is useful if we wish to round values and then sum them without generating a rounding bias. For monetary rounding this problem is solved with rounding to e.g. the nearest even number which then causes a bias towards even numbers. This solution is more appropriate for certain types of scientific values.
public static ProbabilisticRound ( double val, XorShiftRandom rng ) : double
val double
rng XorShiftRandom
Результат double