Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 81729 invoked from network); 3 Apr 2010 20:52:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 Apr 2010 20:52:14 -0000 Received: (qmail 39760 invoked by uid 500); 3 Apr 2010 20:52:13 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 39687 invoked by uid 500); 3 Apr 2010 20:52:13 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 39679 invoked by uid 99); 3 Apr 2010 20:52:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Apr 2010 20:52:13 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Apr 2010 20:52:10 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3B201234C4C6 for ; Sat, 3 Apr 2010 20:51:29 +0000 (UTC) Message-ID: <177760906.677141270327889241.JavaMail.jira@brutus.apache.org> Date: Sat, 3 Apr 2010 20:51:29 +0000 (UTC) From: "Phil Steitz (JIRA)" To: issues@commons.apache.org Subject: [jira] Closed: (MATH-313) Functions could be more object-oriented without losing any power. In-Reply-To: <2066637627.1256803739367.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MATH-313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Phil Steitz closed MATH-313. ---------------------------- > Functions could be more object-oriented without losing any power. > ----------------------------------------------------------------- > > Key: MATH-313 > URL: https://issues.apache.org/jira/browse/MATH-313 > Project: Commons Math > Issue Type: New Feature > Affects Versions: 2.0 > Environment: all > Reporter: Jake Mannix > Fix For: 2.1 > > > UnivariateRealFunction, for example, is a map from R to R. The set of such functions has tons and tons of structure: in addition to being an algebra, equipped with +,-,*, and scaling by constants, it maps the same space into itself, so it is composable, both pre and post. > I'd propose we add: > {code} > UnivariateRealFunction plus(UnivariateRealFunction other); > UnivariateRealFunction minus(UnivariateRealFunction other); > UnivariateRealFunction times(UnivariateRealFunction other); > UnivariateRealFunction times(double scale); > UnivariateRealFunction preCompose(UnivariateRealFunction other); > UnivariateRealFunction postCompose(UnivariateRealFunction other); > {code} > to the interface, and then implement them in an AbstractUnivariateRealFunction base class. No implementer would need to notice, other than switching to extend this class rather than implement UnivariateRealFunction. > Many people don't need or use this, but... it makes for some powerfully easy code: > {code}UnivariateRealFunction gaussian = Exp.preCompose(Negate.preCompose(Pow2));{code} > which is even nicer when done anonymously passing into a map/collect method (a la MATH-312). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.