Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 33B0017E94 for ; Sun, 17 Jan 2016 10:41:58 +0000 (UTC) Received: (qmail 94762 invoked by uid 500); 17 Jan 2016 10:41:52 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 94560 invoked by uid 500); 17 Jan 2016 10:41:52 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 93513 invoked by uid 99); 17 Jan 2016 10:41:51 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Jan 2016 10:41:51 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 33C9BE3858; Sun, 17 Jan 2016 10:41:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: luc@apache.org To: commits@commons.apache.org Date: Sun, 17 Jan 2016 10:42:05 -0000 Message-Id: <9203159177c64e3cac11bc677e66f10d@git.apache.org> In-Reply-To: <1de5419fe9f849b8b89c431cb9232316@git.apache.org> References: <1de5419fe9f849b8b89c431cb9232316@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [16/22] [math] Reverting commit e0d17fed51f5018fc34578699d824c20efc44368 as per Gilles request. Reverting commit e0d17fed51f5018fc34578699d824c20efc44368 as per Gilles request. The work on revamping the random packages is perfoemd in the random-ravamp branch. Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/794dda1f Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/794dda1f Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/794dda1f Branch: refs/heads/master Commit: 794dda1fbb2d54dd54934e88d9867ada0c7ac54d Parents: a4456b8 Author: Luc Maisonobe Authored: Sun Jan 17 11:35:25 2016 +0100 Committer: Luc Maisonobe Committed: Sun Jan 17 11:40:27 2016 +0100 ---------------------------------------------------------------------- .../commons/math4/random/ISAACRandom.java | 41 ++++---------------- 1 file changed, 7 insertions(+), 34 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-math/blob/794dda1f/src/main/java/org/apache/commons/math4/random/ISAACRandom.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/random/ISAACRandom.java b/src/main/java/org/apache/commons/math4/random/ISAACRandom.java index 185710f..b9c0e36 100644 --- a/src/main/java/org/apache/commons/math4/random/ISAACRandom.java +++ b/src/main/java/org/apache/commons/math4/random/ISAACRandom.java @@ -85,7 +85,7 @@ public class ISAACRandom * current time and system hash code of the instance as the seed. */ public ISAACRandom() { - setSeedInternal(System.currentTimeMillis() + System.identityHashCode(this)); + setSeed(System.currentTimeMillis() + System.identityHashCode(this)); } /** @@ -94,7 +94,7 @@ public class ISAACRandom * @param seed Initial seed. */ public ISAACRandom(long seed) { - setSeedInternal(seed); + setSeed(seed); } /** @@ -104,51 +104,24 @@ public class ISAACRandom * to the current time. */ public ISAACRandom(int[] seed) { - setSeedInternal(seed); + setSeed(seed); } /** {@inheritDoc} */ @Override public void setSeed(int seed) { - setSeedInternal(seed); - } - - /** {@inheritDoc} */ - @Override - public void setSeed(int[] seed) { - setSeedInternal(seed); + setSeed(new int[]{seed}); } /** {@inheritDoc} */ @Override public void setSeed(long seed) { - setSeedInternal(seed); - } - - /** - * Reseeds the RNG. - * - * @param seed Seed. - */ - private void setSeedInternal(int seed) { - setSeed(new int[]{seed}); - } - - /** - * Reseeds the RNG. - * - * @param seed Seed. - */ - private void setSeedInternal(long seed) { setSeed(new int[]{(int) (seed >>> 32), (int) (seed & 0xffffffffL)}); } - /** - * Reseeds the RNG. - * - * @param seed Seed. - */ - private void setSeedInternal(int[] seed) { + /** {@inheritDoc} */ + @Override + public void setSeed(int[] seed) { if (seed == null) { setSeed(System.currentTimeMillis() + System.identityHashCode(this)); return;