commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [11/50] commons-rng git commit: Removed one level of inheritance.
Date Mon, 21 Nov 2016 17:04:01 GMT
Removed one level of inheritance.


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

Branch: refs/heads/master
Commit: 74be2678ff3da2033453220fd1bc93cff8e39cd6
Parents: 19695b4
Author: Gilles <erans@apache.org>
Authored: Sat Nov 12 19:49:34 2016 +0100
Committer: Gilles <erans@apache.org>
Committed: Sat Nov 12 19:49:34 2016 +0100

----------------------------------------------------------------------
 .../rng/sampling/AbstractBaseSampler.java       | 62 --------------------
 .../rng/sampling/AbstractContinuousSampler.java | 39 ------------
 .../rng/sampling/AbstractDiscreteSampler.java   | 39 ------------
 .../commons/rng/sampling/SamplerBase.java       | 62 ++++++++++++++++++++
 .../AhrensDieterExponentialSampler.java         |  7 ++-
 .../AhrensDieterMarsagliaTsangGammaSampler.java |  7 ++-
 .../distribution/BoxMullerGaussianSampler.java  |  7 ++-
 .../distribution/BoxMullerLogNormalSampler.java |  7 ++-
 .../sampling/distribution/ChengBetaSampler.java |  8 ++-
 .../distribution/ContinuousUniformSampler.java  |  7 ++-
 .../distribution/DiscreteUniformSampler.java    |  7 ++-
 .../InverseTransformContinuousSampler.java      |  9 ++-
 .../InverseTransformDiscreteSampler.java        |  7 ++-
 .../InverseTransformParetoSampler.java          |  7 ++-
 .../sampling/distribution/PoissonSampler.java   |  4 +-
 .../RejectionInversionZipfSampler.java          |  4 +-
 16 files changed, 117 insertions(+), 166 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/AbstractBaseSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/AbstractBaseSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/AbstractBaseSampler.java
deleted file mode 100644
index f97687c..0000000
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/AbstractBaseSampler.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.rng.sampling;
-
-import org.apache.commons.rng.UniformRandomProvider;
-
-/**
- * Base class for a sampler.
- */
-public class AbstractBaseSampler {
-    /** RNG. */
-    private final UniformRandomProvider rng;
-
-    /**
-     * @param rng Generator of uniformly distributed random numbers.
-     */
-    protected AbstractBaseSampler(UniformRandomProvider rng) {
-        this.rng = rng;
-    }
-
-    /**
-     * @return a random value from a uniform distribution in the
-     * interval {@code [0, 1)}.
-     */
-    protected double nextUniform() {
-        return rng.nextDouble();
-    }
-
-    /**
-     * @return a random {@code int} value.
-     */
-    protected int nextInt() {
-        return rng.nextInt();
-    }
-
-    /**
-     * @return a random {@code int} value in the interval {@code [0, max)}.
-     */
-    protected int nextInt(int max) {
-        return rng.nextInt(max);
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public String toString() {
-        return "[" + rng.toString() + "]";
-    }
-}

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/AbstractContinuousSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/AbstractContinuousSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/AbstractContinuousSampler.java
deleted file mode 100644
index f590f66..0000000
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/AbstractContinuousSampler.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.rng.sampling;
-
-import org.apache.commons.rng.UniformRandomProvider;
-
-/**
- * Base class for a sampler that generates values of type {@code double}.
- */
-public abstract class AbstractContinuousSampler
-    extends AbstractBaseSampler
-    implements ContinuousSampler {
-    /**
-     * @param rng Generator of uniformly distributed random numbers.
-     */
-    protected AbstractContinuousSampler(UniformRandomProvider rng) {
-        super(rng);
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public String toString() {
-        return "[continuous sampler " + super.toString() + "]";
-    }
-}

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/AbstractDiscreteSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/AbstractDiscreteSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/AbstractDiscreteSampler.java
deleted file mode 100644
index a767aae..0000000
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/AbstractDiscreteSampler.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.rng.sampling;
-
-import org.apache.commons.rng.UniformRandomProvider;
-
-/**
- * Base class for a sampler that generates values of type {@code int}.
- */
-public abstract class AbstractDiscreteSampler
-    extends AbstractBaseSampler
-    implements DiscreteSampler {
-    /**
-     * @param rng Generator of uniformly distributed random numbers.
-     */
-    protected AbstractDiscreteSampler(UniformRandomProvider rng) {
-        super(rng);
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public String toString() {
-        return "[discrete sampler " + super.toString() + "]";
-    }
-}

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/SamplerBase.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/SamplerBase.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/SamplerBase.java
new file mode 100644
index 0000000..06cd396
--- /dev/null
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/SamplerBase.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.rng.sampling;
+
+import org.apache.commons.rng.UniformRandomProvider;
+
+/**
+ * Base class for a sampler.
+ */
+public class SamplerBase {
+    /** RNG. */
+    private final UniformRandomProvider rng;
+
+    /**
+     * @param rng Generator of uniformly distributed random numbers.
+     */
+    protected SamplerBase(UniformRandomProvider rng) {
+        this.rng = rng;
+    }
+
+    /**
+     * @return a random value from a uniform distribution in the
+     * interval {@code [0, 1)}.
+     */
+    protected double nextUniform() {
+        return rng.nextDouble();
+    }
+
+    /**
+     * @return a random {@code int} value.
+     */
+    protected int nextInt() {
+        return rng.nextInt();
+    }
+
+    /**
+     * @return a random {@code int} value in the interval {@code [0, max)}.
+     */
+    protected int nextInt(int max) {
+        return rng.nextInt(max);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public String toString() {
+        return "[" + rng.toString() + "]";
+    }
+}

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSampler.java
index 8807ce8..e517397 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSampler.java
@@ -17,14 +17,17 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.UniformRandomProvider;
-import org.apache.commons.rng.sampling.AbstractContinuousSampler;
+import org.apache.commons.rng.sampling.ContinuousSampler;
+import org.apache.commons.rng.sampling.SamplerBase;
 
 /**
  * Sampling from an exponential distribution.
  *
  * @see <a href="http://mathworld.wolfram.com/ExponentialDistribution.html">Exponential
distribution (MathWorld)</a>
  */
-public class AhrensDieterExponentialSampler extends AbstractContinuousSampler {
+public class AhrensDieterExponentialSampler
+    extends SamplerBase
+    implements ContinuousSampler {
     /**
      * Table containing the constants
      * \( q_i = sum_{j=1}^i (\ln 2)^j / j! = \ln 2 + (\ln 2)^2 / 2 + ... + (\ln 2)^i / i!
\)

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSampler.java
index 14e6382..156e60d 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSampler.java
@@ -17,7 +17,8 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.UniformRandomProvider;
-import org.apache.commons.rng.sampling.AbstractContinuousSampler;
+import org.apache.commons.rng.sampling.ContinuousSampler;
+import org.apache.commons.rng.sampling.SamplerBase;
 
 /**
  * <p>
@@ -42,7 +43,9 @@ import org.apache.commons.rng.sampling.AbstractContinuousSampler;
  * </ul>
  * </p>
  */
-public class AhrensDieterMarsagliaTsangGammaSampler extends AbstractContinuousSampler {
+public class AhrensDieterMarsagliaTsangGammaSampler
+    extends SamplerBase
+    implements ContinuousSampler {
     /** The shape parameter. */
     private final double theta;
     /** The alpha parameter. */

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSampler.java
index 35beb89..5b69701 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/BoxMullerGaussianSampler.java
@@ -17,13 +17,16 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.UniformRandomProvider;
-import org.apache.commons.rng.sampling.AbstractContinuousSampler;
+import org.apache.commons.rng.sampling.ContinuousSampler;
+import org.apache.commons.rng.sampling.SamplerBase;
 
 /**
  * <a href="https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform">
  * Box-Muller algorithm</a> for sampling from a Gaussian distribution.
  */
-public class BoxMullerGaussianSampler extends AbstractContinuousSampler {
+public class BoxMullerGaussianSampler
+    extends SamplerBase
+    implements ContinuousSampler {
     /** Next gaussian. */
     private double nextGaussian = Double.NaN;
     /** Mean. */

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSampler.java
index 4cda8d4..5cb869f 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSampler.java
@@ -17,13 +17,16 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.UniformRandomProvider;
-import org.apache.commons.rng.sampling.AbstractContinuousSampler;
+import org.apache.commons.rng.sampling.ContinuousSampler;
+import org.apache.commons.rng.sampling.SamplerBase;
 
 /**
  * <a href="https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform">
  * Box-Muller algorithm</a> for sampling from a Log normal distribution.
  */
-public class BoxMullerLogNormalSampler extends AbstractContinuousSampler {
+public class BoxMullerLogNormalSampler
+    extends SamplerBase
+    implements ContinuousSampler {
     /** Scale. */
     private final double scale;
     /** Shape. */

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ChengBetaSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ChengBetaSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ChengBetaSampler.java
index d0bfd41..1252a0c 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ChengBetaSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ChengBetaSampler.java
@@ -17,8 +17,8 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.UniformRandomProvider;
-import org.apache.commons.rng.sampling.AbstractContinuousSampler;
-
+import org.apache.commons.rng.sampling.ContinuousSampler;
+import org.apache.commons.rng.sampling.SamplerBase;
 
 /**
  * Utility class implementing Cheng's algorithms for beta distribution sampling.
@@ -33,7 +33,9 @@ import org.apache.commons.rng.sampling.AbstractContinuousSampler;
  *
  * @since 1.0
  */
-public class ChengBetaSampler extends AbstractContinuousSampler {
+public class ChengBetaSampler
+    extends SamplerBase
+    implements ContinuousSampler {
     /** First shape parameter. */
     private final double alphaShape;
     /** Second shape parameter. */

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSampler.java
index a77cddc..8441f81 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ContinuousUniformSampler.java
@@ -17,12 +17,15 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.UniformRandomProvider;
-import org.apache.commons.rng.sampling.AbstractContinuousSampler;
+import org.apache.commons.rng.sampling.ContinuousSampler;
+import org.apache.commons.rng.sampling.SamplerBase;
 
 /**
  * Sampling from a uniform distribution.
  */
-public class ContinuousUniformSampler extends AbstractContinuousSampler {
+public class ContinuousUniformSampler
+    extends SamplerBase
+    implements ContinuousSampler {
     /** Lower bound. */
     private final double lo;
     /** Higher bound. */

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSampler.java
index f0a3e8d..10a421a 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSampler.java
@@ -18,12 +18,15 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.UniformRandomProvider;
-import org.apache.commons.rng.sampling.AbstractDiscreteSampler;
+import org.apache.commons.rng.sampling.SamplerBase;
+import org.apache.commons.rng.sampling.DiscreteSampler;
 
 /**
  * Discrete uniform distribution sampler.
  */
-public class DiscreteUniformSampler extends AbstractDiscreteSampler {
+public class DiscreteUniformSampler
+    extends SamplerBase
+    implements DiscreteSampler {
     /** Lower bound. */
     private final int lower;
     /** Upper bound. */

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InverseTransformContinuousSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InverseTransformContinuousSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InverseTransformContinuousSampler.java
index 92ef64d..8bea875 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InverseTransformContinuousSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InverseTransformContinuousSampler.java
@@ -17,7 +17,8 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.UniformRandomProvider;
-import org.apache.commons.rng.sampling.AbstractContinuousSampler;
+import org.apache.commons.rng.sampling.ContinuousSampler;
+import org.apache.commons.rng.sampling.SamplerBase;
 
 /**
  * Distribution sampler that uses the
@@ -55,7 +56,9 @@ import org.apache.commons.rng.sampling.AbstractContinuousSampler;
  * double random = chiSquareSampler.sample();
  * </source></pre>
  */
-public class InverseTransformContinuousSampler extends AbstractContinuousSampler {
+public class InverseTransformContinuousSampler
+    extends SamplerBase
+    implements ContinuousSampler {
     /** Inverse cumulative probability function. */
     private final ContinuousInverseCumulativeProbabilityFunction function;
 
@@ -64,7 +67,7 @@ public class InverseTransformContinuousSampler extends AbstractContinuousSampler
      * @param function Inverse cumulative probability function.
      */
     public InverseTransformContinuousSampler(UniformRandomProvider rng,
-                                          ContinuousInverseCumulativeProbabilityFunction
function) {
+                                             ContinuousInverseCumulativeProbabilityFunction
function) {
         super(rng);
         this.function = function;
     }

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InverseTransformDiscreteSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InverseTransformDiscreteSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InverseTransformDiscreteSampler.java
index c81b519..82a819d 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InverseTransformDiscreteSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InverseTransformDiscreteSampler.java
@@ -17,7 +17,8 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.UniformRandomProvider;
-import org.apache.commons.rng.sampling.AbstractDiscreteSampler;
+import org.apache.commons.rng.sampling.SamplerBase;
+import org.apache.commons.rng.sampling.DiscreteSampler;
 
 /**
  * Distribution sampler that uses the
@@ -55,7 +56,9 @@ import org.apache.commons.rng.sampling.AbstractDiscreteSampler;
  * int random = binomialSampler.sample();
  * </source></pre>
  */
-public class InverseTransformDiscreteSampler extends AbstractDiscreteSampler {
+public class InverseTransformDiscreteSampler
+    extends SamplerBase
+    implements DiscreteSampler {
     /** Inverse cumulative probability function. */
     private final DiscreteInverseCumulativeProbabilityFunction function;
 

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSampler.java
index 5f18702..82c68f1 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InverseTransformParetoSampler.java
@@ -17,12 +17,15 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.UniformRandomProvider;
-import org.apache.commons.rng.sampling.AbstractContinuousSampler;
+import org.apache.commons.rng.sampling.SamplerBase;
+import org.apache.commons.rng.sampling.ContinuousSampler;
 
 /**
  * Sampling from a <a href="https://en.wikipedia.org/wiki/Pareto_distribution">Pareto
distribution</a>.
  */
-public class InverseTransformParetoSampler extends AbstractContinuousSampler {
+public class InverseTransformParetoSampler
+    extends SamplerBase
+    implements ContinuousSampler {
     /** Scale. */
     private final double scale;
     /** Shape. */

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
index 6662068..2576640 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
@@ -17,7 +17,7 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.UniformRandomProvider;
-import org.apache.commons.rng.sampling.AbstractBaseSampler;
+import org.apache.commons.rng.sampling.SamplerBase;
 import org.apache.commons.rng.sampling.DiscreteSampler;
 import org.apache.commons.rng.sampling.ContinuousSampler;
 
@@ -25,7 +25,7 @@ import org.apache.commons.rng.sampling.ContinuousSampler;
  * Sampler for the <a href="http://mathworld.wolfram.com/PoissonDistribution.html">Poisson
distribution</a>.
  */
 public class PoissonSampler
-    extends AbstractBaseSampler
+    extends SamplerBase
     implements DiscreteSampler {
     /** Mean of the distribution. */
     private final double mean;

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/74be2678/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSampler.java
index de3ebb4..292c11d 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSampler.java
@@ -18,7 +18,7 @@
 package org.apache.commons.rng.sampling.distribution;
 
 import org.apache.commons.rng.UniformRandomProvider;
-import org.apache.commons.rng.sampling.AbstractBaseSampler;
+import org.apache.commons.rng.sampling.SamplerBase;
 import org.apache.commons.rng.sampling.DiscreteSampler;
 
 /**
@@ -27,7 +27,7 @@ import org.apache.commons.rng.sampling.DiscreteSampler;
  * @since 1.0
  */
 public class RejectionInversionZipfSampler
-    extends AbstractBaseSampler
+    extends SamplerBase
     implements DiscreteSampler {
     /** Number of elements. */
     private final int numberOfElements;


Mime
View raw message