commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [26/50] commons-rng git commit: Override "toString" (unit tests).
Date Tue, 29 Nov 2016 11:32:37 GMT
Override "toString" (unit tests).


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/ccbcb5f1
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/ccbcb5f1
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/ccbcb5f1

Branch: refs/heads/1.0-release
Commit: ccbcb5f198d7d1348bb8fb208542f81af1d58c90
Parents: ab46293
Author: Gilles <erans@apache.org>
Authored: Sun Nov 27 06:06:39 2016 +0100
Committer: Gilles <erans@apache.org>
Committed: Sun Nov 27 06:06:39 2016 +0100

----------------------------------------------------------------------
 .../distribution/ContinuousSamplersList.java        |  6 +++++-
 .../sampling/distribution/DiscreteSamplersList.java | 16 ++++++++++------
 2 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/ccbcb5f1/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplersList.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplersList.java
b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplersList.java
index 3854771..0cdf0b6 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplersList.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplersList.java
@@ -172,7 +172,7 @@ public class ContinuousSamplersList {
             add(LIST, new org.apache.commons.math3.distribution.UniformRealDistribution(loUniform,
hiUniform),
                 new ContinuousUniformSampler(RandomSource.create(RandomSource.MT_64), loUniform,
hiUniform));
 
-            // Weibull.
+            // Weibull ("inverse method").
             final double alphaWeibull = 678.9;
             final double betaWeibull = 98.76;
             add(LIST, new org.apache.commons.math3.distribution.WeibullDistribution(alphaWeibull,
betaWeibull),
@@ -204,6 +204,10 @@ public class ContinuousSamplersList {
                                                       public double inverseCumulativeProbability(double
p) {
                                                           return dist.inverseCumulativeProbability(p);
                                                       }
+                                                      @Override
+                                                      public String toString() {
+                                                          return dist.toString();
+                                                      }
                                                   });
         list.add(new ContinuousSamplerTestData[] { new ContinuousSamplerTestData(inverseMethodSampler,
                                                                                  getDeciles(dist))
});

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/ccbcb5f1/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplersList.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplersList.java
b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplersList.java
index 54ae32d..59fc941 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplersList.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplersList.java
@@ -138,12 +138,16 @@ public class DiscreteSamplersList {
                             UniformRandomProvider rng) {
         final DiscreteSampler inverseMethodSampler =
             new InverseTransformDiscreteSampler(rng,
-                                             new DiscreteInverseCumulativeProbabilityFunction()
{
-                                                 @Override
-                                                 public int inverseCumulativeProbability(double
p) {
-                                                     return dist.inverseCumulativeProbability(p);
-                                                 }
-                                             });
+                                                new DiscreteInverseCumulativeProbabilityFunction()
{
+                                                    @Override
+                                                    public int inverseCumulativeProbability(double
p) {
+                                                        return dist.inverseCumulativeProbability(p);
+                                                    }
+                                                    @Override
+                                                    public String toString() {
+                                                        return dist.toString();
+                                                    }
+                                                });
         list.add(new DiscreteSamplerTestData[] { new DiscreteSamplerTestData(inverseMethodSampler,
                                                                              points,
                                                                              getProbabilities(dist,
points)) });


Mime
View raw message