help-octave
[Top][All Lists]
Advanced

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

Re: A faster sum


From: Keith Goodman
Subject: Re: A faster sum
Date: Sat, 21 May 2005 13:19:32 -0700

So does it make sense to modify the built-in function sum to use
matrix multiplication? For now, I'm using these two functions for
sum(x,1) and sum(x,2) in loops with lots and lots of iterations:

function y = sum1(x)
y = ones(1,size(x,1))*x;

function y = sum2(x)
y = x*ones(size(x,2),1);



-------------------------------------------------------------
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]