From d3f4480aff7b0b9fd82516b94b0929812f4b99df Mon Sep 17 00:00:00 2001 From: "Mark R. Diggory" Date: Sat, 21 Jun 2003 02:16:43 +0000 Subject: [PATCH] PR: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20980 Submitted by: phil@steitz.com git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140935 13f79535-47bb-0310-9956-ffa450edef68 --- .../math/stat/AbstractStoreUnivariate.java | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/java/org/apache/commons/math/stat/AbstractStoreUnivariate.java b/src/java/org/apache/commons/math/stat/AbstractStoreUnivariate.java index 2377b416c..e20114bde 100644 --- a/src/java/org/apache/commons/math/stat/AbstractStoreUnivariate.java +++ b/src/java/org/apache/commons/math/stat/AbstractStoreUnivariate.java @@ -52,6 +52,7 @@ * . */ package org.apache.commons.math.stat; +import java.util.Arrays; /** * Provides univariate measures for an array of doubles. @@ -284,31 +285,12 @@ public abstract class AbstractStoreUnivariate implements StoreUnivariate { } /** - * Uses Shell sort - * * @see org.apache.commons.math.stat.StoreUnivariate#getSortedValues() * */ public double[] getSortedValues() { double[] values = getValues(); - int n = values.length; - int j = n; - while (j > 1) { - j = j / 2; - boolean done = false; - while (!done) { - done = true; - for (int i = 0; i < n - j; i++) { - int k = i + j; - if (values[i] > values[k]) { - double temp = values[i]; - values[i] = values[k]; - values[k] = temp; - done = false; - } - } - } - } + Arrays.sort(values); return values; }