Mercurial > octave-nkf
diff scripts/general/quadgk.m @ 20652:a3b9ee5c040a
Replace bsxfun with broadcasting for performance with complex inputs (bug #38628).
cumtrapz.m, quadgk.m, trapz.m, center.m, zscore.m: Replace bsxfun with
broadcasting for performance where inputs might be complex.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 12 Oct 2015 21:28:32 -0700 |
parents | 7503499a252b |
children |
line wrap: on
line diff
--- a/scripts/general/quadgk.m Mon Oct 12 21:13:47 2015 -0700 +++ b/scripts/general/quadgk.m Mon Oct 12 21:28:32 2015 -0700 @@ -420,7 +420,7 @@ halfwidth = diff (subs, [], 2) ./ 2; center = sum (subs, 2) ./ 2;; - x = bsxfun (@plus, halfwidth * abscissa, center); + x = (halfwidth * abscissa) + center; y = reshape (f (x(:)), size (x)); ## This is faster than using bsxfun as the * operator can use a