changeset 14834:619fedc6ea61

ppval.m: Small efficiency improvement in determining offsets. * ppval.m: Transpose and repmat smaller object rather than constructing larger object and transposing it.
author Rik <octave@nomad.inbox5.com>
date Tue, 03 Jul 2012 08:50:43 -0700
parents e437bacb3ef6
children 821708f96efd 8b4606e3be32
files scripts/polynomial/ppval.m
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/polynomial/ppval.m	Mon Jul 02 10:26:19 2012 +0200
+++ b/scripts/polynomial/ppval.m	Tue Jul 03 08:50:43 2012 -0700
@@ -68,8 +68,8 @@
   ndv = length (dimvec);
 
   ## Offsets.
-  dx = (xi - x(idx))(:);
-  dx = repmat (dx, [1, prod(d)])';
+  dx = (xi - x(idx))(:)';
+  dx = repmat (dx, [prod(d), 1]);
   dx = reshape (dx, dimvec);
   dx = shiftdim (dx, ndv - 1);