当前位置: 首页>>代码示例>>C#>>正文


C# Hypergeometric类代码示例

本文整理汇总了C#中Hypergeometric的典型用法代码示例。如果您正苦于以下问题:C# Hypergeometric类的具体用法?C# Hypergeometric怎么用?C# Hypergeometric使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Hypergeometric类属于命名空间,在下文中一共展示了Hypergeometric类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CanCreateHypergeometric

 public void CanCreateHypergeometric(int population, int success, int draws)
 {
     var d = new Hypergeometric(population, success, draws);
     Assert.AreEqual(population, d.Population);
     Assert.AreEqual(success, d.Success);
     Assert.AreEqual(draws, d.Draws);
 }
开发者ID:nakamoton,项目名称:mathnet-numerics,代码行数:7,代码来源:HypergeometricTests.cs

示例2: CanCreateHypergeometric

 public void CanCreateHypergeometric(int size, int m, int n)
 {
     var d = new Hypergeometric(size, m, n);
     Assert.AreEqual(size, d.PopulationSize);
     Assert.AreEqual(m, d.M);
     Assert.AreEqual(n, d.N);
 }
开发者ID:hickford,项目名称:mathnet-numerics-native,代码行数:7,代码来源:HypergeometricTests.cs

示例3: CanCreateHypergeometric

 public void CanCreateHypergeometric([Values(0, 1, 2, 2, 10, 10)] int size, [Values(0, 1, 1, 2, 1, 5)] int m, [Values(0, 1, 1, 2, 1, 3)] int n)
 {
     var d = new Hypergeometric(size, m, n);
     Assert.AreEqual(size, d.PopulationSize);
     Assert.AreEqual(m, d.M);
     Assert.AreEqual(n, d.N);
 }
开发者ID:KeithVanderzanden,项目名称:mmbot,代码行数:7,代码来源:HypergeometricTests.cs

示例4: CanCreateHypergeometric

 public void CanCreateHypergeometric(int N, int m, int n)
 {
     var d = new Hypergeometric(N, m, n);
     Assert.AreEqual<double>(N, d.PopulationSize);
     Assert.AreEqual<double>(m, d.M);
     Assert.AreEqual<double>(n, d.N);
 }
开发者ID:xmap2008,项目名称:mathnet-numerics,代码行数:7,代码来源:HypergeometricTests.cs

示例5: SetSuccessFails

 public void SetSuccessFails(int success)
 {
     var d = new Hypergeometric(10, 1, 1);
     Assert.Throws<ArgumentOutOfRangeException>(() => d.Success = success);
 }
开发者ID:nakamoton,项目名称:mathnet-numerics,代码行数:5,代码来源:HypergeometricTests.cs

示例6: SetPopulationFails

 public void SetPopulationFails(int population)
 {
     var d = new Hypergeometric(10, 1, 1);
     Assert.Throws<ArgumentOutOfRangeException>(() => d.Population = population);
 }
开发者ID:nakamoton,项目名称:mathnet-numerics,代码行数:5,代码来源:HypergeometricTests.cs

示例7: ValidateEntropy

 public void ValidateEntropy()
 {
     var d = new Hypergeometric(10, 1, 1);
     var e = d.Entropy;
 }
开发者ID:xmap2008,项目名称:mathnet-numerics,代码行数:5,代码来源:HypergeometricTests.cs

示例8: ValidateToString

 public void ValidateToString()
 {
     var d = new Hypergeometric(10, 1, 1);
     Assert.AreEqual("Hypergeometric(N = 10, M = 1, n = 1)", d.ToString());
 }
开发者ID:nakamoton,项目名称:mathnet-numerics,代码行数:5,代码来源:HypergeometricTests.cs

示例9: ValidateProbabilityLn

 public void ValidateProbabilityLn(int population, int success, int draws, int x)
 {
     var d = new Hypergeometric(population, success, draws);
     Assert.AreEqual(Math.Log(d.Probability(x)), d.ProbabilityLn(x));
 }
开发者ID:nakamoton,项目名称:mathnet-numerics,代码行数:5,代码来源:HypergeometricTests.cs

示例10: ValidateMode

 public void ValidateMode(int population, int success, int draws)
 {
     var d = new Hypergeometric(population, success, draws);
     Assert.AreEqual((draws + 1)*(success + 1)/(population + 2), d.Mode);
 }
开发者ID:nakamoton,项目名称:mathnet-numerics,代码行数:5,代码来源:HypergeometricTests.cs

示例11: ValidateMedianThrowsNotSupportedException

 public void ValidateMedianThrowsNotSupportedException()
 {
     var d = new Hypergeometric(10, 1, 1);
     Assert.Throws<NotSupportedException>(() => { var m = d.Median; });
 }
开发者ID:nakamoton,项目名称:mathnet-numerics,代码行数:5,代码来源:HypergeometricTests.cs

示例12: ValidateSkewness

 public void ValidateSkewness(int N, int m, int n)
 {
     var d = new Hypergeometric(N, m, n);
     Assert.AreEqual<double>((Math.Sqrt(N - 1.0) * (N - 2 * n) * (N - 2 * m)) / (Math.Sqrt(n * m * (N - m) * (N - n)) * (N - 2.0)), d.Skewness);
 }
开发者ID:xmap2008,项目名称:mathnet-numerics,代码行数:5,代码来源:HypergeometricTests.cs

示例13: ValidateProbabilityLn

 public void ValidateProbabilityLn(int N, int m, int n, int x)
 {
     var d = new Hypergeometric(N, m, n);
     Assert.AreEqual(Math.Log(d.Probability(x)), d.ProbabilityLn(x));
 }
开发者ID:xmap2008,项目名称:mathnet-numerics,代码行数:5,代码来源:HypergeometricTests.cs

示例14: ValidateProbability

 public void ValidateProbability(int N, int m, int n, int x)
 {
     var d = new Hypergeometric(N, m, n);
     Assert.AreEqual<double>(SpecialFunctions.Binomial(m, x) * SpecialFunctions.Binomial(N - m, n - x) / SpecialFunctions.Binomial(N, n), d.Probability(x));
 }
开发者ID:xmap2008,项目名称:mathnet-numerics,代码行数:5,代码来源:HypergeometricTests.cs

示例15: ValidateMode

 public void ValidateMode(int N, int m, int n)
 {
     var d = new Hypergeometric(N, m, n);
     Assert.AreEqual<double>((n + 1) * (m + 1) / (N + 2), d.Mode);
 }
开发者ID:xmap2008,项目名称:mathnet-numerics,代码行数:5,代码来源:HypergeometricTests.cs


注:本文中的Hypergeometric类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。