You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ch...@apache.org on 2018/08/14 13:23:13 UTC
[27/33] commons-rng git commit: Adding PoissonSampler deprecations.
Use the correct faster public methods
Adding PoissonSampler deprecations. Use the correct faster public 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/f8159f28
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/f8159f28
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/f8159f28
Branch: refs/heads/master
Commit: f8159f28a52197d0e7b55e39b115702147cf57a0
Parents: 50b984b
Author: Rob Tompkins <ch...@gmail.com>
Authored: Wed Aug 8 12:42:45 2018 -0400
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Wed Aug 8 12:42:45 2018 -0400
----------------------------------------------------------------------
.../sampling/distribution/PoissonSampler.java | 42 ++++++++++++++++++++
1 file changed, 42 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-rng/blob/f8159f28/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 d0733ba..29d0e4e 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
@@ -67,6 +67,48 @@ public class PoissonSampler
return poissonSampler.sample();
}
+ /**
+ * @return a random value from a uniform distribution in the
+ * interval {@code [0, 1)}.
+ * @deprecated - one should be using the {@link PoissonSampler#sample()} method,
+ * as it is considerably faster.
+ */
+ @Deprecated
+ protected double nextDouble() {
+ return super.nextDouble();
+ }
+
+ /**
+ * @return a random {@code int} value.
+ * @deprecated - one should be using the {@link PoissonSampler#sample()} method,
+ * as it is considerably faster.
+ */
+ @Deprecated
+ protected int nextInt() {
+ return super.nextInt();
+ }
+
+ /**
+ * @param max Upper bound (excluded).
+ * @return a random {@code int} value in the interval {@code [0, max)}.
+ * @deprecated - one should be using the {@link PoissonSampler#sample()} method,
+ * * as it is considerably faster.
+ */
+ @Deprecated
+ protected int nextInt(int max) {
+ return super.nextInt(max);
+ }
+
+ /**
+ * @return a random {@code long} value.
+ * @deprecated - one should be using the {@link PoissonSampler#sample()} method,
+ * * as it is considerably faster.
+ */
+ @Deprecated
+ protected long nextLong() {
+ return super.nextLong();
+ }
+
/** {@inheritDoc} */
@Override
public String toString() {