Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6674289AC for ; Sun, 11 Sep 2011 14:21:56 +0000 (UTC) Received: (qmail 61971 invoked by uid 500); 11 Sep 2011 14:21:56 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 61810 invoked by uid 500); 11 Sep 2011 14:21:55 -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 61800 invoked by uid 99); 11 Sep 2011 14:21:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Sep 2011 14:21:55 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of phil.steitz@gmail.com designates 209.85.210.47 as permitted sender) Received: from [209.85.210.47] (HELO mail-pz0-f47.google.com) (209.85.210.47) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Sep 2011 14:21:45 +0000 Received: by pzk2 with SMTP id 2so6180002pzk.34 for ; Sun, 11 Sep 2011 07:21:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=0wocK8uSYixwnVjYjq1qDVAOGnLVlpBxJG3ccvZ+ryo=; b=JWWD6dYnADYEpUF/CliZ2wNDJZqfWEN4qPrSVYjwkOLuaTnJ4cLYY4/PdHC2zqtSw1 eDFpLLtZjkJWhoo8emkl4BiljgeWKCM6RFpkRRuxN9C/hF3ntTkwA1XhQSz3fI6ggWtD 7hGSQ/wTaqZ92WPgNXsxl+SPtyw5o8SqfHO2I= Received: by 10.68.1.134 with SMTP id 6mr4192385pbm.458.1315750884467; Sun, 11 Sep 2011 07:21:24 -0700 (PDT) Received: from [192.168.0.2] (75-171-18-48.phnx.qwest.net. [75.171.18.48]) by mx.google.com with ESMTPS id h5sm35770190pbq.11.2011.09.11.07.21.21 (version=SSLv3 cipher=OTHER); Sun, 11 Sep 2011 07:21:22 -0700 (PDT) Message-ID: <4E6CC3E0.3000804@gmail.com> Date: Sun, 11 Sep 2011 07:21:20 -0700 From: Phil Steitz User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 To: Commons Developers List Subject: Re: [Math] Two "Complex" classes? (Was: Re: [math] Complex division) References: <595751345.14537.1315042209838.JavaMail.tomcat@hel.zones.apache.org> <4E624383.5070902@gmail.com> <1315219512.8953.10.camel@knuffelchen> <1315224930.8953.18.camel@knuffelchen> <20110905142136.GT19625@dusk.harfang.homelinux.org> <1315318764.6274.5.camel@knuffelchen> <20110910215127.GO19625@dusk.harfang.homelinux.org> In-Reply-To: <20110910215127.GO19625@dusk.harfang.homelinux.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 9/10/11 2:51 PM, Gilles Sadowski wrote: > Hello. > > Coming back to this with a simple idea that may hopefully satisfy everyone. > > What do you think of having one class that performs all operations by > directly applying the computational formulae, without worrying about NaN > or infinities. This would be represent the complex field, would be simple > and most efficient for general use (not involving limiting cases), would be > documented as "producing undefined results in limiting cases" or "producing > the results expected from direct application of the formulae". The latter > would probably automatically keep track of all combinations of NaNs and > infinities (as seems to be the case in Octave). > > In a subclass of the above one, we would attempt to get a completely > consistent representation of the extended complex numbers (one point at > infinity). It would thus contain all the special handling of the limiting > cases of the current "Complex" class (plus all the missing ones and related > bug fixes). I agree that to make everyone happy we are going to have to do something like this, but I would suggest that either we need a third implementation or the second one should try to implement C99x [1], preserving signed infinities. I have never seen a fully consistent implementation of the Riemannian space and if what we want is consistency with C-based packages, we are better off biting the bullet and implementing C99x. That could be done by either someone using their employer or other resource to get hold of the spec or reverse engineering a C-based OSS implementation like GCC or R. So I am +1 to 0) strip out the recoding / checks in trunk, reverting to previous "apply formulas and return the results" approach, documenting as the trig functions now do. (If we do this, we should remember to reopen any tickets that led to the checks in trunk and either close them as WONT_FIX or refer to the proposed second implementation as the proposed fix) 1) implement C99x in a subclass If we choose to implement something other than C99x in the subclass, we need to agree on the spec for it. Given the vagueness in at least the draft version of the spec, even in 1), it may turn out to be best to choose a reference implementation to emulate. In either case, full documentation of behavior in the javadoc will be necessary. As I have said before, I am also fine - and would prefer- doing nothing, i.e. staying with the documented contracts that are in the trunk now, realizing that they are not consistent with either the full Riemannian view or C99x. I see both of these as having pitfalls and the value of these changes as not worth users of the main class having to make changes to their exception management code to accommodate the change. I can see I am in the minority here, so I am OK with the split implementation idea above. Phil [1] Quite likely, whatever is approved by now is called something like "Annex X of C00.y" - what I am referring to is whatever "informative" or normative guidance the current C spec provides for complex arithmetic and standard functions. > > > Regards, > Gilles > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org