octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #56884] mean can overflow


From: Marco Caliari
Subject: [Octave-bug-tracker] [bug #56884] mean can overflow
Date: Tue, 17 Sep 2019 03:06:06 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0

Follow-up Comment #13, bug #56884 (project octave):

I see the following


octave:29> x=randn(200,201,202);
octave:30> tic,mean(x);,toc
Elapsed time is 0.00880623 seconds.
octave:31> tic,mean(x);,toc
Elapsed time is 0.00801992 seconds.
octave:32> tic,iter_mean(x);,toc
Elapsed time is 0.055238 seconds.
octave:33> tic,iter_mean(x);,toc
Elapsed time is 0.0553889 seconds.
octave:34> tic,pairwise_mean(x);,toc
Elapsed time is 0.352085 seconds.
octave:35> tic,pairwise_mean(x);,toc
Elapsed time is 0.358778 seconds.
octave:36> ver
----------------------------------------------------------------------
GNU Octave Version: 5.1.1 (hg id: 232102b1e920)
GNU Octave License: GNU General Public License
Operating System: Linux 4.18.0-25-generic #26~18.04.1-Ubuntu SMP


So, mean is the fastest, then iter_mean, finally pairwise_mean. I attach a new
version of iter_mean which fixes a problem with simple vectors.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56884>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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