changeset 22728:ed99654ec281

maint: Periodic merge of stable to default.
author Rik <rik@octave.org>
date Sun, 06 Nov 2016 16:18:15 -0800
parents dd2f547c21a0 (current diff) 125391edc71b (diff)
children 66d73a5a48b0
files
diffstat 3 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/build-aux/mk-opts.pl	Fri May 22 13:04:32 2015 -0400
+++ b/build-aux/mk-opts.pl	Sun Nov 06 16:18:15 2016 -0800
@@ -913,7 +913,7 @@
 
 Options include
 
-\@table \@code
+\@table \@asis
 _END_EMIT_OPTIONS_FUNCTION_HDR_
 # FIXME: Add extra newline above
 
--- a/libinterp/corefcn/file-io.cc	Fri May 22 13:04:32 2015 -0400
+++ b/libinterp/corefcn/file-io.cc	Sun Nov 06 16:18:15 2016 -0800
@@ -2603,7 +2603,7 @@
         doc: /* -*- texinfo -*-
 @deftypefn  {} {@var{msg} =} ferror (@var{fid})
 @deftypefnx {} {[@var{msg}, @var{err}] =} ferror (@var{fid})
-@deftypefnx {} {[@var{dots}] =} ferror (@var{fid}, "clear")
+@deftypefnx {} {[@dots{}] =} ferror (@var{fid}, "clear")
 Query the error status of the stream specified by file descriptor @var{fid}
 
 If an error condition exists then return a string @var{msg} describing the
@@ -2651,7 +2651,7 @@
 The name of the command to run is given by @var{command}.  The argument
 @var{mode} may be
 
-@table @code
+@table @asis
 @item @qcode{"r"}
 The pipe will be connected to the standard output of the process, and
 open for reading.
--- a/scripts/general/interp2.m	Fri May 22 13:04:32 2015 -0400
+++ b/scripts/general/interp2.m	Sun Nov 06 16:18:15 2016 -0800
@@ -221,11 +221,17 @@
 
       ## Get 2D index.
       idx = sub2ind (size (a), yidx, xidx);
-      ## We can dispose of the 1D indices at this point to save memory.
+      ## Dispose of the 1D indices at this point to save memory.
       clear xidx yidx;
 
-      ## apply plane equation
-      ZI = a(idx) + b(idx).*Xsc + c(idx).*Ysc + d(idx).*Xsc.*Ysc;
+      ## Apply plane equation
+      ## Handle case where idx and coefficients are both vectors and resulting
+      ## coeff(idx) follows orientation of coeff, rather than that of idx.
+      forient = @(x) reshape (x, size (idx));
+      ZI =   forient (a(idx))        ...
+           + forient (b(idx)) .* Xsc ...
+           + forient (c(idx)) .* Ysc ...
+           + forient (d(idx)) .* Xsc.*Ysc;
 
     elseif (strcmp (method, "nearest"))
       ii = (XI - X(xidx) >= X(xidx + 1) - XI);
@@ -527,7 +533,6 @@
 %! assert (interp2 (x,y,orig, xi, yi,"linear", 0+1i), [0+1i,0+1i;0+1i,0+1i]);
 %! assert (interp2 (x,y,orig, xi, yi,"spline"), [27,43;512,528]);
 
-
 %!test  # for values at boundaries
 %! A = [1,2;3,4];
 %! x = [0,1];
@@ -543,6 +548,9 @@
 %!assert <41838> (interp2 ([1 2 3], [3 2 1], magic (3), 2.5, 3), 3.5)
 %!assert <41838> (interp2 ([3 2 1], [1 2 3], magic (3), 1.5, 1), 3.5)
 
+## Linear interpretation with vector XI doesn't lead to matrix output
+%!assert <49506> (interp2 ([2 3], [2 3 4], [1 2; 3 4; 5 6], [2 3], 3, "linear"), [3 4])
+
 %!shared z, zout, tol
 %! z = [1 3 5; 3 5 7; 5 7 9];
 %! zout = [1 2 3 4 5; 2 3 4 5 6; 3 4 5 6 7; 4 5 6 7 8; 5 6 7 8 9];