Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 91C9D6DD3 for ; Wed, 27 Jul 2011 14:51:35 +0000 (UTC) Received: (qmail 51022 invoked by uid 500); 27 Jul 2011 14:51:34 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 50816 invoked by uid 500); 27 Jul 2011 14:51:34 -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 50808 invoked by uid 99); 27 Jul 2011 14:51:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2011 14:51:34 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2011 14:51:31 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 29BE98B645 for ; Wed, 27 Jul 2011 14:51:10 +0000 (UTC) Date: Wed, 27 Jul 2011 14:51:10 +0000 (UTC) From: =?utf-8?Q?S=C3=A9bastien_Brisard_=28JIRA=29?= To: issues@commons.apache.org Message-ID: <155084339.12098.1311778270167.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1263779188.2691.1310383559891.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (MATH-613) Equivalent of Blas DAXPY MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MATH-613?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] S=C3=A9bastien Brisard updated MATH-613: ----------------------------------- Attachment: MATH-613-20110727.patch You're right. I've eliminated as much duplicate code as possible. This is i= ndeed cleaner. Also checked the "Grant license to ASF" button... Sorry for the mess. > Equivalent of Blas DAXPY > ------------------------ > > Key: MATH-613 > URL: https://issues.apache.org/jira/browse/MATH-613 > Project: Commons Math > Issue Type: New Feature > Affects Versions: 3.0 > Reporter: S=C3=A9bastien Brisard > Priority: Minor > Labels: linear, vector > Attachments: MATH-613-20110727.patch, MATH-613-20110727.patch, MA= TH-613-20110727.patch > > > In Blas, the method {{DAXPY}} computes an in-place linear combination of = two vectors. More precisely, a call to {{DAXPY(a, x, y)}} updates vector {{= y}} with the value of {{a * x + y}}. This can lead to very compact code, wh= ich I feel the need for in Commons-Math. However, DAXPY also has its limita= tions. For example, it cannot perform the other combination {{y <- x + a * = y}}. > I think it would be useful that {{RealVector}} had a method for computing= {{a * this + b * y}}, and storing the result in {{this}}. In the spirit of= the {{mapToSelf}} method, I propose to create two new methods in {{Interfa= ce RealVector}} > {noformat}RealVector map(BivariateRealFunction f, RealVector y){noformat} > and > {noformat}RealVector mapToSelf(BivariateRealFunction f, RealVector y){nof= ormat} > The former would return a new vector {{v}} such that > {noformat}v[i] <- f(this[i], y[i])}}{noformat} > and the latter would update {{this}}, > {noformat}this[i] <- f(this[i], y[i]){noformat} > Emulating {{DAXPY}} would then simply be a matter of implementing the app= ropriate bivariate function. > While we are at it, how about > {noformat}RealVector map(TrivariateRealFunction f, RealVector y, RealVect= or z){noformat} > {noformat}RealVector mapToSelf(TrivariateRealFunction f, RealVector y, Re= alVector z){noformat} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira