changeset 26671:12b6065efa25

Improve performance of certain movXXX functions by ~4X (bug #55389). * movmax.m: Call function with "Endpoints", -Inf. * movmin.m: Call function with "Endpoints", Inf. * movprod.m: Call function with "Endpoints", 1. * movsum.m: Call function with "Endpoints", 0.
author Rik <rik@octave.org>
date Sun, 03 Feb 2019 21:44:38 -0800
parents 879f22ca59c8
children 4271b53b24a6
files scripts/statistics/movmax.m scripts/statistics/movmin.m scripts/statistics/movprod.m scripts/statistics/movsum.m
diffstat 4 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/statistics/movmax.m	Sun Feb 03 16:35:34 2019 +0100
+++ b/scripts/statistics/movmax.m	Sun Feb 03 21:44:38 2019 -0800
@@ -127,7 +127,8 @@
     print_usage ();
   endif
 
-  y = movfun (@max, x, wlen, __parse_movargs__ ("movmax", varargin{:}){:});
+  y = movfun (@max, x, wlen, "Endpoints", -Inf,
+              __parse_movargs__ ("movmax", varargin{:}){:});
 
 endfunction
 
--- a/scripts/statistics/movmin.m	Sun Feb 03 16:35:34 2019 +0100
+++ b/scripts/statistics/movmin.m	Sun Feb 03 21:44:38 2019 -0800
@@ -127,7 +127,8 @@
     print_usage ();
   endif
 
-  y = movfun (@min, x, wlen, __parse_movargs__ ("movmin", varargin{:}){:});
+  y = movfun (@min, x, wlen, "Endpoints", Inf,
+              __parse_movargs__ ("movmin", varargin{:}){:});
 
 endfunction
 
--- a/scripts/statistics/movprod.m	Sun Feb 03 16:35:34 2019 +0100
+++ b/scripts/statistics/movprod.m	Sun Feb 03 21:44:38 2019 -0800
@@ -127,7 +127,8 @@
     print_usage ();
   endif
 
-  y = movfun (@prod, x, wlen, __parse_movargs__ ("movprod", varargin{:}){:});
+  y = movfun (@prod, x, wlen, "Endpoints", 1,
+              __parse_movargs__ ("movprod", varargin{:}){:});
 
 endfunction
 
--- a/scripts/statistics/movsum.m	Sun Feb 03 16:35:34 2019 +0100
+++ b/scripts/statistics/movsum.m	Sun Feb 03 21:44:38 2019 -0800
@@ -127,7 +127,8 @@
     print_usage ();
   endif
 
-  y = movfun (@sum, x, wlen, __parse_movargs__ ("movsum", varargin{:}){:});
+  y = movfun (@sum, x, wlen, "Endpoints", 0,
+              __parse_movargs__ ("movsum", varargin{:}){:});
 
 endfunction