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 3DD97105A8 for ; Mon, 24 Feb 2014 20:57:51 +0000 (UTC) Received: (qmail 14726 invoked by uid 500); 24 Feb 2014 20:57:47 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 14627 invoked by uid 500); 24 Feb 2014 20:57:46 -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 14619 invoked by uid 99); 24 Feb 2014 20:57:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Feb 2014 20:57:46 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [132.250.34.42] (HELO SpaceCAS.spacenet.nrl.navy.mil) (132.250.34.42) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Feb 2014 20:57:42 +0000 Received: from [IPv6:2001:480:20:30:21f:bcff:fe0e:a0b] (2001:480:20:30:21f:bcff:fe0e:a0b) by SpaceCAS.nrl.navy.mil (2001:480:20:34:34::42) with Microsoft SMTP Server (TLS) id 14.3.174.1; Mon, 24 Feb 2014 15:57:18 -0500 Message-ID: <530BB22E.1010306@nrl.navy.mil> Date: Mon, 24 Feb 2014 15:57:18 -0500 From: Evan Ward User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Ted Dunning , Commons Developers List Subject: Re: [math] refactoring least squares References: <64280e22250e84264523f3bbcb6f7bc5@smtp.spaceroots.org> <4b0e7e4526087ac55b8dde8fae89ba4b@scarlet.be> <53060FAD.6000308@nrl.navy.mil> <50707ec44ff44e4e8073166ebcff1156@scarlet.be> <530B7816.2000808@nrl.navy.mil> In-Reply-To: Content-Type: multipart/alternative; boundary="------------030905040503070506030107" X-Originating-IP: [2001:480:20:30:21f:bcff:fe0e:a0b] X-Virus-Checked: Checked by ClamAV on apache.org --------------030905040503070506030107 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 02/24/2014 02:18 PM, Ted Dunning wrote: > > On Mon, Feb 24, 2014 at 10:23 AM, Gilles > wrote: > > One way to improve performance would be to provide > pre-allocated space > for the Jacobian and reuse it for each evaluation. > > > Do you have actual data to back this statement? > > > The > LeastSquaresProblem interface would then be: > > void evaluate(RealVector point, RealVector resultResiduals, > RealVector > resultJacobian); > > I'm interested in hearing your ideas on other approaches to > solve this > issue. Or even if this is an issue worth solving. > > > Not before we can be sure that in-place modification (rather than > reallocation) always provides a performance benefit. > > > Allocation is rarely the problem in these situations. The implied > copying of data is. > > And even the copying isn't always a problem. For instance, it often > pays off big to copy data to column (or row) major representation to > improve cache coherency. The result is that a large fraction of the > time is spent copying, but without the copying, the remaining time > would take 10x longer. The net time taken is 3x faster with the copy. Agreed. Perhaps by providing the result matrix the optimization algorithm can choose the best data layout for itself. Regards, Evan --------------030905040503070506030107--