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


C# DiscreteUniform类代码示例

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


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

示例1: SetUpperBoundFails

 public void SetUpperBoundFails(int p)
 {
     var b = new DiscreteUniform(0, 10);
     Assert.That(() => b.UpperBound = p, Throws.ArgumentException);
 }
开发者ID:EraYaN,项目名称:EV2020,代码行数:5,代码来源:DiscreteUniformTests.cs

示例2: SetUpperBoundFails

 public void SetUpperBoundFails(int p)
 {
     var b = new DiscreteUniform(0, 10);
     Assert.Throws<ArgumentOutOfRangeException>(() => b.UpperBound = p);
 }
开发者ID:EricGT,项目名称:mathnet-numerics,代码行数:5,代码来源:DiscreteUniformTests.cs

示例3: CanCreateDiscreteUniform

 public void CanCreateDiscreteUniform(int l, int u)
 {
     var du = new DiscreteUniform(l, u);
     Assert.AreEqual(l, du.LowerBound);
     Assert.AreEqual(u, du.UpperBound);
 }
开发者ID:EricGT,项目名称:mathnet-numerics,代码行数:6,代码来源:DiscreteUniformTests.cs

示例4: SetUpperBoundFails

 public void SetUpperBoundFails(int p)
 {
     var b = new DiscreteUniform(0, 10);
     b.UpperBound = p;
 }
开发者ID:xmap2008,项目名称:mathnet-numerics,代码行数:5,代码来源:DiscreteUniformTests.cs

示例5: ValidateProbabilityLn

 public void ValidateProbabilityLn(int l, int u, int x, double dln)
 {
     var b = new DiscreteUniform(l, u);
     Assert.AreEqual(dln, b.ProbabilityLn(x));
 }
开发者ID:EricGT,项目名称:mathnet-numerics,代码行数:5,代码来源:DiscreteUniformTests.cs

示例6: CanSampleSequence

 public void CanSampleSequence()
 {
     var n = new DiscreteUniform(0, 10);
     var ied = n.Samples();
     ied.Take(5).ToArray();
 }
开发者ID:EricGT,项目名称:mathnet-numerics,代码行数:6,代码来源:DiscreteUniformTests.cs

示例7: ValidateSkewness

 public void ValidateSkewness([Values(-10, 0, 10, 20)] int l, [Values(10, 4, 20, 20)] int u)
 {
     var du = new DiscreteUniform(l, u);
     Assert.AreEqual(0.0, du.Skewness);
 }
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:5,代码来源:DiscreteUniformTests.cs

示例8: ValidateMean

 public void ValidateMean(int l, int u, int m)
 {
     var du = new DiscreteUniform(l, u);
     Assert.AreEqual(m, du.Mean);
 }
开发者ID:EricGT,项目名称:mathnet-numerics,代码行数:5,代码来源:DiscreteUniformTests.cs

示例9: SetLowerBoundFails

 public void SetLowerBoundFails([Values(11, 20)] int p)
 {
     var b = new DiscreteUniform(0, 10);
     Assert.Throws<ArgumentOutOfRangeException>(() => b.LowerBound = p);
 }
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:5,代码来源:DiscreteUniformTests.cs

示例10: ValidateEntropy

 public void ValidateEntropy([Values(-10, 0, 10, 20)] int l, [Values(10, 4, 20, 20)] int u, [Values(3.0445224377234229965005979803657054342845752874046093, 1.6094379124341003746007593332261876395256013542685181, 2.3978952727983705440619435779651292998217068539374197, 0.0)] double e)
 {
     var du = new DiscreteUniform(l, u);
     AssertHelpers.AlmostEqual(e, du.Entropy, 14);
 }
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:5,代码来源:DiscreteUniformTests.cs

示例11: CanSetUpperBound

 public void CanSetUpperBound(int p)
 {
     var b = new DiscreteUniform(0, 10);
     b.UpperBound = p;
 }
开发者ID:xmap2008,项目名称:mathnet-numerics,代码行数:5,代码来源:DiscreteUniformTests.cs

示例12: ValidateMode

 public void ValidateMode(int l, int u, int m)
 {
     var du = new DiscreteUniform(l, u);
     Assert.AreEqual<double>(m, du.Mode);
 }
开发者ID:xmap2008,项目名称:mathnet-numerics,代码行数:5,代码来源:DiscreteUniformTests.cs

示例13: ValidateMinimum

 public void ValidateMinimum()
 {
     var b = new DiscreteUniform(-10, 10);
     Assert.AreEqual<double>(-10, b.Minimum);
 }
开发者ID:xmap2008,项目名称:mathnet-numerics,代码行数:5,代码来源:DiscreteUniformTests.cs

示例14: ValidateEntropy

 public void ValidateEntropy(int l, int u, double e)
 {
     var du = new DiscreteUniform(l, u);
     AssertHelpers.AlmostEqualRelative(e, du.Entropy, 14);
 }
开发者ID:EricGT,项目名称:mathnet-numerics,代码行数:5,代码来源:DiscreteUniformTests.cs

示例15: ValidateMean

 public void ValidateMean([Values(-10, 0, 10, 20)] int l, [Values(10, 4, 20, 20)] int u, [Values(0, 2, 15, 20)] int m)
 {
     var du = new DiscreteUniform(l, u);
     Assert.AreEqual(m, du.Mean);
 }
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:5,代码来源:DiscreteUniformTests.cs


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