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 BBDD2929F for ; Thu, 9 Feb 2012 12:09:41 +0000 (UTC) Received: (qmail 67017 invoked by uid 500); 9 Feb 2012 12:09:41 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 66916 invoked by uid 500); 9 Feb 2012 12:09:40 -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 66908 invoked by uid 99); 9 Feb 2012 12:09:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Feb 2012 12:09:40 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.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.27] (HELO eir.is.scarlet.be) (193.74.71.27) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Feb 2012 12:09:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scarlet.be; s=scarlet; t=1328789351; bh=RQkXNobw1aERA7pYiGuQDQeAzKKUZFzfk5f6t1cKbOs=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=DtAzq+vuRhJSltLWRXYW3v/xCFH65bYz1d4chQ0FC78tLn2UMhmttskCWlun3V2WQ sTL+r8uCtCulguHegtwyAf8MdTCHG9x1AdRsGXOYNilTKdgEVlefTB/av+yOhnig4j WpDzM+meHh6kCcHKurvXg3KaCafssnuR9MSQZFBU= Received: from mail.harfang.homelinux.org (ip-62-235-198-98.dsl.scarlet.be [62.235.198.98]) by eir.is.scarlet.be (8.14.5/8.14.5) with ESMTP id q19C9BKk014777 for ; Thu, 9 Feb 2012 13:09:11 +0100 X-Scarlet: d=1328789351 c=62.235.198.98 Received: from localhost (mail.harfang.homelinux.org [192.168.20.11]) by mail.harfang.homelinux.org (Postfix) with ESMTP id 125BF61CEB for ; Thu, 9 Feb 2012 13:09:11 +0100 (CET) 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 F4+s50hHevoz for ; Thu, 9 Feb 2012 13:09:05 +0100 (CET) Received: from dusk.harfang.homelinux.org (mail.harfang.homelinux.org [192.168.20.11]) by mail.harfang.homelinux.org (Postfix) with ESMTP id 3975661833 for ; Thu, 9 Feb 2012 13:09:05 +0100 (CET) Received: from eran by dusk.harfang.homelinux.org with local (Exim 4.77) (envelope-from ) id 1RvSoD-00042p-7C for dev@commons.apache.org; Thu, 09 Feb 2012 13:09:05 +0100 Date: Thu, 9 Feb 2012 13:09:05 +0100 From: Gilles Sadowski To: dev@commons.apache.org Subject: Re: [math] Are all FieldElement Numbers? Message-ID: <20120209120905.GX26355@dusk.harfang.homelinux.org> Mail-Followup-To: dev@commons.apache.org References: <4F33999D.8060502@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4F33999D.8060502@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.21 (2010-09-15) X-DCC-scarlet.be-Metrics: eir 20001; Body=1 Fuz1=1 Fuz2=1 X-Virus-Scanned: clamav-milter 0.97.1-exp at eir X-Virus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Feb 09, 2012 at 11:02:05AM +0100, Luc Maisonobe wrote: > Le 09/02/2012 10:15, S�bastien Brisard a �crit : > > Hi, > > Hi S�bastien, > > > I'm doing some calculations with FieldElement, and need at the end to > > convert the result to double. I notice that in the current CM, all > > classes that implement FieldElement also implement Number, which would > > be exactly what I need. My question therefore is > > * Should we have the interface FieldElement extend Number? I know we > > could think of fields which are *not* numbers, but we are, after all, > > a project dedicated to numerical computations... > > Yes, all FieldElement are expected to be numbers, or at least there is > an homomorphism mapping the elements to numbers. However, FieldElement > cannot implement Number because number is a class, not an interface. If > we want to have this hierarchy, we also have to change FieldElement to > an abstract class. > > This interface was introduced in order to have one common ancestor > between Fraction and BigReal. This common ancestor then allowed > trivially to support some important linear algebra algorithms on > fractions by just slightly adapting what did exist for BigReal. > Typically, we needed an LU factorization on fraction-based matrices to > compute exactly some coefficients in various other algorithms (think > high order approximation, derivatives ...). Field just seemed the right > name because we really needed only the basic field operations. > > This interface was not intended as a step towards complete algebra > support. There have been some questions about that, but we chose to not > go this way (at that time), as we still have very limited resources. We > do not have Group, AbelianGroup or Ring interfaces for example. > > There was also a Jira issue about adding more operations (typically > sqrt, which would for example allow support for Cholesky decomposition). > See . This would clearly > imply at least one additional interface level since for example sqrt is > not an internal operation for fractions. We finally decided not to > implement this, as the initial need was limited to Complex only. > > I am slightly reluctant to change FieldElement to an abstract class. > What do other people think about this ? I think that we should think about it... Later. ;-) Best, Gilles --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org