help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A faster sum


From: John W. Eaton
Subject: Re: A faster sum
Date: Sat, 21 May 2005 18:41:57 -0400

On 21-May-2005, Victor Eijkhout wrote:

| 
| On May 21, 2005, at 4:19 PM, Keith Goodman wrote:
| 
| > So does it make sense to modify the built-in function sum to use
| > matrix multiplication?
| 
| I wouldn't do it.

Neither would I.

There is a simple explanation for why sum is currently slow.  It's
related to the fact that it needs to work across any dimentsion for
N-d arrays.  Probably the current code for that is not so good.  We
can probably optimize a few simple cases.  Or maybe someone will have
a smarter way to do what we need, perhaps by doing something more
intelligent with strides in a single loop or something.  I don't have
time to think about how to fix the problem just now, but the code to
look at is in the macro MX_ND_REDUCTION in liboctave/mx-inlines.cc.

jwe



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]