You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2019/09/16 18:59:00 UTC

[commons-rng] 04/13: Comment reversal of parameters

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit 9574c0c12b8489b09a1790ad334e030fc72134a3
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sat Sep 14 12:21:25 2019 +0100

    Comment reversal of parameters
---
 .../apache/commons/rng/sampling/distribution/ChengBetaSampler.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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 1a01e1f..c85278a 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
@@ -91,9 +91,10 @@ public class ChengBetaSampler
 
         if (a > 1) {
             return algorithmBB(a, b);
-        } else {
-            return algorithmBC(b, a);
         }
+        // This method declares parameters (a, b).
+        // The algorithm is deliberately invoked with reversed parameters.
+        return algorithmBC(b, a);
     }
 
     /** {@inheritDoc} */