Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 1238 invoked from network); 26 Sep 2010 21:20:05 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Sep 2010 21:20:05 -0000 Received: (qmail 25943 invoked by uid 500); 26 Sep 2010 21:20:05 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 25835 invoked by uid 500); 26 Sep 2010 21:20:04 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 25824 invoked by uid 99); 26 Sep 2010 21:20:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Sep 2010 21:20:04 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [193.74.71.26] (HELO hel.is.scarlet.be) (193.74.71.26) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Sep 2010 21:19:55 +0000 Received: from mail.harfang.homelinux.org (ip-62-235-223-29.dsl.scarlet.be [62.235.223.29]) by hel.is.scarlet.be (8.14.2/8.14.2) with ESMTP id o8QLJWkp020427 for ; Sun, 26 Sep 2010 23:19:32 +0200 Received: from localhost (mail.harfang.homelinux.org [192.168.20.11]) by mail.harfang.homelinux.org (Postfix) with ESMTP id E914E61CBD for ; Sun, 26 Sep 2010 23:19:31 +0200 (CEST) Received: from mail.harfang.homelinux.org ([192.168.20.11]) by localhost (mail.harfang.homelinux.org [192.168.20.11]) (amavisd-new, port 10024) with ESMTP id ldUtRD9Gu9ik for ; Sun, 26 Sep 2010 23:19:24 +0200 (CEST) Received: from dusk.harfang.homelinux.org (mail.harfang.homelinux.org [192.168.20.11]) by mail.harfang.homelinux.org (Postfix) with ESMTP id 054D8617CB for ; Sun, 26 Sep 2010 23:19:24 +0200 (CEST) Received: from eran by dusk.harfang.homelinux.org with local (Exim 4.71) (envelope-from ) id 1Ozyd1-0004Hj-Ru for dev@commons.apache.org; Sun, 26 Sep 2010 23:19:23 +0200 Date: Sun, 26 Sep 2010 23:19:23 +0200 From: Gilles Sadowski To: dev@commons.apache.org Subject: Re: [math] speeding up percentile based statistics Message-ID: <20100926211923.GN10200@dusk.harfang.homelinux.org> Mail-Followup-To: dev@commons.apache.org References: <4C9501BE.9030808@free.fr> <4C950D93.2050008@free.fr> <4C9BA32C.305@free.fr> <4C9F6066.6000504@free.fr> <20100926171924.GM10200@dusk.harfang.homelinux.org> <4C9F9155.9000404@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C9F9155.9000404@free.fr> X-Operating-System: Tiny Tux X-PGP-Key-Fingerprint: 53B9 972E C2E6 B93C BEAD 7092 09E6 AF46 51D0 5641 User-Agent: Mutt/1.5.20 (2009-06-14) X-DCC-scarlet.be-Metrics: hel 20002; Body=1 Fuz1=1 Fuz2=1 X-Virus-Checked: Checked by ClamAV on apache.org > [...] > >> > >> ---CUT--- > >> double[] a = new double[] {1, 2, 3}; > >> double[] b = new double[] {1, 2, 3, 4, 5}; > >> Percentile pA = new Percentile(a); > >> Percentile pB = new Percentile(b); > >> > >> double r; > >> r = pA.evaluate(50); > >> r = pB.evaluate(50); > >> r = pA.evaluate(50); > >> r = pB.evaluate(50); > >> ---CUT--- > >> > >> That way, later calls can benefit from whatever preprocessing was done in > >> previous calls. > >> The instance will always control all the information needed (e.g. after a > >> call to an "addValues" method) for the processing without the need to rely > >> on the user for calling "clearCache" whenever necessary. > >> > >> > >> Gilles > > > > +1 > > I think that is a really good idea and I agree on the points made. > > This proposal is point 4. It breaks the UnivariateStatistic API and it > breaks what the user found interesting in this API, i.e. have a general > statistics framework where one statistic can be replaced by another one. > > If you read again one of my earlier messages from today, we will combine > this method (i.e. evaluate without values) and the UnivariateStatistics API. > > Perhaps we could add these new methods (i.e. addValues and evaluate > without values) to UnivariateStatistics, but this can only be done on 3.0. +1 Is it urgent to complicate the code? If the API conflicts with a necessary efficiency improvement, why not postpone the change? Gilles --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org