C# 클래스 Redzen.Numerics.NumericsUtils

파일 보기 프로젝트 열기: colgreen/Redzen

공개 메소드들

메소드 설명
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