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 DD07F18690 for ; Mon, 2 Nov 2015 14:35:08 +0000 (UTC) Received: (qmail 7852 invoked by uid 500); 2 Nov 2015 14:35:08 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 7702 invoked by uid 500); 2 Nov 2015 14:35:08 -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 7088 invoked by uid 99); 2 Nov 2015 14:35:08 -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; Mon, 02 Nov 2015 14:35:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0A434E051D; Mon, 2 Nov 2015 14:35:08 +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: Mon, 02 Nov 2015 14:35:10 -0000 Message-Id: <0ff020aa345f4a0da913b8c3bfe3b372@git.apache.org> In-Reply-To: <6376803b70604a3ca97bbe5e7149cbce@git.apache.org> References: <6376803b70604a3ca97bbe5e7149cbce@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/4] [math] Fixed hidden field warning. Fixed hidden field warning. Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/026fce5c Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/026fce5c Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/026fce5c Branch: refs/heads/master Commit: 026fce5c5f01d7b712dc06db738e9e2699c9b118 Parents: bf7e9d5 Author: Luc Maisonobe Authored: Mon Nov 2 15:09:43 2015 +0100 Committer: Luc Maisonobe Committed: Mon Nov 2 15:09:43 2015 +0100 ---------------------------------------------------------------------- .../math4/stat/descriptive/rank/Percentile.java | 34 ++++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-math/blob/026fce5c/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Percentile.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Percentile.java b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Percentile.java index 23d1a8e..a4f0eea 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Percentile.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Percentile.java @@ -716,8 +716,8 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa @Override protected double estimate(final double[] values, final int[] pivotsHeap, final double pos, - final int length, final KthSelector kthSelector) { - return super.estimate(values, pivotsHeap, FastMath.ceil(pos - 0.5), length, kthSelector); + final int length, final KthSelector selector) { + return super.estimate(values, pivotsHeap, FastMath.ceil(pos - 0.5), length, selector); } }, @@ -748,11 +748,11 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa @Override protected double estimate(final double[] values, final int[] pivotsHeap, final double pos, - final int length, final KthSelector kthSelector) { + final int length, final KthSelector selector) { final double low = - super.estimate(values, pivotsHeap, FastMath.ceil(pos - 0.5), length, kthSelector); + super.estimate(values, pivotsHeap, FastMath.ceil(pos - 0.5), length, selector); final double high = - super.estimate(values, pivotsHeap,FastMath.floor(pos + 0.5), length, kthSelector); + super.estimate(values, pivotsHeap,FastMath.floor(pos + 0.5), length, selector); return (low + high) / 2; } @@ -953,26 +953,26 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa * {@link #index(double, int)} * @param pivotsHeap an earlier populated cache if exists; will be used * @param length size of array considered - * @param kthSelector a {@link KthSelector} used for pivoting during search + * @param selector a {@link KthSelector} used for pivoting during search * @return estimated percentile */ protected double estimate(final double[] work, final int[] pivotsHeap, final double pos, final int length, - final KthSelector kthSelector) { + final KthSelector selector) { final double fpos = FastMath.floor(pos); final int intPos = (int) fpos; final double dif = pos - fpos; if (pos < 1) { - return kthSelector.select(work, pivotsHeap, 0); + return selector.select(work, pivotsHeap, 0); } if (pos >= length) { - return kthSelector.select(work, pivotsHeap, length - 1); + return selector.select(work, pivotsHeap, length - 1); } - final double lower = kthSelector.select(work, pivotsHeap, intPos - 1); - final double upper = kthSelector.select(work, pivotsHeap, intPos); + final double lower = selector.select(work, pivotsHeap, intPos - 1); + final double upper = selector.select(work, pivotsHeap, intPos); return lower + dif * (upper - lower); } @@ -986,19 +986,19 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa * @param work array of numbers to be used for finding the percentile * @param pivotsHeap a prior cached heap which can speed up estimation * @param p the pth quantile to be computed - * @param kthSelector a {@link KthSelector} used for pivoting during search + * @param selector a {@link KthSelector} used for pivoting during search * @return estimated percentile * @throws OutOfRangeException if p is out of range * @throws NullArgumentException if work array is null */ protected double evaluate(final double[] work, final int[] pivotsHeap, final double p, - final KthSelector kthSelector) { + final KthSelector selector) { MathUtils.checkNotNull(work); if (p > 100 || p <= 0) { throw new OutOfRangeException(LocalizedFormats.OUT_OF_BOUNDS_QUANTILE_VALUE, p, 0, 100); } - return estimate(work, pivotsHeap, index(p/100d, work.length), work.length, kthSelector); + return estimate(work, pivotsHeap, index(p/100d, work.length), work.length, selector); } /** @@ -1011,12 +1011,12 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa * @param work array of numbers to be used for finding the percentile * @param p the pth quantile to be computed * @return estimated percentile - * @param kthSelector a {@link KthSelector} used for pivoting during search + * @param selector a {@link KthSelector} used for pivoting during search * @throws OutOfRangeException if length or p is out of range * @throws NullArgumentException if work array is null */ - public double evaluate(final double[] work, final double p, final KthSelector kthSelector) { - return this.evaluate(work, null, p, kthSelector); + public double evaluate(final double[] work, final double p, final KthSelector selector) { + return this.evaluate(work, null, p, selector); } /**