commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [4/8] commons-rng git commit: RNG-62: Removed getK and getN methods
Date Fri, 23 Nov 2018 11:43:05 GMT
RNG-62: Removed getK and getN methods

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

Branch: refs/heads/master
Commit: 8626198d63246da1ca198b4645ddbc99a83c87e8
Parents: 974b864
Author: Alex Herbert <a.herbert@sussex.ac.uk>
Authored: Fri Nov 23 09:32:23 2018 +0000
Committer: Alex Herbert <a.herbert@sussex.ac.uk>
Committed: Fri Nov 23 09:32:23 2018 +0000

----------------------------------------------------------------------
 .../commons/rng/sampling/CombinationSampler.java  | 18 ------------------
 .../rng/sampling/CombinationSamplerTest.java      |  4 ----
 2 files changed, 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/8626198d/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/CombinationSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/CombinationSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/CombinationSampler.java
index 04b4376..ca95f42 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/CombinationSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/CombinationSampler.java
@@ -146,22 +146,4 @@ public class CombinationSampler {
         array[i] = array[j];
         array[j] = tmp;
     }
-
-    /**
-     * Gets the domain size (n) of the combination C(n, k).
-     *
-     * @return the number of elements (n) in the domain
-     */
-    public int getN() {
-        return domain.length;
-    }
-
-    /**
-     * Gets the sample size (k) of the combination C(n, k).
-     *
-     * @return the number of elements (k) in the combination
-     */
-    public int getK() {
-        return size;
-    }
 }

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/8626198d/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
index 2d43204..7b80d36 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/CombinationSamplerTest.java
@@ -37,8 +37,6 @@ public class CombinationSamplerTest {
         final int n = 6;
         for (int k = 1; k <= n; k++) {
             final CombinationSampler sampler = new CombinationSampler(rng, n, k);
-            Assert.assertEquals("Incorrect n", n, sampler.getN());
-            Assert.assertEquals("Incorrect k", k, sampler.getK());
             final int[] random = sampler.sample();
             for (int s : random) {
                 assertIsInDomain(n, s);
@@ -67,8 +65,6 @@ public class CombinationSamplerTest {
         for (int n = 1; n < 3; n++) {
             final int k = n;
             final CombinationSampler sampler = new CombinationSampler(rng, n, k);
-            Assert.assertEquals("Incorrect n", n, sampler.getN());
-            Assert.assertEquals("Incorrect k", k, sampler.getK());
             final int[] sample = sampler.sample();
             Assert.assertEquals("Incorrect sample length", n, sample.length);
             for (int i = 0; i < n; i++) {


Mime
View raw message