changeset 19587:1572b5276b9a gui-release

maint: Periodic merge of stable to gui-release.
author John W. Eaton <jwe@octave.org>
date Mon, 08 Dec 2014 10:15:54 -0500
parents c1ce43276b86 (current diff) 616f2b22787b (diff)
children 9464cfeede2b 1085a65e9b9b
files libinterp/corefcn/load-save.cc
diffstat 3 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/load-save.cc
+++ b/libinterp/corefcn/load-save.cc
@@ -895,6 +895,11 @@
                        orig_fname.c_str ());
             }
         }
+      else
+        {
+          error ("load: unable to determine file format of '%s'",
+                 orig_fname.c_str ());
+        }
     }
 
   return retval;
--- a/scripts/general/interp1.m
+++ b/scripts/general/interp1.m
@@ -329,6 +329,7 @@
     minx = min (x(1), x(nx));
     maxx = max (x(1), x(nx));
 
+    xi = reshape (xi, szx);
     outliers = xi < minx | ! (xi <= maxx); # this even catches NaNs
     if (size_equal (outliers, yi))
       yi(outliers) = extrap;
@@ -338,6 +339,7 @@
     else
       yi(outliers.') = extrap;
     endif
+
   endif
 
 endfunction
@@ -612,6 +614,8 @@
 ## test extrapolation (linear)
 %!assert (interp1 ([1:5],[3:2:11],[0,6],"linear","extrap"), [1, 13], eps)
 %!assert (interp1 (xp, yp, [-1, max(xp)+1],"linear",5), [5, 5])
+%!assert (interp1 ([0,1],[1,0],[0.1,0.9;0.2,1.1]), [0.9 0.1; 0.8 NA], eps)
+%!assert (interp1 ([0,1],[1,0],[0.1,0.9;0.2,1]), [0.9 0.1; 0.8 0], eps)
 
 ## Basic sanity checks
 %!assert (interp1 (1:2,1:2,1.4,"nearest"), 1)
--- a/scripts/time/datevec.m
+++ b/scripts/time/datevec.m
@@ -149,7 +149,7 @@
     date = date(:);
 
     ## Move day 0 from midnight -0001-12-31 to midnight 0000-3-1
-    z = floor (date) - 60;
+    z = double (floor (date) - 60);
     ## Calculate number of centuries; K1 = 0.25 is to avoid rounding problems.
     a = floor ((z - 0.25) / 36524.25);
     ## Days within century; K2 = 0.25 is to avoid rounding problems.
@@ -314,4 +314,6 @@
 %!test
 %! t = linspace (-2e5, 2e5, 10993);
 %! assert (all (abs (datenum (datevec (t)) - t') < 1e-5));
+%!assert (double (datevec (int64 (datenum ([2014 6 1])))), datevec (datenum ([2014 6 1])))
+%!assert (double (datevec (int64 (datenum ([2014 6 18])))), datevec (datenum ([2014 6 18])))